Quellcode durchsuchen

店铺搜索页点击器件跳转,和销量字段增加。

yangc vor 8 Jahren
Ursprung
Commit
7ba8ef3d37
1 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. 10 4
      components/searchStore/StoreContent.vue

+ 10 - 4
components/searchStore/StoreContent.vue

@@ -17,7 +17,7 @@
           </span>
         </div>
         <div class="component-count">
-          <span style="margin-right: 30px">销量:<span>0</span></span>
+          <span style="margin-right: 30px">销量:<span v-text="salesData[index]"></span></span>
           <span>库存量:<span v-text="store.totalReserve"></span></span>
         </div>
         <div class="btn-content">
@@ -26,7 +26,7 @@
         </div>
       </div>
       <ul class="store-component-list" v-if="componentData">
-        <li v-for="item in componentData[index].content">
+        <li v-for="(item, index2) in componentData[index].content" @click="goStore(index, index2)">
           <!--<a :href="`/product/component/${item.uuid}`" style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
           <div class="describe-list">
             <a style="margin-bottom: 8px" :href="`/product/component/${item.uuid}`" class="store-component-code" v-text="item.code" :title="item.code"></a>
@@ -36,8 +36,8 @@
           <a style="display: block"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
           <div class="describe-list">
             <a class="store-component-code" v-text="item.code" :title="item.code"></a>
-            <a v-text="item.brandNameEn"></a>
-            <a v-text="item.kindNameCn"></a>
+            <a v-text="item.brandNameEn" :title="item.brandNameEn"></a>
+            <a v-text="item.kindNameCn" :title="item.kindNameCn"></a>
           </div>
         </li>
       </ul>
@@ -87,6 +87,9 @@
       },
       componentData () {
         return this.storeDetail[1].image
+      },
+      salesData () {
+        return this.storeDetail[1].sales
       }
     },
     methods: {
@@ -119,6 +122,9 @@
       },
       listenPage: function (page) {
         this.$emit('pageAction', page)
+      },
+      goStore: function (index, compIndex) {
+        window.open('/product/component/' + this.componentData[index].content[compIndex].uuid)
       }
     }
   }