Kaynağa Gözat

Merge branch 'cps' into test

panyong 2 yıl önce
ebeveyn
işleme
5c867694a9

+ 2 - 2
htmldev/cps/README.md

@@ -24,10 +24,10 @@ npm run lint
 See [Configuration Reference](https://cli.vuejs.org/config/).
 
 ### todo list
-- [ ] 商家logo默认/选中2种状态
+- [x] 商家logo默认/选中2种状态
 - [ ] 测试省钱页跳转微信小程序
 - [x] 搜索页
 - [ ] 分享测试:默认、带有分享人信息、分享赚钱、商品列表及详情
 - [x] 商品详情页:淘宝复制口令
 - [x] 底部导航:新增购物
-- [ ] 不同商家返回的字段:目前发现拼多多的商品ID对不上
+- [x] 不同商家返回的字段:目前发现拼多多的商品ID对不上

BIN
htmldev/cps/src/assets/businessLogo/taobao0.png


BIN
htmldev/cps/src/assets/businessLogo/taobao1.png


BIN
htmldev/cps/src/assets/businessLogo/taobao2.png


+ 4 - 1
htmldev/cps/src/store/modules/common.js

@@ -50,7 +50,10 @@ const state = {
     },
     {
       name: '淘宝',
-      value: 'taobao'
+      value: 'taobao',
+      default: require('../../assets/businessLogo/taobao0.png'),
+      active: require('../../assets/businessLogo/taobao1.png'),
+      logo: require('../../assets/businessLogo/taobao2.png')
     }
   ]
 }

+ 6 - 3
htmldev/cps/src/views/search/child/main.vue

@@ -117,7 +117,8 @@ export default {
       pagenum: 0,
       pagesize: 20,
       list: [],
-      scroll: null
+      scroll: null,
+      currentSource: ''
     }
   },
   computed: {
@@ -125,7 +126,7 @@ export default {
       return this.$store.getters['common/sourceList']
     },
     businessLogo () {
-      const result = this.sourceList.filter(item => item.value === this.source)
+      const result = this.sourceList.filter(item => item.value === this.currentSource)
       if (result.length) {
         return result[0].logo
       }
@@ -153,6 +154,7 @@ export default {
       this.getList()
     },
     async getList () {
+      const source = this.source
       if (this.finished) {
         return
       }
@@ -165,7 +167,7 @@ export default {
         const { status, data, msg } = await apiGoodsSearch({
           page: this.pagenum,
           page_size: this.pagesize,
-          source: this.source,
+          source: source,
           keyword: this.keyword,
           sort: this.sort
         })
@@ -188,6 +190,7 @@ export default {
               this.finished = true
             }
             this.list = this.list.concat(list)
+            this.currentSource = source
 
             this.$nextTick(() => {
               if (!this.scroll) {