完成逻辑
This commit is contained in:
parent
98d301a749
commit
2ae9dc33f4
BIN
src/assets/font/DouyinSansBold.otf
Normal file
BIN
src/assets/font/DouyinSansBold.otf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -46,6 +46,11 @@ const answerFn = (item, event) => {
|
|||||||
userStore.updatePosterId(getRandomNumber([1, 2, 3]))
|
userStore.updatePosterId(getRandomNumber([1, 2, 3]))
|
||||||
gsap.set('.question-box', { pointerEvents: 'none' })
|
gsap.set('.question-box', { pointerEvents: 'none' })
|
||||||
Toast('答题结束')
|
Toast('答题结束')
|
||||||
|
Toast.loading({
|
||||||
|
message: '结果生成中',
|
||||||
|
duration: 0,
|
||||||
|
forbidClick: true,
|
||||||
|
})
|
||||||
|
|
||||||
if (import.meta.env.VITE_MODE != "dev") {
|
if (import.meta.env.VITE_MODE != "dev") {
|
||||||
// 提交完成记录
|
// 提交完成记录
|
||||||
@ -55,14 +60,18 @@ const answerFn = (item, event) => {
|
|||||||
userStore.updateDrawKey(res.data);
|
userStore.updateDrawKey(res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
gsap.to('.QuestionPage', {
|
setTimeout(() => {
|
||||||
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
Toast.clear()
|
||||||
emit("QuestionPage", { action: "showResult" });
|
gsap.to('.QuestionPage', {
|
||||||
}
|
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
||||||
})
|
emit("QuestionPage", { action: "showResult" });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
Toast.clear()
|
||||||
gsap.to('.QuestionPage', {
|
gsap.to('.QuestionPage', {
|
||||||
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
||||||
emit("QuestionPage", { action: "showResult" });
|
emit("QuestionPage", { action: "showResult" });
|
||||||
@ -72,32 +81,11 @@ const answerFn = (item, event) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("答案库", answerList.value);
|
console.log("答案库", answerList.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const showResult = () => {
|
|
||||||
|
|
||||||
gsap.set(".answer-box", { pointerEvents: "none" })
|
|
||||||
|
|
||||||
gsap.to(".prev-btn", { duration: 0.5, x: "-=20px", autoAlpha: 0 });
|
|
||||||
questionOut.timeScale(2);
|
|
||||||
questionOut.restart();
|
|
||||||
questionOut.eventCallback("onComplete", () => {
|
|
||||||
gsap.to(".QuestionPage", {
|
|
||||||
duration: 0.5,
|
|
||||||
autoAlpha: 0,
|
|
||||||
onComplete: () => {
|
|
||||||
emit("QuestionPage", { action: "showResult" });
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// 从数组中随机生成一个数字
|
// 从数组中随机生成一个数字
|
||||||
const getRandomNumber = (arr) => {
|
const getRandomNumber = (arr) => {
|
||||||
var randomIndex = Math.floor(Math.random() * arr.length);
|
var randomIndex = Math.floor(Math.random() * arr.length);
|
||||||
@ -107,9 +95,9 @@ const getRandomNumber = (arr) => {
|
|||||||
// 查看结果事件及动画
|
// 查看结果事件及动画
|
||||||
// const resultBtnAni = gsap.timeline({ paused: true });
|
// const resultBtnAni = gsap.timeline({ paused: true });
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
gsap.from('.question-bg',{duration:0.5,autoAlpha:0,})
|
gsap.from('.question-bg', { duration: 0.5, autoAlpha: 0, })
|
||||||
gsap.from('.question-box',{duration:0.5,scale:0.4,autoAlpha:0,})
|
gsap.from('.question-box', { duration: 0.5, scale: 0.4, autoAlpha: 0, })
|
||||||
gsap.to('.question-lantern-icon',{duration:5,transformOrigin:'100% 0%',rotation:'10deg',repeat:-1,yoyo:true,ease:'none'})
|
gsap.to('.question-lantern-icon', { duration: 5, transformOrigin: '100% 0%', rotation: '10deg', repeat: -1, yoyo: true, ease: 'none' })
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -246,7 +234,6 @@ onMounted(() => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: 'DouyinSansBold';
|
font-family: 'DouyinSansBold';
|
||||||
font-size: 35px;
|
font-size: 35px;
|
||||||
font-family: "DOUYINSANSBOLD";
|
|
||||||
color: rgb(255, 255, 255);
|
color: rgb(255, 255, 255);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user