Jelajahi Sumber

修改goods和product字段

yangc 7 tahun lalu
induk
melakukan
498847b874

+ 3 - 1
components/main/Search.vue

@@ -208,8 +208,8 @@
           if (route.path === '/search') {
             this.newSearchType = route.query.type || 'component'
             this.keyword = route.query.w || ''
+            this.isInit = true
           }
-          this.isInit = true
         },
         immediate: true
       }
@@ -248,10 +248,12 @@
       },
       onChange () {
         this.associate.activeIndex = null
+        console.log(this.isInit)
         if (!this.keyword) {
           this.associate.show = false
           this.$store.dispatch('resetSearchKeywords')
         } else {
+          console.log(1)
           if (!this.isInit) {
             this.searchKeywords()
           } else {

+ 4 - 4
components/search/ForwardGoodsList.vue

@@ -15,7 +15,7 @@
           <td>
             <div class="line">
               <span class="title inline-block">型号</span>
-              <span class="content inline-block" :title="item.code" v-text="item.code || '-'"></span>
+              <span class="content inline-block" :title="item.cmpCode" v-text="item.cmpCode || '-'"></span>
             </div>
             <div class="line">
               <span class="title inline-block">品牌</span>
@@ -75,9 +75,9 @@
     },
     methods: {
       goSeek: function (item) {
-        this.productItem.cmpCode = item.code
-        this.productItem.brand = item.brand.nameEn
-        this.productItem.prodName = item.kind.nameCn
+        this.productItem.cmpCode = item.cmpCode
+        this.productItem.brand = item.pbrand || item.pbranden
+        this.productItem.prodName = item.kind || item.kinden
         this.productItem.spec = item.spec
         this.showSeekObj.show = true
       }

+ 1 - 1
components/search/GoodList.vue

@@ -65,7 +65,7 @@
             <td class="brand-code">
               <img v-if="item.status === 602" class="sellout-flag" src="/images/search/sellout-search.png" alt="">
               <div class="brand" v-if="item.branduuid"><nuxt-link :to="`/product/brand/${item.branduuid}`" class="text-num" v-text="item.brandNameCn || item.brandNameEn || '-'"></nuxt-link></div>
-              <div class="brand" v-if="!item.brand||!item.brand.nameEn">{{item.brandEn||'—'}}</div>
+              <div class="brand" v-if="!item.branduuid">{{item.brandNameCn || item.brandNameEn || '-'}}</div>
               <div class="brand" v-if="item.kindUuid"><nuxt-link :to="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></nuxt-link></div>
               <div class="brand" v-if="!item.kindUuid">{{item.kindNameCn || '—'}}</div>
               <div class="code"  v-if="item.code">