更改答题页页面
|
Before Width: | Height: | Size: 517 KiB After Width: | Height: | Size: 510 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 177 KiB |
BIN
src/assets/images/qa/correct.png
Normal file
|
After Width: | Height: | Size: 749 B |
BIN
src/assets/images/qa/create-btn.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.7 KiB |
BIN
src/assets/images/qa/incorrect.png
Normal file
|
After Width: | Height: | Size: 833 B |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 33 KiB |
BIN
src/assets/images/qa/next-btn.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 43 KiB |
@ -16,6 +16,8 @@ const questionList = ref(data); //随机打乱题库
|
|||||||
const answerList = ref([]); // 答案库统计
|
const answerList = ref([]); // 答案库统计
|
||||||
const activeId = ref(""); // 当前题目所选答案选项
|
const activeId = ref(""); // 当前题目所选答案选项
|
||||||
const showResultBtn = ref(false);
|
const showResultBtn = ref(false);
|
||||||
|
const isChecked = ref(false)
|
||||||
|
|
||||||
// 答题事件
|
// 答题事件
|
||||||
const answerFn = (item, event) => {
|
const answerFn = (item, event) => {
|
||||||
let e = event.target.parentElement;
|
let e = event.target.parentElement;
|
||||||
@ -37,39 +39,49 @@ const answerFn = (item, event) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否为最后一题
|
// 判断是否为最后一题
|
||||||
if (currentId.value < questionList.value.length - 1) {
|
gsap.set('.option-tips,.analysis', { autoAlpha: 1 })
|
||||||
currentId.value++
|
gsap.set('.question-box', { pointerEvents: 'none' })
|
||||||
activeId.value = ''
|
isChecked.value = true
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
}
|
||||||
// 随机生成海报id
|
|
||||||
userStore.updatePosterId(getRandomNumber([1, 2, 3]))
|
|
||||||
gsap.set('.question-box', { pointerEvents: 'none' })
|
|
||||||
Toast('答题结束')
|
|
||||||
Toast.loading({
|
|
||||||
message: '结果生成中',
|
|
||||||
duration: 0,
|
|
||||||
forbidClick: true,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (import.meta.env.VITE_MODE != "dev") {
|
|
||||||
// 提交完成记录
|
|
||||||
subAnswer({}, userStore.token).then((res) => {
|
|
||||||
console.log("key:", res);
|
|
||||||
if (res.code == 0) {
|
|
||||||
userStore.updateDrawKey(res.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
// 下一题
|
||||||
Toast.clear()
|
const nextQuestion = (event) => {
|
||||||
gsap.to('.QuestionPage', {
|
let e = event.target;
|
||||||
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
debounceTap(e, () => {
|
||||||
emit("QuestionPage", { action: "showResult" });
|
isChecked.value = false
|
||||||
}
|
gsap.set('.option-tips,.analysis', { autoAlpha: 0 })
|
||||||
})
|
currentId.value++
|
||||||
}, 1000)
|
activeId.value = ''
|
||||||
});
|
gsap.set('.question-box', { pointerEvents: 'initial' })
|
||||||
} else {
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查看结果事件
|
||||||
|
const viewResult = (event) => {
|
||||||
|
let e = event.target;
|
||||||
|
debounceTap(e, () => {
|
||||||
|
// 随机生成海报id
|
||||||
|
userStore.updatePosterId(getRandomNumber([1, 2, 3]))
|
||||||
|
gsap.set('.question-box', { pointerEvents: 'none' })
|
||||||
|
Toast('答题结束')
|
||||||
|
Toast.loading({
|
||||||
|
message: '结果生成中',
|
||||||
|
duration: 0,
|
||||||
|
forbidClick: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (import.meta.env.VITE_MODE != "dev") {
|
||||||
|
// 提交完成记录
|
||||||
|
subAnswer({}, userStore.token).then((res) => {
|
||||||
|
console.log("key:", res);
|
||||||
|
if (res.code == 0) {
|
||||||
|
userStore.updateDrawKey(res.data);
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Toast.clear()
|
Toast.clear()
|
||||||
gsap.to('.QuestionPage', {
|
gsap.to('.QuestionPage', {
|
||||||
@ -78,13 +90,19 @@ const answerFn = (item, event) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
});
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
Toast.clear()
|
||||||
|
gsap.to('.QuestionPage', {
|
||||||
|
duration: 0.5, autoAlpha: 0, onComplete: () => {
|
||||||
|
emit("QuestionPage", { action: "showResult" });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
console.log("答案库", answerList.value);
|
})
|
||||||
});
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 从数组中随机生成一个数字
|
// 从数组中随机生成一个数字
|
||||||
const getRandomNumber = (arr) => {
|
const getRandomNumber = (arr) => {
|
||||||
@ -92,8 +110,7 @@ const getRandomNumber = (arr) => {
|
|||||||
return arr[randomIndex];
|
return arr[randomIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看结果事件及动画
|
|
||||||
// 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, })
|
||||||
@ -123,21 +140,28 @@ onMounted(() => {
|
|||||||
<div class="question-text" v-for="item in questionList[currentId].question" :key="item">
|
<div class="question-text" v-for="item in questionList[currentId].question" :key="item">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="question-tips">打一系列产品</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选项 -->
|
<!-- 选项 -->
|
||||||
<div class="answer-box">
|
<div class="answer-box">
|
||||||
<div class="answer" :class="activeId == item.aid ? 'answer-active' : ''"
|
<div class="answer" :class="isChecked ? item.result + '-bg' : ''"
|
||||||
v-for="item in questionList[currentId].answer" :key="item.aid">
|
v-for="item in questionList[currentId].answer" :key="item.aid">
|
||||||
<div class="answer-option">{{ item.aid }}</div>
|
|
||||||
<div class="answer-text-box">
|
<div class="answer-text-box">
|
||||||
<div class="answer-text" v-for="a in item.text" :key="a">
|
<div class="answer-text" v-for="a in item.text" :key="a">
|
||||||
{{ a }}
|
{{ item.aid }}.{{ a }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="option-tips">
|
||||||
|
<div :class="item.result"></div>
|
||||||
|
</div>
|
||||||
<!-- 可点击区域 -->
|
<!-- 可点击区域 -->
|
||||||
<div class="click-area" @click="answerFn(item, $event)"></div>
|
<div class="click-area" @click="answerFn(item, $event)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 解析 -->
|
||||||
|
<div class="analysis">{{ questionList[currentId].analysis }}</div>
|
||||||
|
<div class="next-btn" @click="nextQuestion($event)"></div>
|
||||||
|
<div class="next-btn" @click="nextQuestion($event)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="question-lantern-icon"></div>
|
<div class="question-lantern-icon"></div>
|
||||||
@ -187,7 +211,7 @@ onMounted(() => {
|
|||||||
@include flexCen();
|
@include flexCen();
|
||||||
|
|
||||||
.question-lantern-icon {
|
.question-lantern-icon {
|
||||||
pointer-events: none;
|
// pointer-events: none;
|
||||||
@include pos(349px, 443px, 489px, 49px);
|
@include pos(349px, 443px, 489px, 49px);
|
||||||
@include bg_pos('qa/lantern-icon.png');
|
@include bg_pos('qa/lantern-icon.png');
|
||||||
}
|
}
|
||||||
@ -220,7 +244,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.qa-question-box {
|
.qa-question-box {
|
||||||
@include pos(570px, 620px, 43px, 194px);
|
@include pos(570px, 700px, 43px, 194px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
@ -240,6 +264,16 @@ onMounted(() => {
|
|||||||
text-shadow: 0.675px 2.923px 6px rgba(164, 18, 14, 0.004);
|
text-shadow: 0.675px 2.923px 6px rgba(164, 18, 14, 0.004);
|
||||||
// -webkit-transform: matrix( 0.63514641527437,0,0,0.63514641527437,0,0);
|
// -webkit-transform: matrix( 0.63514641527437,0,0,0.63514641527437,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.question-tips {
|
||||||
|
font-size: 25px;
|
||||||
|
width: 100%;
|
||||||
|
font-family: 'DouyinSansBold';
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
text-shadow: 0.675px 2.923px 6px rgba(164, 18, 14, 0.004);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选项样式
|
// 选项样式
|
||||||
@ -249,8 +283,8 @@ onMounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
// 选中状态
|
// 选中状态
|
||||||
.answer-active {
|
.correct-bg {
|
||||||
border: 2px solid rgb(255, 238, 186) !important;
|
border: 1px solid rgb(255, 238, 186) !important;
|
||||||
background-image: linear-gradient(177deg, rgb(255, 184, 127) 0%, rgb(255, 238, 186) 100%);
|
background-image: linear-gradient(177deg, rgb(255, 184, 127) 0%, rgb(255, 238, 186) 100%);
|
||||||
background-image: -webkit-linear-gradient(177deg, rgb(255, 184, 127) 0%, rgb(255, 238, 186) 100%);
|
background-image: -webkit-linear-gradient(177deg, rgb(255, 184, 127) 0%, rgb(255, 238, 186) 100%);
|
||||||
|
|
||||||
@ -259,13 +293,27 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.answer-text-box {
|
.answer-text-box {
|
||||||
|
|
||||||
color: #96100f !important;
|
color: #96100f !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.incorrect-bg {
|
||||||
|
background-image: -webkit-linear-gradient(177deg, rgb(195, 59, 22) 0%, rgb(209, 84, 51) 100%);
|
||||||
|
box-shadow: 0px 3px 6px 0px rgba(133, 0, 3, 0.85), inset 0px 2px 5px 0px rgba(236, 74, 42, 0.004);
|
||||||
|
|
||||||
|
.answer-option {
|
||||||
|
color: #ffe2ad;
|
||||||
|
}
|
||||||
|
|
||||||
|
.answer-text-box {
|
||||||
|
color: #ffe2ad !important;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.answer {
|
.answer {
|
||||||
@include box(476px, 92px);
|
@include box(476px, 92px);
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -274,7 +322,7 @@ onMounted(() => {
|
|||||||
margin-bottom: 35px;
|
margin-bottom: 35px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.click-area {
|
.click-area {
|
||||||
@ -283,19 +331,23 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.answer-option {
|
.option-tips {
|
||||||
@include box(92px, 77px);
|
@include box(60px, 60px);
|
||||||
border-radius: 38.5px;
|
visibility: hidden;
|
||||||
background-color: rgb(233, 197, 143);
|
|
||||||
font-size: 52px;
|
.correct {
|
||||||
display: flex;
|
@include box(100%, 100%);
|
||||||
justify-content: center;
|
@include bg_pos("qa/correct.png");
|
||||||
align-items: center;
|
}
|
||||||
color: #cc1615;
|
|
||||||
font-weight: 700;
|
.incorrect {
|
||||||
margin-left: 5px;
|
@include box(100%, 100%);
|
||||||
|
@include bg_pos("qa/incorrect.png");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.answer-text-box {
|
.answer-text-box {
|
||||||
@include box(335px, 100%);
|
@include box(335px, 100%);
|
||||||
font-family: 'HarmonyOS_Sans_SC_Regular';
|
font-family: 'HarmonyOS_Sans_SC_Regular';
|
||||||
@ -307,6 +359,8 @@ onMounted(() => {
|
|||||||
|
|
||||||
.answer-text {
|
.answer-text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
// text-align: center;
|
||||||
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -316,6 +370,28 @@ onMounted(() => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析样式
|
||||||
|
.analysis {
|
||||||
|
width: 100%;
|
||||||
|
font-family: 'HarmonyOS_Sans_SC_Regular';
|
||||||
|
font-size: 25px;
|
||||||
|
color: #ffe2ad;
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
height: 150px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn{
|
||||||
|
@include box(234px,65px);
|
||||||
|
@include bg_pos("qa/next-btn.png");
|
||||||
|
|
||||||
|
}
|
||||||
|
.create-btn{
|
||||||
|
@include box(234px,65px);
|
||||||
|
@include bg_pos("qa/create-btn.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,12 +31,16 @@ const page = [
|
|||||||
'prize/no-prize.png',
|
'prize/no-prize.png',
|
||||||
'prize/star.png',
|
'prize/star.png',
|
||||||
|
|
||||||
|
'qa/correct.png',
|
||||||
'qa/gold-icon.png',
|
'qa/gold-icon.png',
|
||||||
'qa/question-box.png',
|
'qa/incorrect.png',
|
||||||
'qa/lantern-icon.png',
|
|
||||||
'qa/gold-icon-2.png',
|
'qa/gold-icon-2.png',
|
||||||
'qa/bg.jpg',
|
'qa/next-btn.png',
|
||||||
|
'qa/create-btn.png',
|
||||||
|
'qa/lantern-icon.png',
|
||||||
|
'qa/question-box.png',
|
||||||
'qa/bottom-bg.png',
|
'qa/bottom-bg.png',
|
||||||
|
'qa/bg.jpg',
|
||||||
|
|
||||||
'result/tips.png',
|
'result/tips.png',
|
||||||
'result/product-3.png',
|
'result/product-3.png',
|
||||||
|
|||||||
@ -2,72 +2,72 @@ export const data = [
|
|||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
question: [
|
question: [
|
||||||
'元宵幸福是来源于阖家团圆',
|
'兄弟好多个,个个都爱赢',
|
||||||
'你的投资“幸福感”从何而来?',
|
'目标很合适,止盈有方法',
|
||||||
],
|
],
|
||||||
answer: [
|
answer: [
|
||||||
{
|
{
|
||||||
aid: 'A',
|
aid: 'A',
|
||||||
text: [
|
text: [
|
||||||
'低波动低回撤',
|
'灵活策略目标盈',
|
||||||
'追求稳稳的幸福',
|
|
||||||
],
|
],
|
||||||
|
result:'correct',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
aid: 'B',
|
aid: 'B',
|
||||||
text: [
|
text: [
|
||||||
'流动性好',
|
'灵活策略目标强',
|
||||||
'存取超方便',
|
|
||||||
],
|
],
|
||||||
|
result:'incorrect',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
question: [
|
question: [
|
||||||
'“投资就像猜灯谜,不能碰运气',
|
'固收旗舰团,兄弟有志气',
|
||||||
'学会评估才是关键”',
|
'三个金牛奖,开启财富门',
|
||||||
'你倾向于什么方式评估?',
|
|
||||||
],
|
],
|
||||||
answer: [
|
answer: [
|
||||||
{
|
{
|
||||||
aid: 'A',
|
aid: 'A',
|
||||||
text: [
|
text: [
|
||||||
'根据详细的市场报告',
|
'启航',
|
||||||
'及历史数据具体分析',
|
|
||||||
],
|
],
|
||||||
|
result:'correct',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
aid: 'B',
|
aid: 'B',
|
||||||
text: [
|
text: [
|
||||||
'根据整体市场趋势',
|
'远航',
|
||||||
'进行未来预测',
|
|
||||||
],
|
],
|
||||||
|
result:'incorrect',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
analysis: '(注:截止2024年1月30日,启航系列历史到期正收益概率100%)'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
question: [
|
question: [
|
||||||
'元宵是新年开运吉日',
|
'兄弟好多个,口碑都很好',
|
||||||
'此时开启一项新投资',
|
'考试常满分,稳重不轻浮',
|
||||||
'你更追求?',
|
|
||||||
],
|
],
|
||||||
answer: [
|
answer: [
|
||||||
{
|
{
|
||||||
aid: 'A',
|
aid: 'A',
|
||||||
text: [
|
text: [
|
||||||
'尽可能保证本金安全',
|
'稳健精选',
|
||||||
'追求“落袋为安”',
|
|
||||||
],
|
],
|
||||||
|
result:'correct',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
aid: 'B',
|
aid: 'B',
|
||||||
text: [
|
text: [
|
||||||
'产生较多的收益',
|
'稳妥精选',
|
||||||
'可以承担一定的投资风险',
|
|
||||||
],
|
],
|
||||||
|
result:'incorrect',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
analysis: '(注:截止2024年1月30日,稳健精选系列历史到期业绩基准达标率100%)'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@ -57,7 +57,7 @@ const indexFn = (item) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const showQuestion = ref(false);
|
const showQuestion = ref(true);
|
||||||
const questionFn = (item) => {
|
const questionFn = (item) => {
|
||||||
if (item.action == "hide") {
|
if (item.action == "hide") {
|
||||||
showQuestion.value = false;
|
showQuestion.value = false;
|
||||||
@ -209,7 +209,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showLoad.value = true;
|
// showLoad.value = true;
|
||||||
createBGM();
|
createBGM();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||