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