Kaynağa Gözat

产品详情界面制作

kindring 2 yıl önce
ebeveyn
işleme
9bb69aa478
1 değiştirilmiş dosya ile 16 ekleme ve 3 silme
  1. 16 3
      pages/product/item/index.vue

+ 16 - 3
pages/product/item/index.vue

@@ -4,10 +4,23 @@
     <item-banner :title="productTypeText" :sub-title="productTypeSubText"></item-banner>
     <div class="conBox big-title">
       <span >
-        {{}}
+        {{product.name}}
       </span>
       <div class="hr"></div>
     </div>
+    <div class="product-view">
+      <div class="left">
+        <div class="imgView">
+          <img :src="product.image"/>
+        </div>
+        <div class="concatUs">
+<!--          联系销售 -->
+        </div>
+      </div>
+      <div class="right">
+
+      </div>
+    </div>
 <!--    产品展示页面 -->
 <!--    页脚 -->
     <default-footer :lang="lang"/>
@@ -36,12 +49,12 @@ export default {
   beforeMount() {
     const queryString = window.location.search;
     const params = new URLSearchParams(queryString);
-
     if(params&&params.get('id')){
       this.productId = params.get('id');
     }else{
       window.location.href = '/product'
     }
+    this.loadProductDetail();
   },
   mounted() {
     console.log(this.pType);
@@ -65,7 +78,7 @@ export default {
       }
       let result = res.data;
       if(result.rcode === 1){
-
+        this.productDetail = result.data;
       }else{
         console.log('not match result');
         console.log(result);