修复红包失效逻辑

This commit is contained in:
tcubic 2022-08-08 19:27:11 +08:00
parent a67a865e35
commit 5f6b3f39d9
4 changed files with 113 additions and 107 deletions

View File

@ -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%;

View File

@ -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) => {
}
}
}
}
};
//

View File

@ -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 = () => {

View File

@ -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")) {
// codeopenid
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>