新增添加企微需绑定牛卡号逻辑
This commit is contained in:
parent
26dba43e0c
commit
f45b6731c2
@ -92,7 +92,7 @@
|
|||||||
<div class="serviceLuckyPop_container">
|
<div class="serviceLuckyPop_container">
|
||||||
<!-- 企微中奖弹窗 -->
|
<!-- 企微中奖弹窗 -->
|
||||||
<div class="serviceLuckyPop_box" v-if="serviceLuckyPopBox">
|
<div class="serviceLuckyPop_box" v-if="serviceLuckyPopBox">
|
||||||
<div class="money">{{serviceLuckyMsg.money}}</div>
|
<div class="money">{{ serviceLuckyMsg.money }}</div>
|
||||||
<div class="get_luckybag" @click="getServiceLucky"></div>
|
<div class="get_luckybag" @click="getServiceLucky"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -100,6 +100,8 @@
|
|||||||
<div class="serviceLuckyPop_get_box" v-if="!serviceLuckyPopBox">
|
<div class="serviceLuckyPop_get_box" v-if="!serviceLuckyPopBox">
|
||||||
<div class="go_index_btn" @click="hideServiceLuckyPop"></div>
|
<div class="go_index_btn" @click="hideServiceLuckyPop"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="cls_btn" @click="hideServiceLuckyPop"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -157,24 +159,46 @@ const prizeMsg = reactive({
|
|||||||
amount: 0,
|
amount: 0,
|
||||||
id: 1,
|
id: 1,
|
||||||
});
|
});
|
||||||
const serviceLuckyPopBox = ref(true)
|
const serviceLuckyPopBox = ref(true);
|
||||||
|
|
||||||
// 企微红包弹窗金额
|
// 企微红包弹窗金额
|
||||||
const isGetedServiceLucky = ref(false)
|
const isGetedServiceLucky = ref(false);
|
||||||
const serviceLuckyMsg = reactive({
|
const serviceLuckyMsg = reactive({
|
||||||
money: 0,
|
money: 0,
|
||||||
id: 1,
|
id: 1,
|
||||||
})
|
});
|
||||||
|
|
||||||
const hideServiceLuckyPop = ()=>{
|
const hideServiceLuckyPop = () => {
|
||||||
gsap.to('.serviceLuckyPop',{duration:0.5,autoAlpha:0})
|
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 0 });
|
||||||
}
|
|
||||||
|
};
|
||||||
|
|
||||||
// 点击领取企微红包
|
// 点击领取企微红包
|
||||||
const getServiceLucky = ()=>{
|
const getServiceLucky = () => {
|
||||||
console.log("getServiceLucky:",serviceLuckyMsg);
|
if (
|
||||||
redpacket(serviceLuckyMsg.id)
|
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) => {
|
const redpacket = (prizeId) => {
|
||||||
@ -190,12 +214,10 @@ const redpacket = (prizeId) => {
|
|||||||
console.log("领取红包结果", res);
|
console.log("领取红包结果", res);
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
serviceLuckyPopBox.value = false
|
serviceLuckyPopBox.value = false;
|
||||||
getMyPrizeRecored(); // 更新我的奖品列表
|
getMyPrizeRecored(); // 更新我的奖品列表
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast(data.msg);
|
Toast(data.msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -253,14 +275,10 @@ onBeforeMount(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断红包记录里面是否存在企微红包
|
// 判断红包记录里面是否存在企微红包
|
||||||
if(element.type == 2){
|
if (element.type == 2) {
|
||||||
isGetedServiceLucky.value = true
|
isGetedServiceLucky.value = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 入场动画
|
// 入场动画
|
||||||
@ -284,7 +302,12 @@ const animationIndex = () => {
|
|||||||
autoAlpha: 0,
|
autoAlpha: 0,
|
||||||
});
|
});
|
||||||
gsap.from(".LuckyWheelCon", { duration: 0.5, autoAlpha: 0, delay: 1 });
|
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(
|
gsap.from(
|
||||||
".activityCon,.zhuanpan,.select_box,.draw_btn,.rule_btn,.rule_btn_text,.prize_btn,.prize_btn_text",
|
".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,
|
scale: 1.2,
|
||||||
repeat: -1,
|
repeat: -1,
|
||||||
yoyo: true,
|
yoyo: true,
|
||||||
ease: 'Bounce.easeIn'
|
ease: "Bounce.easeIn",
|
||||||
});
|
});
|
||||||
gsap.from(".luckybag_right", {
|
gsap.from(".luckybag_right", {
|
||||||
duration: 1,
|
duration: 1,
|
||||||
@ -314,7 +337,7 @@ const animationIndex = () => {
|
|||||||
scale: 1.2,
|
scale: 1.2,
|
||||||
repeat: -1,
|
repeat: -1,
|
||||||
yoyo: true,
|
yoyo: true,
|
||||||
ease: 'Bounce.easeInOut'
|
ease: "Bounce.easeInOut",
|
||||||
});
|
});
|
||||||
gsap.to(".title_main", {
|
gsap.to(".title_main", {
|
||||||
duration: 2,
|
duration: 2,
|
||||||
@ -334,24 +357,32 @@ onMounted(() => {
|
|||||||
animationIndex();
|
animationIndex();
|
||||||
|
|
||||||
// 埋点
|
// 埋点
|
||||||
addPoint()
|
addPoint();
|
||||||
|
|
||||||
// 如果添加了企微,直接调抽奖结果,中奖了就弹窗,未中奖的话不弹窗
|
// 如果添加了企微,直接调抽奖结果,中奖了就弹窗,未中奖的话不弹窗
|
||||||
if (store.state.userAccount.isAddCustomer == 1 && !isGetedServiceLucky.value) {
|
if (
|
||||||
getluckyBag2(2)
|
store.state.userAccount.isAddCustomer == 1 &&
|
||||||
|
!isGetedServiceLucky.value
|
||||||
|
) {
|
||||||
|
getluckyBag2(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isDraw.value){
|
if (!isDraw.value) {
|
||||||
gsap.to('.draw_btn',{duration:0.5,scale:1.1,repeat:-1,yoyo:true,ease:'Bounce.easeIn'})
|
gsap.to(".draw_btn", {
|
||||||
|
duration: 0.5,
|
||||||
|
scale: 1.1,
|
||||||
|
repeat: -1,
|
||||||
|
yoyo: true,
|
||||||
|
ease: "Bounce.easeIn",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 抽奖按钮
|
// 抽奖按钮
|
||||||
const drawBtn = () => {
|
const drawBtn = () => {
|
||||||
if (!isDraw.value) {
|
if (!isDraw.value) {
|
||||||
// LuckyWheelCon.value.showDrawAni(3, true)
|
// LuckyWheelCon.value.showDrawAni(3, true)
|
||||||
gsap.killTweensOf('.draw_btn')
|
gsap.killTweensOf(".draw_btn");
|
||||||
getluckyBag(1); //大转盘抽奖:传参数1
|
getluckyBag(1); //大转盘抽奖:传参数1
|
||||||
} else {
|
} else {
|
||||||
Toast("您已经抽过奖");
|
Toast("您已经抽过奖");
|
||||||
@ -514,7 +545,7 @@ const getluckyBag = (id) => {
|
|||||||
drawAmount.value = res.data.data.amount;
|
drawAmount.value = res.data.data.amount;
|
||||||
prizeMsg.amount = res.data.data.amount;
|
prizeMsg.amount = res.data.data.amount;
|
||||||
prizeMsg.id = res.data.data.id;
|
prizeMsg.id = res.data.data.id;
|
||||||
gsap.set('.LuckyWheel_zz',{autoAlpha:0})
|
gsap.set(".LuckyWheel_zz", { autoAlpha: 0 });
|
||||||
|
|
||||||
// 大转盘正常抽奖
|
// 大转盘正常抽奖
|
||||||
if (prizeNum == 0) {
|
if (prizeNum == 0) {
|
||||||
@ -555,21 +586,27 @@ const getluckyBag2 = (id) => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("抽取红包结果2:", res);
|
console.log("抽取红包结果2:", res);
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
|
|
||||||
// 如果中奖就弹窗
|
// 如果中奖就弹窗
|
||||||
if(res.data.data.amount != 0){
|
if (res.data.data.amount != 0) {
|
||||||
serviceLuckyMsg.money = res.data.data.amount
|
serviceLuckyMsg.money = res.data.data.amount;
|
||||||
serviceLuckyMsg.id = res.data.data.id
|
serviceLuckyMsg.id = res.data.data.id;
|
||||||
console.log("企微中奖");
|
console.log("企微中奖");
|
||||||
gsap.to('.serviceLuckyPop',{duration:0.5,autoAlpha:1})
|
gsap.to(".serviceLuckyPop", { duration: 0.5, autoAlpha: 1 });
|
||||||
gsap.from('.serviceLuckyPop_box',{duration:0.5,autoAlpha:0,scale:0})
|
gsap.from(".serviceLuckyPop_box", {
|
||||||
|
duration: 0.5,
|
||||||
}else{
|
autoAlpha: 0,
|
||||||
|
scale: 0,
|
||||||
|
});
|
||||||
|
gsap.from(".cls_btn", {
|
||||||
|
duration: 0.5,
|
||||||
|
autoAlpha: 0,
|
||||||
|
y: 50,
|
||||||
|
delay:0.5
|
||||||
|
});
|
||||||
|
} else {
|
||||||
console.log("企微不中奖");
|
console.log("企微不中奖");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getMyPrizeRecored(); // 更新我的奖品列表
|
getMyPrizeRecored(); // 更新我的奖品列表
|
||||||
} else {
|
} else {
|
||||||
Toast(res.data.msg);
|
Toast(res.data.msg);
|
||||||
@ -577,7 +614,6 @@ const getluckyBag2 = (id) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 活动参与人数
|
// 活动参与人数
|
||||||
const getActivityNum = () => {
|
const getActivityNum = () => {
|
||||||
service
|
service
|
||||||
@ -604,25 +640,21 @@ const getBrithday = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 埋点接口
|
// 埋点接口
|
||||||
const addPoint = ()=>{
|
const addPoint = () => {
|
||||||
service
|
service
|
||||||
.post(
|
.post(
|
||||||
process.env.VUE_APP_API + "/action/application/action/event/user/brows",
|
process.env.VUE_APP_API + "/action/application/action/event/user/brows",
|
||||||
{
|
{
|
||||||
actionType: 24,
|
actionType: 24,
|
||||||
actionId: 20220805,
|
actionId: 20220805,
|
||||||
cardId: store.state.userAccount.cardId
|
cardId: store.state.userAccount.cardId,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("埋点成功:",res);
|
console.log("埋点成功:", res);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const deleteNum = ref(0);
|
const deleteNum = ref(0);
|
||||||
// 清数据接口
|
// 清数据接口
|
||||||
@ -709,7 +741,7 @@ const deleteData = (type) => {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.LuckyWheel_zz{
|
.LuckyWheel_zz {
|
||||||
@include pos(750px, 496px, 0px, 657px);
|
@include pos(750px, 496px, 0px, 657px);
|
||||||
@include bg_pos("../assets/img/zz.png");
|
@include bg_pos("../assets/img/zz.png");
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@ -981,6 +1013,7 @@ const deleteData = (type) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
background-color: rgba(0, 0, 0, 0.7);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
|
||||||
@ -1011,9 +1044,15 @@ const deleteData = (type) => {
|
|||||||
@include bg_pos("../assets/img/pop/get_luckyBag_btn.png");
|
@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 box(530px, 594px);
|
||||||
@include bg_pos("../assets/img/pop/got_luckyBag_pop.png");
|
@include bg_pos("../assets/img/pop/got_luckyBag_pop.png");
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -141,8 +141,11 @@ const getMoney = (val) => {
|
|||||||
|
|
||||||
// 红包类型未参与红包: 需先绑定牛卡号
|
// 红包类型未参与红包: 需先绑定牛卡号
|
||||||
if (val.type == 1) {
|
if (val.type == 1) {
|
||||||
console.log("牛卡号:",store.state.userAccount.nkh);
|
console.log("牛卡号:", store.state.userAccount.nkh);
|
||||||
if (store.state.userAccount.nkh == '' || store.state.userAccount.nkh == undefined) {
|
if (
|
||||||
|
store.state.userAccount.nkh == "" ||
|
||||||
|
store.state.userAccount.nkh == undefined
|
||||||
|
) {
|
||||||
// Toast("牛卡号为空,先绑定牛卡号");
|
// Toast("牛卡号为空,先绑定牛卡号");
|
||||||
Dialog.confirm({
|
Dialog.confirm({
|
||||||
title: "温馨提示",
|
title: "温馨提示",
|
||||||
@ -165,10 +168,31 @@ const getMoney = (val) => {
|
|||||||
|
|
||||||
if (val.type == 2) {
|
if (val.type == 2) {
|
||||||
if (val.isGeted == 0) {
|
if (val.isGeted == 0) {
|
||||||
|
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);
|
console.log("未领取", val);
|
||||||
getLuckyBag(val.id);
|
getLuckyBag(val.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 领取接口
|
// 领取接口
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<!-- 红包中奖 -->
|
<!-- 红包中奖 -->
|
||||||
<div class="has_service_box" v-if="isadd == 1 && !isgot && !noPrize">
|
<div class="has_service_box" v-if="isadd == 1 && !isgot && !noPrize">
|
||||||
<div class="money">{{ moneyNum }}</div>
|
<div class="money">{{ moneyNum }}</div>
|
||||||
<div class="get_luckybag" @click="getLuckyBag"></div>
|
<div class="get_luckybag" @click="getMoneyFn"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 红包未中奖 -->
|
<!-- 红包未中奖 -->
|
||||||
@ -46,7 +46,7 @@ import {
|
|||||||
} from "vue";
|
} from "vue";
|
||||||
import gsap from "gsap";
|
import gsap from "gsap";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Toast } from "vant";
|
import { Toast,Dialog } from "vant";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import service from "@/api/httpServe";
|
import service from "@/api/httpServe";
|
||||||
import qs from "qs";
|
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 = () => {
|
const getLuckyBag = () => {
|
||||||
service
|
service
|
||||||
@ -178,6 +201,7 @@ const getLuckyBag = () => {
|
|||||||
if (data.code == 0) {
|
if (data.code == 0) {
|
||||||
gsap.to(".serviceCon", { duration: 0.5, autoAlpha: 0 });
|
gsap.to(".serviceCon", { duration: 0.5, autoAlpha: 0 });
|
||||||
gsap.to(".getMoneyCon", { duration: 0.5, autoAlpha: 1 });
|
gsap.to(".getMoneyCon", { duration: 0.5, autoAlpha: 1 });
|
||||||
|
|
||||||
getMyPrizeRecored();
|
getMyPrizeRecored();
|
||||||
} else {
|
} else {
|
||||||
Toast(data.msg);
|
Toast(data.msg);
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user