会员修复
This commit is contained in:
@@ -146,7 +146,8 @@
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
computed
|
||||
computed,
|
||||
watch
|
||||
} from "vue"
|
||||
import {
|
||||
joinMember,
|
||||
@@ -194,15 +195,15 @@
|
||||
const state = reactive({
|
||||
openType: 'CONDITION'
|
||||
})
|
||||
|
||||
const pay_menus = ref([{
|
||||
|
||||
const $pay_menus=[{
|
||||
name: '赠送成长值',
|
||||
desc: '赠送成长值',
|
||||
icon: '/user/static/buy-vip/Frame_220.png',
|
||||
},
|
||||
{
|
||||
name: '优惠券',
|
||||
desc: '每月赠送2张优惠券',
|
||||
desc: '',
|
||||
icon: '/user/static/buy-vip/Frame_221.png'
|
||||
},
|
||||
{
|
||||
@@ -212,7 +213,7 @@
|
||||
},
|
||||
{
|
||||
name: '会员折扣',
|
||||
desc: '全店折扣98折',
|
||||
desc: '',
|
||||
icon: '/user/static/buy-vip/Frame_223.png'
|
||||
},
|
||||
{
|
||||
@@ -225,7 +226,9 @@
|
||||
desc: '',
|
||||
icon: '/user/static/buy-vip/Frame_225.png'
|
||||
}
|
||||
])
|
||||
]
|
||||
|
||||
const pay_menus = ref($pay_menus)
|
||||
|
||||
let tiaojian_menus =ref( [{
|
||||
name: '享会员价',
|
||||
@@ -295,7 +298,7 @@
|
||||
if (res) {
|
||||
if(!res.memberConfig.isMemberPrice){
|
||||
tiaojian_menus.value=tiaojian_menus.value.filter(v=>v.name!='享会员价')
|
||||
pay_menus.value=pay_menus.value.filter(v=>v.name!='享会员价')
|
||||
pay_menus.value=$pay_menus.filter(v=>v.name!='享会员价')
|
||||
}
|
||||
if (res.memberConfig.isSubmitInfo && (shopUserInfo.value.sex === null || shopUserInfo.value.sex ===
|
||||
undefined || !shopUserInfo.value.nickName || !shopUserInfo.value.birthDay || !shopUserInfo.value
|
||||
@@ -319,8 +322,9 @@
|
||||
configList.value = res.memberConfig.configList
|
||||
|
||||
Object.assign(state, res.memberConfig)
|
||||
memberLevel.value = res.memberLevel
|
||||
|
||||
const first_lv=(res.memberLevelList||[])[0]
|
||||
memberLevel.value = res.memberLevel||first_lv
|
||||
filterPay_menus()
|
||||
}
|
||||
}
|
||||
const returnReward = computed(() => {
|
||||
@@ -389,6 +393,36 @@
|
||||
},1000)
|
||||
}
|
||||
}
|
||||
//过滤掉部分未开启的菜单相
|
||||
function filterPay_menus(){
|
||||
pay_menus.value=$pay_menus.filter(v=>{
|
||||
if(!state.isMemberPrice&&v.name=='享会员价'){
|
||||
return false
|
||||
}
|
||||
if (state.isSubmitInfo && (shopUserInfo.value.sex === null || shopUserInfo.value.sex ===
|
||||
undefined || !shopUserInfo.value.nickName || !shopUserInfo.value.birthDay || !shopUserInfo.value
|
||||
.phone)) {
|
||||
memberOpen.value = true;
|
||||
}
|
||||
const viplv= configList.value[vipSel.value]
|
||||
if(viplv.couponList.length==0&&v.name=='优惠券'){
|
||||
return false
|
||||
}
|
||||
if((!memberLevel.value||!memberLevel.value.isCostRewardPoints)&&v.name=='消费送积分'){
|
||||
return false
|
||||
}
|
||||
if((!memberLevel.value||!memberLevel.value.isCycleReward)&&v.name=='周期福利'){
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
watch(()=>vipSel.value,(newval,oldval)=>{
|
||||
console.log('vipSel.value',newval);
|
||||
filterPay_menus()
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user