diff --git a/src/components/Index.vue b/src/components/Index.vue index e7b3410..bdae2d8 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -92,7 +92,7 @@
-
{{serviceLuckyMsg.money}}
+
{{ serviceLuckyMsg.money }}
@@ -100,6 +100,8 @@
+ +
@@ -157,24 +159,46 @@ const prizeMsg = reactive({ amount: 0, id: 1, }); -const serviceLuckyPopBox = ref(true) +const serviceLuckyPopBox = ref(true); // 企微红包弹窗金额 -const isGetedServiceLucky = ref(false) +const isGetedServiceLucky = ref(false); const serviceLuckyMsg = reactive({ money: 0, id: 1, -}) +}); -const hideServiceLuckyPop = ()=>{ - gsap.to('.serviceLuckyPop',{duration:0.5,autoAlpha:0}) -} +const hideServiceLuckyPop = () => { + gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 }); + +}; // 点击领取企微红包 -const getServiceLucky = ()=>{ - console.log("getServiceLucky:",serviceLuckyMsg); - redpacket(serviceLuckyMsg.id) -} +const getServiceLucky = () => { + if ( + store.state.userAccount.nkh == "" || + store.state.userAccount.nkh == undefined + ) { + // Toast("牛卡号为空,先绑定牛卡号"); + Dialog.confirm({ + title: "温馨提示", + message: "请先绑定牛卡号", + confirmButtonText: "前往绑定", + }) + .then(() => { + wx.miniProgram.navigateTo({ + url: "/subs/bind/pages/login/login?source=zszq", + }); + }) + .catch(() => { + // on cancel + }); + } else { + // 有牛卡号的话领取 + console.log("getServiceLucky:", serviceLuckyMsg); + redpacket(serviceLuckyMsg.id); + } +}; // 领取红包接口 const redpacket = (prizeId) => { @@ -190,12 +214,10 @@ const redpacket = (prizeId) => { console.log("领取红包结果", res); let data = res.data; if (data.code == 0) { - serviceLuckyPopBox.value = false + serviceLuckyPopBox.value = false; getMyPrizeRecored(); // 更新我的奖品列表 - } else { Toast(data.msg); - } }); }; @@ -253,14 +275,10 @@ onBeforeMount(() => { } // 判断红包记录里面是否存在企微红包 - if(element.type == 2){ - isGetedServiceLucky.value = true + if (element.type == 2) { + isGetedServiceLucky.value = true; } }); - - - - }); // 入场动画 @@ -284,7 +302,12 @@ const animationIndex = () => { autoAlpha: 0, }); gsap.from(".LuckyWheelCon", { duration: 0.5, autoAlpha: 0, delay: 1 }); - gsap.from(".activity_li", { duration: 1, autoAlpha: 0, y:150,stagger: 0.1 }); + gsap.from(".activity_li", { + duration: 1, + autoAlpha: 0, + y: 150, + stagger: 0.1, + }); gsap.from( ".activityCon,.zhuanpan,.select_box,.draw_btn,.rule_btn,.rule_btn_text,.prize_btn,.prize_btn_text", @@ -306,7 +329,7 @@ const animationIndex = () => { scale: 1.2, repeat: -1, yoyo: true, - ease: 'Bounce.easeIn' + ease: "Bounce.easeIn", }); gsap.from(".luckybag_right", { duration: 1, @@ -314,7 +337,7 @@ const animationIndex = () => { scale: 1.2, repeat: -1, yoyo: true, - ease: 'Bounce.easeInOut' + ease: "Bounce.easeInOut", }); gsap.to(".title_main", { duration: 2, @@ -334,24 +357,32 @@ onMounted(() => { animationIndex(); // 埋点 - addPoint() + addPoint(); // 如果添加了企微,直接调抽奖结果,中奖了就弹窗,未中奖的话不弹窗 - if (store.state.userAccount.isAddCustomer == 1 && !isGetedServiceLucky.value) { - getluckyBag2(2) + if ( + store.state.userAccount.isAddCustomer == 1 && + !isGetedServiceLucky.value + ) { + getluckyBag2(2); } - if(!isDraw.value){ - gsap.to('.draw_btn',{duration:0.5,scale:1.1,repeat:-1,yoyo:true,ease:'Bounce.easeIn'}) + if (!isDraw.value) { + gsap.to(".draw_btn", { + duration: 0.5, + scale: 1.1, + repeat: -1, + yoyo: true, + ease: "Bounce.easeIn", + }); } - }); // 抽奖按钮 const drawBtn = () => { if (!isDraw.value) { // LuckyWheelCon.value.showDrawAni(3, true) - gsap.killTweensOf('.draw_btn') + gsap.killTweensOf(".draw_btn"); getluckyBag(1); //大转盘抽奖:传参数1 } else { Toast("您已经抽过奖"); @@ -514,7 +545,7 @@ const getluckyBag = (id) => { drawAmount.value = res.data.data.amount; prizeMsg.amount = res.data.data.amount; prizeMsg.id = res.data.data.id; - gsap.set('.LuckyWheel_zz',{autoAlpha:0}) + gsap.set(".LuckyWheel_zz", { autoAlpha: 0 }); // 大转盘正常抽奖 if (prizeNum == 0) { @@ -555,21 +586,27 @@ const getluckyBag2 = (id) => { .then((res) => { console.log("抽取红包结果2:", res); if (res.data.code == 0) { - // 如果中奖就弹窗 - if(res.data.data.amount != 0){ - serviceLuckyMsg.money = res.data.data.amount - serviceLuckyMsg.id = res.data.data.id + if (res.data.data.amount != 0) { + serviceLuckyMsg.money = res.data.data.amount; + serviceLuckyMsg.id = res.data.data.id; console.log("企微中奖"); - gsap.to('.serviceLuckyPop',{duration:0.5,autoAlpha:1}) - gsap.from('.serviceLuckyPop_box',{duration:0.5,autoAlpha:0,scale:0}) - - }else{ + gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 1 }); + gsap.from(".serviceLuckyPop_box", { + duration: 0.5, + autoAlpha: 0, + scale: 0, + }); + gsap.from(".cls_btn", { + duration: 0.5, + autoAlpha: 0, + y: 50, + delay:0.5 + }); + } else { console.log("企微不中奖"); - } - getMyPrizeRecored(); // 更新我的奖品列表 } else { Toast(res.data.msg); @@ -577,7 +614,6 @@ const getluckyBag2 = (id) => { }); }; - // 活动参与人数 const getActivityNum = () => { service @@ -604,25 +640,21 @@ const getBrithday = () => { }); }; - - // 埋点接口 -const addPoint = ()=>{ - service +const addPoint = () => { + service .post( process.env.VUE_APP_API + "/action/application/action/event/user/brows", { actionType: 24, actionId: 20220805, - cardId: store.state.userAccount.cardId + cardId: store.state.userAccount.cardId, } ) .then((res) => { - console.log("埋点成功:",res); + console.log("埋点成功:", res); }); -} - - +}; const deleteNum = ref(0); // 清数据接口 @@ -709,7 +741,7 @@ const deleteData = (type) => { pointer-events: none; } - .LuckyWheel_zz{ + .LuckyWheel_zz { @include pos(750px, 496px, 0px, 657px); @include bg_pos("../assets/img/zz.png"); pointer-events: none; @@ -981,6 +1013,7 @@ const deleteData = (type) => { display: flex; justify-content: center; align-items: center; + flex-direction: column; background-color: rgba(0, 0, 0, 0.7); visibility: hidden; @@ -1011,16 +1044,22 @@ const deleteData = (type) => { @include bg_pos("../assets/img/pop/get_luckyBag_btn.png"); } } + + .cls_btn { + @include box(72px, 72px); + @include bg_pos("../assets/img/pop/cls_btn.png"); + margin-top: 50px; + } } - .serviceLuckyPop_get_box{ + .serviceLuckyPop_get_box { @include box(530px, 594px); @include bg_pos("../assets/img/pop/got_luckyBag_pop.png"); position: relative; .go_index_btn { - @include pos(394px, 92px, 79px, 389px); - @include bg_pos("../assets/img/pop/to_index_btn.png"); - } + @include pos(394px, 92px, 79px, 389px); + @include bg_pos("../assets/img/pop/to_index_btn.png"); + } } } \ No newline at end of file diff --git a/src/components/MyPrize.vue b/src/components/MyPrize.vue index 0e4d25b..9f35c1b 100644 --- a/src/components/MyPrize.vue +++ b/src/components/MyPrize.vue @@ -141,8 +141,11 @@ const getMoney = (val) => { // 红包类型未参与红包: 需先绑定牛卡号 if (val.type == 1) { - console.log("牛卡号:",store.state.userAccount.nkh); - if (store.state.userAccount.nkh == '' || store.state.userAccount.nkh == undefined) { + console.log("牛卡号:", store.state.userAccount.nkh); + if ( + store.state.userAccount.nkh == "" || + store.state.userAccount.nkh == undefined + ) { // Toast("牛卡号为空,先绑定牛卡号"); Dialog.confirm({ title: "温馨提示", @@ -165,8 +168,29 @@ const getMoney = (val) => { if (val.type == 2) { if (val.isGeted == 0) { - console.log("未领取", val); - getLuckyBag(val.id); + if ( + store.state.userAccount.nkh == "" || + store.state.userAccount.nkh == undefined + ) { + // Toast("牛卡号为空,先绑定牛卡号"); + Dialog.confirm({ + title: "温馨提示", + message: "请先绑定牛卡号", + confirmButtonText: "前往绑定", + }) + .then(() => { + wx.miniProgram.navigateTo({ + url: "/subs/bind/pages/login/login?source=zszq", + }); + }) + .catch(() => { + console.log(2); + // on cancel + }); + } else { + console.log("未领取", val); + getLuckyBag(val.id); + } } } }; diff --git a/src/components/ServiceList.vue b/src/components/ServiceList.vue index 4047de0..f29c1f7 100644 --- a/src/components/ServiceList.vue +++ b/src/components/ServiceList.vue @@ -15,7 +15,7 @@
{{ moneyNum }}
-
+
@@ -46,7 +46,7 @@ import { } from "vue"; import gsap from "gsap"; import axios from "axios"; -import { Toast } from "vant"; +import { Toast,Dialog } from "vant"; import { useStore } from "vuex"; import service from "@/api/httpServe"; import qs from "qs"; @@ -163,6 +163,29 @@ const draw = () => { }); }; + +const getMoneyFn = ()=>{ + if (store.state.userAccount.nkh == '' || store.state.userAccount.nkh == undefined) { + // Toast("牛卡号为空,先绑定牛卡号"); + Dialog.confirm({ + title: "温馨提示", + message: "请先绑定牛卡号", + confirmButtonText: "前往绑定", + }) + .then(() => { + wx.miniProgram.navigateTo({ + url: "/subs/bind/pages/login/login?source=zszq", + }); + }) + .catch(() => { + // on cancel + }); + } else { + // 有牛卡号的话领取 + getLuckyBag(); + } +} + // 领取接口 const getLuckyBag = () => { service @@ -178,6 +201,7 @@ const getLuckyBag = () => { if (data.code == 0) { gsap.to(".serviceCon", { duration: 0.5, autoAlpha: 0 }); gsap.to(".getMoneyCon", { duration: 0.5, autoAlpha: 1 }); + getMyPrizeRecored(); } else { Toast(data.msg); diff --git a/【生产环境】招商88司庆活动-2.zip b/【生产环境】招商88司庆活动-3.zip similarity index 88% rename from 【生产环境】招商88司庆活动-2.zip rename to 【生产环境】招商88司庆活动-3.zip index afca7ca..d3f4f39 100644 Binary files a/【生产环境】招商88司庆活动-2.zip and b/【生产环境】招商88司庆活动-3.zip differ