修复红包失效逻辑
This commit is contained in:
parent
a67a865e35
commit
5f6b3f39d9
@ -109,7 +109,6 @@
|
||||
<div class="ishas_service_box"></div>
|
||||
<div class="ishas_service_box_cls" @click="ishasServicePopHide"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -174,18 +173,21 @@ const serviceLuckyMsg = reactive({
|
||||
id: 1,
|
||||
});
|
||||
|
||||
// 判断红包是否生效
|
||||
const isLost1 = ref(false);
|
||||
const isLost2 = ref(false);
|
||||
|
||||
const hideServiceLuckyPop = () => {
|
||||
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 });
|
||||
};
|
||||
|
||||
// 已经添加企微逻辑
|
||||
const ishasServicePop = () => {
|
||||
gsap.to('.ishas_service_pop',{duration:0.5,autoAlpha:1})
|
||||
}
|
||||
gsap.to(".ishas_service_pop", { duration: 0.5, autoAlpha: 1 });
|
||||
};
|
||||
const ishasServicePopHide = () => {
|
||||
gsap.to('.ishas_service_pop',{duration:0.5,autoAlpha:0})
|
||||
}
|
||||
|
||||
gsap.to(".ishas_service_pop", { duration: 0.5, autoAlpha: 0 });
|
||||
};
|
||||
|
||||
// 点击领取企微红包
|
||||
const getServiceLucky = () => {
|
||||
@ -281,9 +283,6 @@ const activityList = reactive([
|
||||
|
||||
// 页面挂载前
|
||||
onBeforeMount(() => {
|
||||
|
||||
|
||||
|
||||
// 判断参与活动红包是否领取
|
||||
let arr = store.state.userAccount.prizeList;
|
||||
arr.forEach((element) => {
|
||||
@ -291,12 +290,18 @@ onBeforeMount(() => {
|
||||
isDraw.value = true;
|
||||
gameOver.value = true;
|
||||
drawAmount.value = element.amount;
|
||||
|
||||
if (element.receiveStatus == -2) {
|
||||
isLost1.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 判断红包记录里面是否存在企微红包
|
||||
if (element.type == 2) {
|
||||
isGetedServiceLucky.value = true;
|
||||
|
||||
if (element.receiveStatus == -2) {
|
||||
isLost2.value = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -380,14 +385,19 @@ onMounted(() => {
|
||||
addPoint();
|
||||
|
||||
// 如果添加了企微,直接调抽奖结果,中奖了就弹窗,未中奖的话不弹窗
|
||||
if (store.state.userAccount.isAddCustomerBefore == 0 && !isGetedServiceLucky.value) {
|
||||
if (
|
||||
store.state.userAccount.isAddCustomerBefore == 0 &&
|
||||
!isGetedServiceLucky.value
|
||||
) {
|
||||
if (
|
||||
store.state.userAccount.isAddCustomer == 1 &&
|
||||
!isGetedServiceLucky.value
|
||||
) {
|
||||
if (!isLost2.value) {
|
||||
getluckyBag2(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDraw.value) {
|
||||
gsap.to(".draw_btn", {
|
||||
@ -405,7 +415,10 @@ const drawBtn = () => {
|
||||
if (!isDraw.value) {
|
||||
// LuckyWheelCon.value.showDrawAni(3, true)
|
||||
gsap.killTweensOf(".draw_btn");
|
||||
if (!isLost1.value) {
|
||||
getluckyBag(1); //大转盘抽奖:传参数1
|
||||
|
||||
}
|
||||
} else {
|
||||
Toast("您已经抽过奖");
|
||||
}
|
||||
@ -423,18 +436,13 @@ const activityBtn = (item) => {
|
||||
console.log(item.id);
|
||||
console.log(wx);
|
||||
|
||||
|
||||
if (item.id == 1) {
|
||||
|
||||
if (store.state.userAccount.isAddCustomerBefore == 1) {
|
||||
// Toast("您已添加过专属服务人员,请参与下方其他活动吧")
|
||||
ishasServicePop()
|
||||
ishasServicePop();
|
||||
} else {
|
||||
showServicePop.value = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (item.id == 2) {
|
||||
@ -454,7 +462,6 @@ const activityBtn = (item) => {
|
||||
if (item.id == 4) {
|
||||
console.log("牛牛杯");
|
||||
|
||||
|
||||
window.location.href =
|
||||
"https://appstatic.cmschina.com/activity/cmszhyxpt/bees/index.html?id=INT_SMKTC_uD5KUL2d";
|
||||
// setTimeout(()=>{
|
||||
@ -1103,7 +1110,6 @@ const deleteData = (type) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.ishas_service_pop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@ -139,6 +139,10 @@ const hidePop = () => {
|
||||
const getMoney = (val) => {
|
||||
console.log("val:", val);
|
||||
|
||||
// 先判断红包是否生效
|
||||
if (val.isGeted == -2) {
|
||||
Toast("红包已过24小时,不能再提现啦");
|
||||
} else {
|
||||
// 红包类型未参与红包: 需先绑定牛卡号
|
||||
if (val.type == 1) {
|
||||
console.log("牛卡号:", store.state.userAccount.nkh);
|
||||
@ -193,6 +197,7 @@ const getMoney = (val) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 领取接口
|
||||
|
||||
@ -67,18 +67,17 @@ const isBingo = ref(false); //是否中过奖
|
||||
|
||||
const noPrize = ref(false); //未中奖
|
||||
|
||||
const noFirstAdd = ref(false)
|
||||
const noFirstAdd = ref(false);
|
||||
|
||||
// 刷新添加状态
|
||||
const updateStaus = () => {
|
||||
|
||||
getIsAddService();
|
||||
};
|
||||
|
||||
const isLost = ref(false);
|
||||
|
||||
// 页面挂载前
|
||||
onBeforeMount(() => {
|
||||
|
||||
|
||||
let arr = store.state.userAccount.prizeList;
|
||||
|
||||
arr.forEach((element) => {
|
||||
@ -86,7 +85,10 @@ onBeforeMount(() => {
|
||||
console.log("已经抽过》》》》》");
|
||||
isgot.value = true;
|
||||
isDraw.value = true;
|
||||
noFirstAdd.value = true
|
||||
noFirstAdd.value = true;
|
||||
if (element.receiveStatus == -2) {
|
||||
isLost.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
// if(element.amount != 0){
|
||||
@ -94,8 +96,6 @@ onBeforeMount(() => {
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (store.state.userAccount.isAddCustomer == 1) {
|
||||
isadd.value = 1;
|
||||
}
|
||||
@ -171,9 +171,12 @@ const draw = () => {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const getMoneyFn = () => {
|
||||
if (store.state.userAccount.nkh == '' || store.state.userAccount.nkh == undefined) {
|
||||
if (!isLost.value) {
|
||||
if (
|
||||
store.state.userAccount.nkh == "" ||
|
||||
store.state.userAccount.nkh == undefined
|
||||
) {
|
||||
// Toast("牛卡号为空,先绑定牛卡号");
|
||||
Dialog.confirm({
|
||||
title: "温馨提示",
|
||||
@ -193,6 +196,7 @@ const getMoneyFn = ()=>{
|
||||
getLuckyBag();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 领取接口
|
||||
const getLuckyBag = () => {
|
||||
|
||||
@ -161,7 +161,7 @@ const apiAll = () => {
|
||||
// 页面未挂载
|
||||
onBeforeMount(() => {
|
||||
if (!h5plugin.isWX()) {
|
||||
// apiAll();
|
||||
apiAll();
|
||||
}
|
||||
|
||||
console.log("link:", window.location.href);
|
||||
@ -169,14 +169,8 @@ onBeforeMount(() => {
|
||||
|
||||
console.log("code:", h5plugin.getQueryString("code"));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 微信环境授权
|
||||
if (h5plugin.isWX()) {
|
||||
|
||||
|
||||
if (h5plugin.getQueryString("code")) {
|
||||
// 存在code的话去换取openid
|
||||
authCode.value = h5plugin.getQueryString("code");
|
||||
@ -191,6 +185,7 @@ onBeforeMount(() => {
|
||||
onMounted(() => {
|
||||
fontAdpat();
|
||||
// stopBack()
|
||||
goBackEvent()
|
||||
});
|
||||
|
||||
// 来自首页的事件
|
||||
@ -198,11 +193,9 @@ const indexPage = (actions) => {
|
||||
console.log("来自index组件:", actions);
|
||||
};
|
||||
|
||||
|
||||
|
||||
const getCode = () => {
|
||||
let redirect_uri = window.location.href;
|
||||
// service.post(process.env.VUE_APP_API + '/cms-activity/cms88/zsApi/xfhdAuthorize?redirect_uri='+redirect_uri,
|
||||
|
||||
service
|
||||
.post(process.env.VUE_APP_API + "/cms-activity/cms88/zsApi/xfhdAuthorize", {
|
||||
redirect_uri: redirect_uri,
|
||||
@ -298,13 +291,11 @@ const stopBack = () => {
|
||||
|
||||
// 监听后退事件
|
||||
const goBackEvent = () => {
|
||||
if (window.history && window.history.pushState) {
|
||||
window.onpopstate = function () {
|
||||
//后退按钮触发事件
|
||||
console.log("后退");
|
||||
window.history.go(-1);
|
||||
};
|
||||
}
|
||||
history.pushState({ page: 1 }, null, window.location.href);
|
||||
//然后监听popstate事件
|
||||
window.addEventListener("popstate", (event) => {
|
||||
wx.miniProgram.navigateBack();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user