update
This commit is contained in:
parent
937c6a9aa3
commit
5f83051186
Binary file not shown.
@ -18,6 +18,7 @@ const activeId = ref(""); // 当前题目所选答案选项
|
|||||||
const showResultBtn = ref(false);
|
const showResultBtn = ref(false);
|
||||||
// 答题事件
|
// 答题事件
|
||||||
const answerFn = (item, event) => {
|
const answerFn = (item, event) => {
|
||||||
|
console.log('current:',currentId.value);
|
||||||
let e = event.target.parentElement.parentElement;
|
let e = event.target.parentElement.parentElement;
|
||||||
activeId.value = item.aid;
|
activeId.value = item.aid;
|
||||||
debounceTap(e, () => {
|
debounceTap(e, () => {
|
||||||
@ -50,6 +51,7 @@ const answerFn = (item, event) => {
|
|||||||
console.log("jieshu");
|
console.log("jieshu");
|
||||||
Toast("答题结束");
|
Toast("答题结束");
|
||||||
gsap.set(".answer", { pointerEvents: "none" });
|
gsap.set(".answer", { pointerEvents: "none" });
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
activeId.value = "";
|
activeId.value = "";
|
||||||
@ -73,17 +75,19 @@ const answerFn = (item, event) => {
|
|||||||
answerList.value[has].text = item.text;
|
answerList.value[has].text = item.text;
|
||||||
answerList.value[has].aid = item.aid;
|
answerList.value[has].aid = item.aid;
|
||||||
}
|
}
|
||||||
resultBtnAni.play();
|
// resultBtnAni.play();
|
||||||
|
// 答题结束
|
||||||
|
showResult()
|
||||||
}
|
}
|
||||||
console.log("答案库", answerList.value);
|
console.log("答案库", answerList.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const mbtiArr = [[], [], [], []]; //四组数组分别存放 E&I,S&T,T&F,J&P四组结果
|
const mbtiArr = [[], [], [], []]; //四组数组分别存放 E&I,S&T,T&F,J&P四组结果
|
||||||
const showResult = (event) => {
|
const showResult = () => {
|
||||||
let e = event.target;
|
|
||||||
gsap.set(".answer-box", { pointerEvents: "none" });
|
gsap.set(".answer-box", { pointerEvents: "none" });
|
||||||
debounceTap(e, async () => {
|
|
||||||
console.log("答题结果:", answerList.value);
|
console.log("答题结果:", answerList.value);
|
||||||
answerList.value.forEach((element) => {
|
answerList.value.forEach((element) => {
|
||||||
if (element.answer == "E" || element.answer == "I")
|
if (element.answer == "E" || element.answer == "I")
|
||||||
@ -115,7 +119,7 @@ const showResult = (event) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Toast("你的MBTI测试结果:" + mbti);
|
// Toast("你的MBTI测试结果:" + mbti);
|
||||||
resultBtnAni.reverse();
|
// resultBtnAni.reverse();
|
||||||
gsap.to(".prev-btn", { duration: 0.5, x: "-=20px", autoAlpha: 0 });
|
gsap.to(".prev-btn", { duration: 0.5, x: "-=20px", autoAlpha: 0 });
|
||||||
questionOut.timeScale(2);
|
questionOut.timeScale(2);
|
||||||
questionOut.restart();
|
questionOut.restart();
|
||||||
@ -128,7 +132,7 @@ const showResult = (event) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 上一页函数
|
// 上一页函数
|
||||||
@ -139,7 +143,7 @@ const prevePage = (event) => {
|
|||||||
gsap.to(".prev-btn", { duration: 0.5, x: "-=20px", autoAlpha: 0 });
|
gsap.to(".prev-btn", { duration: 0.5, x: "-=20px", autoAlpha: 0 });
|
||||||
}
|
}
|
||||||
if (currentId.value >= 11) {
|
if (currentId.value >= 11) {
|
||||||
resultBtnAni.reverse();
|
// resultBtnAni.reverse();
|
||||||
gsap.set(".answer", { pointerEvents: "initial" });
|
gsap.set(".answer", { pointerEvents: "initial" });
|
||||||
}
|
}
|
||||||
activeId.value = "";
|
activeId.value = "";
|
||||||
@ -170,14 +174,14 @@ const questionOut = gsap.timeline({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 查看结果事件及动画
|
// 查看结果事件及动画
|
||||||
const resultBtnAni = gsap.timeline({ paused: true });
|
// const resultBtnAni = gsap.timeline({ paused: true });
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 适配
|
// 适配
|
||||||
if (!judgeBigScreen()) {
|
if (!judgeBigScreen()) {
|
||||||
gsap.set(".answer-box", { scale: 0.9, marginTop: "-20px" });
|
gsap.set(".answer-box", { scale: 0.9, marginTop: "-20px" });
|
||||||
}
|
}
|
||||||
|
|
||||||
resultBtnAni.from(".showResult-btn", { y: 200, autoAlpha: 0 });
|
// resultBtnAni.from(".showResult-btn", { y: 200, autoAlpha: 0 });
|
||||||
questionEntry
|
questionEntry
|
||||||
.from(".question", { y: 100, autoAlpha: 0 })
|
.from(".question", { y: 100, autoAlpha: 0 })
|
||||||
.from(".answer-0", {
|
.from(".answer-0", {
|
||||||
@ -278,7 +282,7 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 查看结果 -->
|
<!-- 查看结果 -->
|
||||||
<div class="showResult-btn" @click="showResult"></div>
|
<!-- <div class="showResult-btn" @click="showResult"></div> -->
|
||||||
<!-- 上一页 -->
|
<!-- 上一页 -->
|
||||||
<div class="prev-btn" @click="prevePage($event)"></div>
|
<div class="prev-btn" @click="prevePage($event)"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -123,7 +123,7 @@ const createPoster = (event) => {
|
|||||||
{
|
{
|
||||||
name: "product",
|
name: "product",
|
||||||
src: mbtiObj.value.productPic,
|
src: mbtiObj.value.productPic,
|
||||||
pos: { w: mbtiObj.value.picPos.w, h: mbtiObj.value.picPos.h, x: 137, y: 911 },
|
pos: { w: mbtiObj.value.picPos.w, h: mbtiObj.value.picPos.h, x: 137, y: 921 },
|
||||||
},
|
},
|
||||||
// 二维码
|
// 二维码
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,7 +77,7 @@ const drawFn = (item) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showResult = ref(true);
|
const showResult = ref(false);
|
||||||
const resultFn = (item) => {
|
const resultFn = (item) => {
|
||||||
if (item.action == "hide") {
|
if (item.action == "hide") {
|
||||||
showResult.value = false;
|
showResult.value = false;
|
||||||
@ -210,7 +210,6 @@ onMounted(() => {
|
|||||||
|
|
||||||
|
|
||||||
const playMusic = () => {
|
const playMusic = () => {
|
||||||
|
|
||||||
if(isAndriod){
|
if(isAndriod){
|
||||||
var audioEle = document.getElementById("audio");
|
var audioEle = document.getElementById("audio");
|
||||||
audioEle.play();
|
audioEle.play();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user