完整逻辑
This commit is contained in:
@@ -38,10 +38,18 @@ const answerFn = (item, event) => {
|
||||
answerList.value[has].answer = item.text;
|
||||
}
|
||||
|
||||
// 判断是否为最后一题
|
||||
|
||||
gsap.set('.option-tips,.analysis', { autoAlpha: 1 })
|
||||
gsap.set('.question-box', { pointerEvents: 'none' })
|
||||
gsap.set('.answer-box', { pointerEvents: 'none' })
|
||||
isChecked.value = true
|
||||
console.log('currentId.value',currentId.value);
|
||||
if(currentId.value == 2 ){
|
||||
gsap.set('.create-btn', { display: 'block' })
|
||||
}else{
|
||||
gsap.set('.next-btn', { display: 'block' })
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
@@ -55,7 +63,9 @@ const nextQuestion = (event) => {
|
||||
gsap.set('.option-tips,.analysis', { autoAlpha: 0 })
|
||||
currentId.value++
|
||||
activeId.value = ''
|
||||
gsap.set('.question-box', { pointerEvents: 'initial' })
|
||||
gsap.set('.answer-box', { pointerEvents: 'initial' })
|
||||
gsap.set('.next-btn', { display: 'none' })
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
@@ -161,7 +171,7 @@ onMounted(() => {
|
||||
<!-- 解析 -->
|
||||
<div class="analysis">{{ questionList[currentId].analysis }}</div>
|
||||
<div class="next-btn" @click="nextQuestion($event)"></div>
|
||||
<div class="next-btn" @click="nextQuestion($event)"></div>
|
||||
<div class="create-btn" @click="viewResult($event)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="question-lantern-icon"></div>
|
||||
@@ -247,12 +257,15 @@ onMounted(() => {
|
||||
@include pos(570px, 700px, 43px, 194px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
// justify-content: space-around;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
// 问题样式
|
||||
.question {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.question-text {
|
||||
width: 100%;
|
||||
@@ -374,24 +387,29 @@ onMounted(() => {
|
||||
|
||||
// 解析样式
|
||||
.analysis {
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
font-family: 'HarmonyOS_Sans_SC_Regular';
|
||||
font-size: 25px;
|
||||
font-size: 20px;
|
||||
color: #ffe2ad;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
height: 150px;
|
||||
line-height: 40px;
|
||||
padding: 20px;
|
||||
height: 80px;
|
||||
line-height: 30px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.next-btn{
|
||||
@include box(234px,65px);
|
||||
@include bg_pos("qa/next-btn.png");
|
||||
display: none;
|
||||
|
||||
}
|
||||
.create-btn{
|
||||
@include box(234px,65px);
|
||||
@include bg_pos("qa/create-btn.png");
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user