فهرست منبع

Merge branch 'master' of 121.43.114.153:/home/git/repositories/mshop

DESKTOP-SYIYI\Dell 7 سال پیش
والد
کامیت
803216540b
2فایلهای تغییر یافته به همراه21 افزوده شده و 8 حذف شده
  1. 18 6
      src/components/goods/goods_detail.vue
  2. 3 2
      src/lib/api.js

+ 18 - 6
src/components/goods/goods_detail.vue

@@ -50,7 +50,7 @@
                 <cell title="产品参数"></cell>
                 <cell-form-preview v-if="datas!=null" :list="attrs"></cell-form-preview>
             </group>
-            <iframe :src="getGoodsWebView" frameborder="0" width="100%" height="3000" scrolling="no" id="iframe_webview"></iframe>
+            <div v-html="goodsHtml" class="goods_html"></div>
             <tabbar :class="{display_none:showPopup}">
                 <tabbar-item link="/main/shopping_cart">
                     <img slot="icon" src="../../assets/tabbar_shopcar_default@2x.png">
@@ -148,7 +148,18 @@
         });
         },
         mounted(){
-                document.body.scrollTop = 0;
+            this.$http.jsonp(Api.goodsContent(this.goods_id)).then(function(res){
+                if (res.body.code != 200) {
+                    this.$vux.toast.show({
+                        type: 'text',
+                        text: res.body.message,
+                        position: 'middle',
+                        width: '600px'
+                    });
+                    return;
+                }
+                this.goodsHtml = res.body.datas.body;
+            });
         },
         beforeDestroy(){
             document.body.removeEventListener('touchmove',this.noscroll,false);
@@ -161,7 +172,8 @@
                 showPopup:false,
                 goodsNumber:1,
                 check_goods_id:'',
-                isCart:false
+                isCart:false,
+                goodsHtml:''
             }
         },
         methods:{
@@ -294,9 +306,6 @@
             getSpecName(){
                 return this.datas.common_info.spec_name;
             },
-            getGoodsWebView(){
-                return Api.goodsContent(this.goods_id);
-            },
             getOneSummary(){
                 if(!this.summary)return;
                 let goods_id=this.check_goods_id?this.check_goods_id:this.goods_id;
@@ -523,4 +532,7 @@
         right: 15px;
         top: 15px;
     }
+    .goods_html {
+        margin-bottom: 101px;
+    }
 </style>

+ 3 - 2
src/lib/api.js

@@ -1,7 +1,8 @@
 class Api {
 
     static host() {
-        return "http://p.lrlz.com";
+        // return "http://p.lrlz.com";
+        return "http://192.168.0.200";
     }
 
     static special(special_id) {
@@ -29,7 +30,7 @@ class Api {
     }
 
     static goodsContent(goods_id) {
-        return this.host() + `/mobile/index.php?act=goods&op=detail&goods_id=${goods_id}&client_type=ajax`
+        return this.host() + `/mobile/index.php?act=goods_common&op=detail_ajax&goods_id=${goods_id}&client_type=ajax`
     }
 
     static memberInfo() {