diff --git a/src/components/Index.vue b/src/components/Index.vue index b966323..a78e91f 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -262,8 +262,13 @@ const activityList = reactive([ }, ]); +// const hasServicePrize = ref(false) + // 页面挂载前 onBeforeMount(() => { + + + // 判断参与活动红包是否领取 let arr = store.state.userAccount.prizeList; arr.forEach((element) => { @@ -276,6 +281,7 @@ onBeforeMount(() => { // 判断红包记录里面是否存在企微红包 if (element.type == 2) { isGetedServiceLucky.value = true; + } }); }); @@ -359,10 +365,7 @@ onMounted(() => { addPoint(); // 如果添加了企微,直接调抽奖结果,中奖了就弹窗,未中奖的话不弹窗 - - // 您已添加过专属服务人员,请参与其他活动 - - if (store.state.userAccount.isAddCustomerBefore == 0) { + if (store.state.userAccount.isAddCustomerBefore == 0 && !isGetedServiceLucky.value) { if ( store.state.userAccount.isAddCustomer == 1 && !isGetedServiceLucky.value @@ -406,8 +409,8 @@ const activityBtn = (item) => { if (item.id == 1) { - if(store.state.userAccount.isAddCustomerBefore == 1){ - Toast("您已添加过专属服务人员,请参与其他活动") + if(store.state.userAccount.isAddCustomerBefore == 1 || !isGetedServiceLucky.value){ + Toast("您已添加过专属服务人员,请参与下方其他活动吧") }else{ showServicePop.value = true; }