Browse Source

测试bug修改

yangc 7 years ago
parent
commit
23c0527254

+ 4 - 4
components/applyPurchase/SayPrice.vue

@@ -11,12 +11,12 @@
         <div class="content">
           <div class="content-line">
             <div class="form-item form-left text-line">
-              <span>类目(产品名称):</span><span class="text" :title="purchaseManList.content[currentSayPriceIndex].prodTitle">{{purchaseManList.content[currentSayPriceIndex].prodTitle || '-'}}</span>
+              <span>品牌:</span><span class="text"  :title="purchaseManList.content[currentSayPriceIndex].inbrand">{{purchaseManList.content[currentSayPriceIndex].inbrand}}</span>
             </div>
           </div>
           <div class="content-line">
             <div class="form-item form-left text-line">
-              <span>规格:</span><span class="text"  :title="purchaseManList.content[currentSayPriceIndex].spec">{{purchaseManList.content[currentSayPriceIndex].spec || '-'}}</span>
+              <span>类目(产品名称):</span><span class="text" :title="purchaseManList.content[currentSayPriceIndex].prodTitle">{{purchaseManList.content[currentSayPriceIndex].prodTitle || '-'}}</span>
             </div>
           </div>
           <div class="content-line">
@@ -26,7 +26,7 @@
           </div>
           <div class="content-line">
             <div class="form-item form-left text-line">
-              <span>品牌:</span><span class="text"  :title="purchaseManList.content[currentSayPriceIndex].inbrand">{{purchaseManList.content[currentSayPriceIndex].inbrand}}</span>
+              <span>规格:</span><span class="text"  :title="purchaseManList.content[currentSayPriceIndex].spec">{{purchaseManList.content[currentSayPriceIndex].spec || '-'}}</span>
             </div>
           </div>
           <div class="content-line">
@@ -351,7 +351,7 @@
           &.form-left {
             span {
               display: inline-block;
-              width: 104px;
+              width: 115px;
               text-align: right;
             }
             input {

+ 24 - 2
components/mobile/base/SearchHeader.vue

@@ -24,7 +24,7 @@
       </template>
       <template v-if="similarList.brand && similarList.brand.length">
         <li class="title text-ellipse">品牌</li>
-        <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 4)" @click="onSearch(brand.nameCn, 'brand', $event)">{{brand.nameCn}}</li>
+        <li class="text-ellipse" v-for="brand in similarList.brand.slice(0, 4)" @click="onSearch(brand.nameEn, 'brand', $event)">{{brand.nameEn}}</li>
       </template>
       <template v-if="similarList.kind && similarList.kind.length">
         <li class="title text-ellipse">类目</li>
@@ -112,7 +112,29 @@
           })
         } else {
           let sType = null
-          if (this.type === 'supplier' && this.keyword && this.keyword !== '') {
+          if (this.type === 'default' && this.keyword && this.keyword !== '') {
+            if (this.similarList.component[0] && this.keyword === this.similarList.component[0].code) {
+              sType = 'code'
+            } else if (this.similarList.brand[0] && this.keyword === this.similarList.brand[0].nameEn) {
+              sType = 'brand'
+            } else if (this.similarList.kind[0] && this.keyword === this.similarList.kind[0].nameCn) {
+              sType = 'kind'
+            } else {
+              let arr = [...this.similarList.component, ...this.similarList.brand, ...this.similarList.kind]
+              if (arr[0]) {
+                if (arr[0].code) {
+                  this.keyword = arr[0].code
+                  sType = 'code'
+                } else if (arr[0].nameEn) {
+                  this.keyword = arr[0].nameEn
+                  sType = 'brand'
+                } else if (arr[0].nameCn) {
+                  this.keyword = arr[0].nameCn
+                  sType = 'kind'
+                }
+              }
+            }
+          } else if (this.type === 'supplier' && this.keyword && this.keyword !== '') {
             if (this.similarList.pCmpCode[0] && this.keyword === this.similarList.pCmpCode[0].pCmpCode) {
               sType = 'pCmpCode'
             } else if (this.similarList.pBrandEn[0] && this.keyword === this.similarList.pBrandEn[0].nameEn) {

+ 0 - 1
pages/mobile/center/vendor/product.vue

@@ -147,7 +147,6 @@
               <div class="info"><div class="name">品牌:</div><div>{{cnmpBand}}</div></div>
               <div class="info"><div class="name">类目(产品名称):</div><div>{{cnmpType || '-'}}</div></div>
               <div class="info"><div class="name">型号:</div><div>{{cnmpCode}}</div></div>
-              <div class="info"><div class="name">规格:</div><div>{{cnmpSpec}}</div></div>
             </div>
             <div class="content_sq" v-bind:key="item.id" v-for="(item, index) in vendorlist" >
               <div class="labelBg">

+ 9 - 3
pages/mobile/shop/index.vue

@@ -76,7 +76,8 @@
         enterpriseInfo: {},
         showLoginBox: false,
         keyword: this.$route.query.keyword,
-        url: ''
+        url: '',
+        field: null
       }
     },
     components: {
@@ -143,7 +144,7 @@
         if (!this.isSearchingMore) {
           this.page++
           this.isSearchingMore = true
-          this.$store.dispatch('provider/findStoreListInMobil', { page: this.page, count: this.count, type: this.types, keyword: this.keyword || null })
+          this.reloadData()
         }
       },
       isType (type) {
@@ -183,7 +184,10 @@
         } else if (type === 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT') {
           this.downName = '全部'
         }
-        this.$store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, type: type, keyword: this.keyword || null })
+        this.reloadData()
+      },
+      reloadData () {
+        this.$store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, type: this.type, keyword: this.keyword || null, field: this.field })
       },
       focusStore: function (item, $event) {
 //        item.isFocus = item.isFocus === 'false' ? 'true' : 'false'
@@ -221,7 +225,9 @@
         return str && str.trim() !== ''
       },
       onSearch: function (keyObj) {
+//        console.log(keyObj)
         this.keyword = keyObj.keyword
+        this.field = keyObj.type ? 'similar' : null
         this.onDown('ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT')
         this.down = false
       }