抽奖接口已通
This commit is contained in:
parent
933bdc7f9e
commit
f55f3133cc
@ -40,6 +40,10 @@ import {
|
||||
} from "vue";
|
||||
import gsap from "gsap";
|
||||
import axios from "axios";
|
||||
import service from "@/api/httpServe";
|
||||
import qs from "qs";
|
||||
|
||||
|
||||
import { Toast } from "vant";
|
||||
import { useStore } from "vuex";
|
||||
|
||||
@ -73,16 +77,16 @@ const hide = () => {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 立即领取红包
|
||||
const getMoney = ()=>{
|
||||
|
||||
redpacket()
|
||||
|
||||
gsap.to('.draw_container',{duration:0.3,scale:0,autoAlpha:0,onComplete:()=>{
|
||||
drawStatus.value = false
|
||||
isgetMoney.value = true
|
||||
|
||||
gsap.form('.add_container',{duration:0.3,scale:0,autoAlpha:0,})
|
||||
|
||||
gsap.form('.add_container',{duration:0.5,scale:0,autoAlpha:0,})
|
||||
|
||||
}})
|
||||
|
||||
@ -90,6 +94,22 @@ const getMoney = ()=>{
|
||||
|
||||
}
|
||||
|
||||
// 领取接口
|
||||
const redpacket = (prizeId) => {
|
||||
let redpacketId = 84;
|
||||
service
|
||||
.post(
|
||||
process.env.VUE_APP_API +
|
||||
"/cms-activity/cms88/redpacket/receive/" +
|
||||
redpacketId,
|
||||
{}
|
||||
)
|
||||
.then((res) => {
|
||||
console.log("领取红包结果", res);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="indexPage">
|
||||
<div class="indexCon">
|
||||
<div class="logo"></div>
|
||||
<div class="logo" @click="deleteData"></div>
|
||||
<div class="title_main"></div>
|
||||
<div class="cloud_left_1"></div>
|
||||
<div class="cloud_right_1"></div>
|
||||
@ -33,7 +33,7 @@
|
||||
<div class="cloud_right_3"></div>
|
||||
<div class="icon_right_1"></div>
|
||||
<div class="select_box"></div>
|
||||
<div class="draw_btn" @click="drawBtn"></div>
|
||||
<div class="draw_btn" :class="isDraw ? 'is_draw' : ''" @click="drawBtn"></div>
|
||||
<div class="rule_btn" @click="showRluesBtn"></div>
|
||||
<div class="prize_btn" @click="showMyPrizePop"></div>
|
||||
<div class="rule_btn_text"></div>
|
||||
@ -169,7 +169,9 @@ const activityList = reactive([
|
||||
|
||||
// 页面挂载前
|
||||
onBeforeMount(() => {
|
||||
// 获取企微二维码
|
||||
if( store.state.userAccount.isHasPrize.length != 0 ){
|
||||
isDraw.value = true
|
||||
}
|
||||
});
|
||||
|
||||
// 入场动画
|
||||
@ -233,9 +235,7 @@ onMounted(() => {
|
||||
|
||||
// 抽奖按钮
|
||||
const drawBtn = () => {
|
||||
console.log("抽奖:");
|
||||
|
||||
console.log(LuckyWheelCon.value);
|
||||
|
||||
if (!isDraw.value) {
|
||||
// LuckyWheelCon.value.showDrawAni(3, true)
|
||||
@ -266,10 +266,13 @@ const hideRulesPop = () => {
|
||||
const showMyPrizePop = () => {
|
||||
showMyPrize.value = true;
|
||||
};
|
||||
|
||||
// 关闭我的奖品中心弹窗
|
||||
const myPrizePop = () => {
|
||||
showMyPrize.value = false;
|
||||
};
|
||||
|
||||
// 关闭抽奖弹窗
|
||||
const drawConFn = ()=>{
|
||||
showDrawCon.value = false
|
||||
}
|
||||
@ -312,7 +315,6 @@ const getInfo = () => {
|
||||
};
|
||||
|
||||
// 我的红包记录
|
||||
|
||||
const getMyPrizeRecored = () => {
|
||||
service
|
||||
.post(process.env.VUE_APP_API + "/cms-activity/cms88/prize/list", {})
|
||||
@ -342,37 +344,42 @@ const getluckyBag = (id) => {
|
||||
drawType.value = id;
|
||||
service
|
||||
.post(process.env.VUE_APP_API + "/cms-activity/cms88/redpacket/draw", {
|
||||
xglOpenId: store.state.userAccount.xglOpenid,
|
||||
xglOpenId: store.state.userAccount.xglOpenId,
|
||||
redpacketType: type,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("抽取红包结果:", res);
|
||||
|
||||
let prizeNum = res.data.data.amount
|
||||
|
||||
// 判断抽奖类型drawType = 1时转动大转盘
|
||||
if (drawType.value == 1) {
|
||||
// 判断抽奖结果状态
|
||||
if (res.data.code == 0) {
|
||||
// 大转盘正常抽奖
|
||||
if (res.data.data == 0) {
|
||||
if (prizeNum == 0) {
|
||||
// 谢谢参与
|
||||
console.log("抽中1:");
|
||||
LuckyWheelCon.value.showDrawAni(5, true);
|
||||
}
|
||||
if (res.data.data == 1.88) {
|
||||
if (prizeNum == 1.08) {
|
||||
// 1.88元
|
||||
LuckyWheelCon.value.showDrawAni(1, true);
|
||||
}
|
||||
if (res.data.data == 2.68) {
|
||||
if (prizeNum == 2.68) {
|
||||
// 2.68元
|
||||
LuckyWheelCon.value.showDrawAni(2, true);
|
||||
}
|
||||
if (res.data.data == 6.66) {
|
||||
if (prizeNum == 6.66) {
|
||||
// 6.66元
|
||||
LuckyWheelCon.value.showDrawAni(3, true);
|
||||
}
|
||||
if (res.data.data == 8.88) {
|
||||
if (prizeNum == 8.88) {
|
||||
// 6.66元
|
||||
LuckyWheelCon.value.showDrawAni(4, true);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
if (res.data.data == 0) {
|
||||
// 谢谢参与
|
||||
@ -411,6 +418,28 @@ const getBrithday = () => {
|
||||
console.log(res);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const deleteNum = ref(0)
|
||||
// 清数据接口
|
||||
const deleteData = (type) => {
|
||||
deleteNum.value++
|
||||
if(deleteNum.value == 3){
|
||||
let type = 0;
|
||||
service
|
||||
.post(
|
||||
process.env.VUE_APP_API +
|
||||
"/cms-activity/cms88/redpacket/delete/" + type, {}
|
||||
)
|
||||
.then((res) => {
|
||||
console.log("数据已清空", res);
|
||||
deleteNum.value = 0
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -424,6 +453,7 @@ const getBrithday = () => {
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
background: #ffd195;
|
||||
|
||||
.indexCon {
|
||||
// @include pos(100%, 1090px, 0, 0);
|
||||
@ -438,7 +468,7 @@ const getBrithday = () => {
|
||||
.logo {
|
||||
@include pos(241px, 36px, 31px, 41px);
|
||||
@include bg_pos("../assets/img/logo.png");
|
||||
pointer-events: none;
|
||||
// pointer-events: none;
|
||||
}
|
||||
|
||||
.notice {
|
||||
@ -598,6 +628,12 @@ const getBrithday = () => {
|
||||
.draw_btn {
|
||||
@include pos(216px, 252px, 273px, 810px);
|
||||
@include bg_pos("../assets/img/draw_btn.png");
|
||||
|
||||
}
|
||||
|
||||
.is_draw{
|
||||
-webkit-filter: grayscale(100%);
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
|
||||
.rule_btn {
|
||||
|
||||
@ -71,7 +71,7 @@ const hidePop = () => {
|
||||
.service_box {
|
||||
@include box(573px, 688px);
|
||||
@include bg_pos('../assets/img/pop/service_box.png');
|
||||
pointer-events: none;
|
||||
// pointer-events: none;
|
||||
position: relative;
|
||||
|
||||
|
||||
|
||||
@ -260,6 +260,7 @@ const pageImgsArrLoad = imgs => {
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -276,6 +277,6 @@ div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgb(255, 255, 255);
|
||||
background: #ffd195;
|
||||
}
|
||||
</style>
|
||||
@ -7,7 +7,7 @@ export default createStore({
|
||||
// 数据源
|
||||
state: {
|
||||
userAccount: {
|
||||
xglOpenid: '', //用户openid
|
||||
xglOpenId: 'o9B_fvjtyh2KELQYc2t9A3MEh7JQ', //用户openid
|
||||
token: h5plugin.getQueryString('token'), //用户token
|
||||
cardId: h5plugin.getQueryString('cardId'), //carid
|
||||
nkh: h5plugin.getQueryString('nkh'), //牛卡号
|
||||
@ -18,7 +18,7 @@ export default createStore({
|
||||
participantNum: 0, //活动参与人数
|
||||
prizeResult: 0, //中奖金额
|
||||
eqcodeImg: '', //二维码
|
||||
isBirthMon: 0, //生日是否处于当月
|
||||
isBirthMon: 1, //生日是否处于当月
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user