|
|
@@ -362,6 +362,7 @@ import { shopNoticeShowList } from '@/api/shop-notice'
|
|
|
import { getInfo } from '@/api/shop'
|
|
|
import { getLimitBuyInfo } from '@/api/order'
|
|
|
import { list, share } from '@/mixins'
|
|
|
+import { parseFilterIds, encodeFilterValue, stashGoodsListFilter } from '@/utils/goodsListFilter'
|
|
|
|
|
|
/** 公告展示位置:分类菜单 */
|
|
|
const NOTICE_POSITION_CATEGORY = 2
|
|
|
@@ -816,13 +817,43 @@ export default {
|
|
|
onAdChange(e) {
|
|
|
this.currentAdIndex = e.detail.current || 0
|
|
|
},
|
|
|
- /** 广告点击:图文跳详情,商品/分类跳转暂未实现 */
|
|
|
+ /**
|
|
|
+ * 分类广告点击(与首页轮播一致)
|
|
|
+ * type=1 图文详情;type=2 单商品详情 / 多商品列表;type=3|4 分类/场景 → goods/list
|
|
|
+ */
|
|
|
onAdTap(ad) {
|
|
|
if (!ad) return
|
|
|
- if (Number(ad.type) === 1 && ad.value) {
|
|
|
+ const ids = parseFilterIds(ad.value)
|
|
|
+ if (!ids.length) return
|
|
|
+ const type = Number(ad.type)
|
|
|
+ const account = this.shopAccount || uni.getStorageSync('account') || ''
|
|
|
+ const hdId = this.hdId || uni.getStorageSync('hdId') || 0
|
|
|
+ if (type === 1) {
|
|
|
this.$util.pageTo({
|
|
|
url: '/pages/home/pic-text-detail',
|
|
|
- query: { id: ad.value, account: this.shopAccount }
|
|
|
+ query: { id: ids[0], account }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (type === 2) {
|
|
|
+ if (ids.length === 1) {
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: '/pages/goods/detail',
|
|
|
+ query: { id: ids[0], account, hdId }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ stashGoodsListFilter(2, ids)
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: `/pages/goods/list?account=${account}&hdId=${hdId}&filterType=2&filterValue=${encodeFilterValue(ids)}`
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 分类 / 场景:进商品列表并带筛选
|
|
|
+ if (type === 3 || type === 4) {
|
|
|
+ stashGoodsListFilter(type, ids)
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: `/pages/goods/list?account=${account}&hdId=${hdId}&filterType=${type}&filterValue=${encodeFilterValue(ids)}`
|
|
|
})
|
|
|
}
|
|
|
},
|