fix(index): 首页获取专区列表改为在onshow时执行

This commit is contained in:
woody 2025-09-17 10:41:47 +08:00
parent 3fe086d4d4
commit 6a27c8bca2
1 changed files with 10 additions and 5 deletions

View File

@ -421,13 +421,14 @@ export default {
) {
}
this.getGoodsInfo()
this.getAreaGoods()
// this.getLanguage();
this.getService()
},
onShow() {
this.$store.dispatch('getCarLength')
this.user = uni.getStorageSync('User')
this.getAreaGoods()
this.newShareMember = this.user?.loginType !== 0
},
onPullDownRefresh() {
@ -474,12 +475,16 @@ export default {
getAreaGoods() {
getAreaGoods().then(res => {
this.recommendSpecialAreaList = res.data?.recommendSpecialAreaList || []
if(this.newShareMember){
let obj = this.recommendSpecialAreaList.find(item => item.specialArea === 41)
if(obj){
if (this.newShareMember) {
let obj = this.recommendSpecialAreaList.find(
item => item.specialArea === 41
)
if (obj) {
this.$set(obj, 'specialAreaName', '会员专区')
}
this.recommendSpecialAreaList = this.recommendSpecialAreaList.filter(item => item.specialArea === 41)
this.recommendSpecialAreaList = this.recommendSpecialAreaList.filter(
item => item.specialArea === 41
)
}
})
},