关联商品优化

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

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

@ -86,6 +86,7 @@
goodsList: [], goodsList: [],
category_id:0, category_id:0,
merchantId: '', merchantId: '',
from: '',
isHot: true, isHot: true,
} }
}, },
@ -101,6 +102,7 @@
onLoad(op) { onLoad(op) {
this.category_id=op.category_id || '' this.category_id=op.category_id || ''
this.merchantId = op.merchantId || '' this.merchantId = op.merchantId || ''
this.from = op.from || ''
this.getHot() this.getHot()
this.chartsGoodsJingHandle() this.chartsGoodsJingHandle()
}, },
@ -151,9 +153,16 @@
}) })
}, },
searchGoods(item) { searchGoods(item) {
uni.navigateTo({ console.log(this.from);
url: `/pages/goods/list?search=${item}&merchantId=${this.merchantId}` 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() { getSearchInfo() {
// //
@ -164,7 +173,7 @@
} }
console.log(this.merchantId); console.log(this.merchantId);
uni.redirectTo({ 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() { chartsGoodsJingHandle() {

Loading…
Cancel
Save