关联商品优化

h5
wangdong 7 months ago
parent b01afd2a5b
commit 01c32d3c7c
  1. 13
      pages/goods/list.vue
  2. 21
      pages/search/index.vue

@ -309,7 +309,6 @@
this.options = options
this.searchText = options.search
this.from = options.from || '';
console.log(this.from, 316);
//
this.setShowView()
//
@ -520,7 +519,7 @@
this.keyName2 = '';
this.banrdType = [];
this.goodsType = [];
const searchPageUrl = 'pages/search/index?category_id=' + this.options.categoryId
const searchPageUrl = `pages/search/index?category_id=${this.options.categoryId}&from=${this.from}`
//
let pages = getCurrentPages()
if (pages.length > 1 &&
@ -528,8 +527,14 @@
uni.navigateBack()
return
}
//
this.$navTo(searchPageUrl)
if (this.from === 'dynamic') {
uni.redirectTo({
url: `/${searchPageUrl}`,
});
} else {
//
this.$navTo(searchPageUrl)
}
},
//

@ -86,6 +86,7 @@
goodsList: [],
category_id:0,
merchantId: '',
from: '',
isHot: true,
}
},
@ -100,7 +101,8 @@
},
onLoad(op) {
this.category_id=op.category_id || ''
this.merchantId = op.merchantId || ''
this.merchantId = op.merchantId || ''
this.from = op.from || ''
this.getHot()
this.chartsGoodsJingHandle()
},
@ -150,10 +152,17 @@
})
},
searchGoods(item) {
uni.navigateTo({
url: `/pages/goods/list?search=${item}&merchantId=${this.merchantId}`
})
searchGoods(item) {
console.log(this.from);
if (this.from === 'dynamic') {
uni.redirectTo({
url: `/pages/goods/list?search=${item}&merchantId=${this.merchantId}&from=${this.from}`
})
} else {
uni.navigateTo({
url: `/pages/goods/list?search=${item}&merchantId=${this.merchantId}`
})
}
},
getSearchInfo() {
//
@ -164,7 +173,7 @@
}
console.log(this.merchantId);
uni.redirectTo({
url: `/pages/goods/list?search=${this.searchValue}&categoryId=${this.category_id}&merchantId=${this.merchantId}`
url: `/pages/goods/list?search=${this.searchValue}&categoryId=${this.category_id}&merchantId=${this.merchantId}&from=${this.from}`
})
},
chartsGoodsJingHandle() {

Loading…
Cancel
Save