feat(user): 0级会员判断逻辑完善

This commit is contained in:
woody 2025-06-10 17:03:15 +08:00
parent 6a7ffe2c24
commit 4ebe2f2b2c
3 changed files with 25 additions and 5 deletions

View File

@ -65,6 +65,13 @@ import { getAreaGoods } from '@/config/special-area'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'SpecialAreaWrapper', name: 'SpecialAreaWrapper',
props: {
size: {
type: String,
default: 'normal', // 'normal' or 'small'
validator: value => ['normal', 'small'].includes(value),
},
},
components: { components: {
'area-product-list': areaProductList, 'area-product-list': areaProductList,
}, },
@ -84,7 +91,8 @@ export default {
...mapGetters(['isZeroLevel']), ...mapGetters(['isZeroLevel']),
}, },
created() { created() {
if (!this.isZeroLevel) { const userInfo = uni.getStorageSync('userInfo')
if (userInfo.memberSign != MEMBER_SIGN.ZERO_LEVEL) {
this.getAreaListById(REISSUE_AREA.id, this.rescissionList) this.getAreaListById(REISSUE_AREA.id, this.rescissionList)
this.getAreaListById(REGIEST_AREA.id, this.registList) this.getAreaListById(REGIEST_AREA.id, this.registList)
} }

View File

@ -28,7 +28,7 @@
</swiper> </swiper>
</view> </view>
</view> </view>
<special-area-wrapper /> <special-area-wrapper size="small" />
<view class="goods-sort"> <view class="goods-sort">
<view class="goods_content" style="padding-bottom: 130rpx"> <view class="goods_content" style="padding-bottom: 130rpx">
<view <view
@ -134,7 +134,13 @@ import znNewsPopup from '@/components/znNewsPopup.vue'
import { formatCurrency } from '@/util/index.js' import { formatCurrency } from '@/util/index.js'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import SpecialAreaWrapper from '@/components/area-product-list/special-area-wrapper.vue' import SpecialAreaWrapper from '@/components/area-product-list/special-area-wrapper.vue'
import { REGIEST_AREA, REISSUE_AREA } from '@/util/specialAreaMap' import {
REGIEST_AREA,
REISSUE_AREA,
UPGRADE_AREA,
REPURCHASE_AREA,
} from '@/util/specialAreaMap'
import { MEMBER_SIGN } from '@/util/common.js'
export default { export default {
components: { components: {
noticePopup, noticePopup,
@ -177,7 +183,11 @@ export default {
uni.getStorageSync('showInfo') == 0 uni.getStorageSync('showInfo') == 0
) { ) {
} }
this.getAreaGoods(this.isZeroLevel ? REISSUE_AREA.id : REGIEST_AREA.id) this.getAreaGoods(
this.userInfo.memberSign == MEMBER_SIGN.ZERO_LEVEL
? REPURCHASE_AREA.id
: REGIEST_AREA.id
)
// this.getLanguage(); // this.getLanguage();
// this.getService() // this.getService()
}, },

View File

@ -7,6 +7,8 @@ const getters = {
priceSymbol: state => state.system.priceSymbol, priceSymbol: state => state.system.priceSymbol,
priceDecimal: state => state.system.priceDecimal, priceDecimal: state => state.system.priceDecimal,
priceSymbolVisible: state => state.system.priceSymbolVisible, priceSymbolVisible: state => state.system.priceSymbolVisible,
isZeroLevel: state => state.user?.user?.memberSign === MEMBER_SIGN.ZERO_LEVEL, isZeroLevel: state =>
state.user?.user?.memberSign === MEMBER_SIGN.ZERO_LEVEL ||
(!state.user?.user?.memberSign && state.user?.user?.memberSign !== 0),
} }
export default getters export default getters