同步数据
This commit is contained in:
parent
2ab7f2daab
commit
8db3e50c0f
5
.env.prd
5
.env.prd
@ -1,5 +1,6 @@
|
|||||||
VITE_MODE = prd
|
VITE_MODE = prd
|
||||||
VITE_HOST = https://hd.xglpa.com
|
VITE_HOST = https://wmm.pingan.com.cn
|
||||||
VITE_CDN = https://cdn.xglpa.com
|
VITE_CDN = https://cdn.xglpa.com
|
||||||
VITE_FOLDER = /vite-4
|
VITE_FOLDER = /vite-4
|
||||||
VITE_API = /vite-api
|
VITE_API = /intfgw/data/mmoactivity
|
||||||
|
VITE_URL = https://w.pingan.com.cn/lckj/pawm-mmo-activity-xgl-frontend/index.html
|
||||||
@ -14,13 +14,14 @@ const money = ref("8.88");
|
|||||||
const code = ref("sss");
|
const code = ref("sss");
|
||||||
|
|
||||||
const showResult = ref(false);
|
const showResult = ref(false);
|
||||||
const hasPrize = ref(true);
|
const hasPrize = ref(false);
|
||||||
|
|
||||||
const drawFn = (event) => {
|
const drawFn = (event) => {
|
||||||
let e = event.target.parentElement;
|
let e = event.target.parentElement;
|
||||||
debounceTap(e, async () => {
|
debounceTap(e, async () => {
|
||||||
console.log("抽奖");
|
console.log("抽奖");
|
||||||
Toast.loading({
|
if(userStore.hasDraw){
|
||||||
|
Toast.loading({
|
||||||
message: "抽奖中",
|
message: "抽奖中",
|
||||||
forbidClick: true,
|
forbidClick: true,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
@ -31,12 +32,12 @@ const drawFn = (event) => {
|
|||||||
{ rotation: "+30", repeat: -1, yoyo: true, ease: "none", duration: 0.3 }
|
{ rotation: "+30", repeat: -1, yoyo: true, ease: "none", duration: 0.3 }
|
||||||
);
|
);
|
||||||
|
|
||||||
try {
|
drawApi(
|
||||||
const res = await drawApi(
|
{ subAnswerKey: userStore.drawKey },
|
||||||
{ subAnswerKey: userStore.drawKey },
|
userStore.token
|
||||||
userStore.token
|
).then(res => {
|
||||||
);
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
console.log('正常抽奖');
|
||||||
// isDrawn后端判断有没有中奖
|
// isDrawn后端判断有没有中奖
|
||||||
hasPrize.value = res.data.isDrawn == 1 ? true : false; // true 中奖 || false 未中奖
|
hasPrize.value = res.data.isDrawn == 1 ? true : false; // true 中奖 || false 未中奖
|
||||||
userStore.updateDraw(); // 更新抽奖机会
|
userStore.updateDraw(); // 更新抽奖机会
|
||||||
@ -48,23 +49,33 @@ const drawFn = (event) => {
|
|||||||
userStore.updatePrize(res.data);
|
userStore.updatePrize(res.data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hasPrize.value = false; // true 中奖 || false 未中奖
|
console.log('抽奖异常');
|
||||||
|
if (res.code == 6003) {
|
||||||
|
console.log('6003', res);
|
||||||
|
Toast(res.msg)
|
||||||
|
userStore.updateDraw();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log('eroor', res);
|
||||||
|
hasPrize.value = false; // true 中奖 || false 未中奖
|
||||||
|
userStore.updateDraw();
|
||||||
|
setTimeout(() => {
|
||||||
|
Toast.clear();
|
||||||
|
showResult.value = true;
|
||||||
|
gsap.from(".result-container", {
|
||||||
|
duration: 0.5,
|
||||||
|
scale: 0.7,
|
||||||
|
autoAlpha: 0,
|
||||||
|
});
|
||||||
|
gsap.killTweensOf(".draw-light,.draw");
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
})
|
||||||
hasPrize.value = false;
|
}else{
|
||||||
|
Toast('今日抽奖次数已用完!')
|
||||||
}
|
}
|
||||||
|
|
||||||
userStore.updateDraw();
|
|
||||||
setTimeout(() => {
|
|
||||||
Toast.clear();
|
|
||||||
showResult.value = true;
|
|
||||||
gsap.from(".result-container", {
|
|
||||||
duration: 0.5,
|
|
||||||
scale: 0.7,
|
|
||||||
autoAlpha: 0,
|
|
||||||
});
|
|
||||||
gsap.killTweensOf(".draw-light,.draw");
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -115,6 +126,8 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="draw-star"></div>
|
<div class="draw-star"></div>
|
||||||
<div class="draw-tips"></div>
|
<div class="draw-tips"></div>
|
||||||
|
<!-- 关闭按钮 -->
|
||||||
|
<div class="draw-cls-btn" @click="hide($event)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="showResult" class="result-container">
|
<div v-show="showResult" class="result-container">
|
||||||
<!-- 有奖品 -->
|
<!-- 有奖品 -->
|
||||||
@ -132,6 +145,7 @@ onMounted(() => {
|
|||||||
<div class="cls-btn" @click="hide($event)"></div>
|
<div class="cls-btn" @click="hide($event)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -146,6 +160,12 @@ onMounted(() => {
|
|||||||
@include box(685px, 694px);
|
@include box(685px, 694px);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|
||||||
|
.draw-cls-btn{
|
||||||
|
@include pos(82px, 82px,300.5px,670px);
|
||||||
|
@include bg_pos("prize/cls-btn.png");
|
||||||
|
}
|
||||||
|
|
||||||
.draw-light {
|
.draw-light {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@include pos(685px, 694px, 0px, 0px);
|
@include pos(685px, 694px, 0px, 0px);
|
||||||
@ -231,5 +251,6 @@ onMounted(() => {
|
|||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -36,10 +36,13 @@ const answerFn = (item, event) => {
|
|||||||
qid: cid,
|
qid: cid,
|
||||||
answer: item.secore,
|
answer: item.secore,
|
||||||
text: item.text,
|
text: item.text,
|
||||||
|
aid: item.aid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
answerList.value[has].answer = item.secore;
|
answerList.value[has].answer = item.secore;
|
||||||
answerList.value[has].text = item.text;
|
answerList.value[has].text = item.text;
|
||||||
|
answerList.value[has].aid = item.aid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新下一题信息
|
// 更新下一题信息
|
||||||
@ -63,10 +66,12 @@ const answerFn = (item, event) => {
|
|||||||
qid: cid,
|
qid: cid,
|
||||||
answer: item.secore,
|
answer: item.secore,
|
||||||
text: item.text,
|
text: item.text,
|
||||||
|
aid: item.aid
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
answerList.value[has].answer = item.secore;
|
answerList.value[has].answer = item.secore;
|
||||||
answerList.value[has].text = item.text;
|
answerList.value[has].text = item.text;
|
||||||
|
answerList.value[has].aid = item.aid;
|
||||||
}
|
}
|
||||||
resultBtnAni.play();
|
resultBtnAni.play();
|
||||||
}
|
}
|
||||||
@ -139,6 +144,10 @@ const prevePage = (event) => {
|
|||||||
}
|
}
|
||||||
activeId.value = "";
|
activeId.value = "";
|
||||||
currentId.value--;
|
currentId.value--;
|
||||||
|
|
||||||
|
// 查询上一题做的选择
|
||||||
|
console.log('当前题库:',answerList.value[currentId.value]);
|
||||||
|
activeId.value = answerList.value[currentId.value].aid
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -36,9 +36,7 @@ onMounted(() => {
|
|||||||
<div class="part">
|
<div class="part">
|
||||||
<div>【领奖说明】:</div>
|
<div>【领奖说明】:</div>
|
||||||
<div>
|
<div>
|
||||||
1、中奖后在中奖页面复制兑换码,前往[平安理财服务号]
|
1、中奖后在中奖页面复制兑换码,前往[平安理财服务号] 消息框输入“2024财运滚滚”获取兑换链接,进入链接输入兑换码兑换奖品。如关闭了中奖界面,可在首页-[我的奖品] 内查看兑换码。
|
||||||
消息框发送兑换码即可领取奖品。如关闭了中奖界面,可在首页-[我的奖品]
|
|
||||||
内查看兑换码;
|
|
||||||
</div>
|
</div>
|
||||||
<div>2、成功领奖后,奖品将会在24小时内自动到账,请耐心等候;</div>
|
<div>2、成功领奖后,奖品将会在24小时内自动到账,请耐心等候;</div>
|
||||||
<div>3、中奖人请在活动结束前进行兑换,逾期视为弃权。</div>
|
<div>3、中奖人请在活动结束前进行兑换,逾期视为弃权。</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="home">
|
<div class="home" @click.once="playMusic">
|
||||||
<Index v-if="showIndex" @IndexPage="indexFn"></Index>
|
<Index v-if="showIndex" @IndexPage="indexFn"></Index>
|
||||||
<Question v-if="showQuestion" @QuestionPage="questionFn"></Question>
|
<Question v-if="showQuestion" @QuestionPage="questionFn"></Question>
|
||||||
<Result v-if="showResult" @ResultPage="resultFn"></Result>
|
<Result v-if="showResult" @ResultPage="resultFn"></Result>
|
||||||
@ -19,7 +19,7 @@ import MyPrize from "@/components/MyPrize";
|
|||||||
import Draw from "@/components/Draw";
|
import Draw from "@/components/Draw";
|
||||||
import Result from "@/components/Result";
|
import Result from "@/components/Result";
|
||||||
import Rule from "@/components/Rule";
|
import Rule from "@/components/Rule";
|
||||||
import { createBGM, getQueryString, screenOrientation } from "@/plugins";
|
import { createBGM, getQueryString, screenOrientation, isAndriod } from "@/plugins";
|
||||||
import { authorize, getUserInfo } from "@/api";
|
import { authorize, getUserInfo } from "@/api";
|
||||||
import { Toast } from "vant";
|
import { Toast } from "vant";
|
||||||
import { useMainStore } from "@/store";
|
import { useMainStore } from "@/store";
|
||||||
@ -109,7 +109,7 @@ onMounted(() => {
|
|||||||
getUserInfo({ code: code }).then((res) => {
|
getUserInfo({ code: code }).then((res) => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log("我的信息:", res.data);
|
console.log("我的信息:", res.data);
|
||||||
userStore.updateToken(res.data.authorization);
|
userStore.updateToken(res.data);
|
||||||
createBGM();
|
createBGM();
|
||||||
// 开始加载组件
|
// 开始加载组件
|
||||||
showLoad.value = true;
|
showLoad.value = true;
|
||||||
@ -119,35 +119,37 @@ onMounted(() => {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log("重定向地址:", res.data);
|
console.log("重定向地址:", res.data);
|
||||||
location.replace(res.data);
|
location.replace(res.data);
|
||||||
}
|
} else {
|
||||||
|
// 活动已结束:6001
|
||||||
|
if (res.code == "6001") {
|
||||||
|
Toast.fail({
|
||||||
|
message: res.msg,
|
||||||
|
duration: 0,
|
||||||
|
forbidClick: true,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 活动已结束:6001
|
// 活动未开启:6002
|
||||||
if (res.code == "6001") {
|
if (res.code == "6002") {
|
||||||
Toast.fail({
|
Toast({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
forbidClick: true,
|
icon: "flag-o",
|
||||||
});
|
forbidClick: true,
|
||||||
return;
|
});
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 活动未开启:6002
|
// 其余情况
|
||||||
if (res.code == "6002") {
|
|
||||||
Toast({
|
Toast({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
icon: "flag-o",
|
|
||||||
forbidClick: true,
|
forbidClick: true,
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其余情况
|
|
||||||
Toast({
|
|
||||||
message: res.msg,
|
|
||||||
duration: 0,
|
|
||||||
forbidClick: true,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -156,26 +158,28 @@ onMounted(() => {
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log("重定向地址:", res.data);
|
console.log("重定向地址:", res.data);
|
||||||
location.replace(res.data);
|
location.replace(res.data);
|
||||||
|
} else {
|
||||||
|
// 活动已结束:6001
|
||||||
|
if (res.code == "6001") {
|
||||||
|
Toast.fail({
|
||||||
|
message: "活动已结束",
|
||||||
|
duration: 0,
|
||||||
|
forbidClick: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 活动未开启:6002
|
||||||
|
if (res.code == "6002") {
|
||||||
|
Toast({
|
||||||
|
message: "活动未开始",
|
||||||
|
duration: 0,
|
||||||
|
icon: "flag-o",
|
||||||
|
forbidClick: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 活动已结束:6001
|
|
||||||
if (res.code == "6001") {
|
|
||||||
Toast.fail({
|
|
||||||
message: "活动已结束",
|
|
||||||
duration: 0,
|
|
||||||
forbidClick: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 活动未开启:6002
|
|
||||||
if (res.code == "6002") {
|
|
||||||
Toast({
|
|
||||||
message: "活动未开始",
|
|
||||||
duration: 0,
|
|
||||||
icon: "flag-o",
|
|
||||||
forbidClick: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -206,6 +210,16 @@ const fontAdpat = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const playMusic = () => {
|
||||||
|
if (isAndriod) {
|
||||||
|
var audio = document.getElementById("audio");
|
||||||
|
audio.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" >
|
<style lang="scss" >
|
||||||
@ -247,6 +261,7 @@ const fontAdpat = () => {
|
|||||||
@include bg_pos("orientation-icon.png");
|
@include bg_pos("orientation-icon.png");
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.orientation-text {
|
.orientation-text {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
|||||||
@ -58,6 +58,25 @@ export function createBGM() {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
audioAni.play()
|
audioAni.play()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
|
|
||||||
|
// ios自动播放音乐
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
function audioAutoPlay() {
|
||||||
|
var audio = document.getElementById("bg-music");
|
||||||
|
audio.play();
|
||||||
|
document.addEventListener(
|
||||||
|
"WeixinJSBridgeReady",
|
||||||
|
function () {
|
||||||
|
WeixinJSBridge.invoke("getNetworkType", {}, function (e) {
|
||||||
|
audio.play();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
audioAutoPlay();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export const useMainStore = defineStore("counter", {
|
|||||||
actions: {
|
actions: {
|
||||||
updateToken(data) {
|
updateToken(data) {
|
||||||
this.token = data.authorization
|
this.token = data.authorization
|
||||||
// this.hasDraw = data.drawNumber == 0 ? false : true
|
this.hasDraw = data.drawNumber == 0 ? false : true
|
||||||
|
|
||||||
},
|
},
|
||||||
updatePrize(data) {
|
updatePrize(data) {
|
||||||
@ -30,8 +30,10 @@ export const useMainStore = defineStore("counter", {
|
|||||||
updateMBTI(type) {
|
updateMBTI(type) {
|
||||||
this.MBTI = type
|
this.MBTI = type
|
||||||
},
|
},
|
||||||
updateDrawKey(key) {
|
updateDrawKey(data) {
|
||||||
this.drawKey = key
|
console.log('保存结果:',data);
|
||||||
|
this.drawKey = data.subKey
|
||||||
|
this.hasDraw = data.drawFlag
|
||||||
},
|
},
|
||||||
updateDraw(value) {
|
updateDraw(value) {
|
||||||
this.hasDraw = false
|
this.hasDraw = false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user