|
|
@@ -4,14 +4,14 @@
|
|
|
<div class="box">
|
|
|
<block if="{{!finishStatus}}">
|
|
|
<div class="title mgb-50">
|
|
|
- <text> {{ curIndex + 1 }}、{{ QList[curIndex].title }}</text>
|
|
|
+ <text style="color: #333;font-size: 32px;font-weight: 500;"> {{ curIndex + 1 }}、{{ QList[curIndex].title }}</text>
|
|
|
</div>
|
|
|
<div
|
|
|
- for="(key, a) in QList[curIndex].AlistArr"
|
|
|
+ for="(key, a) in AlistArr"
|
|
|
@click="chooseA(a.key)"
|
|
|
class="Aitem {{curChoose === a.key ? 'active' : ''}}">
|
|
|
- <text>{{ a.key }}、</text>
|
|
|
- <text>{{ a.value }}</text>
|
|
|
+ <text style="color: {{ curChoose === a.key ? '#399bfc':'#666' }}">{{ a.key }}、</text>
|
|
|
+ <text style="color: {{ curChoose === a.key ? '#399bfc':'#666' }}">{{ a.value }}</text>
|
|
|
</div>
|
|
|
</block>
|
|
|
<block if="{{finishStatus}}">
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</block>
|
|
|
<div class="btn w-300 bottom-30" @click="nextFn">
|
|
|
<text class="btn-read" if="{{ curIndex == QList.length - 1 }}">
|
|
|
- 显示结果
|
|
|
+ {{ finishStatus?'重新测评':'显示结果' }}
|
|
|
</text>
|
|
|
<text class="btn-read" if="{{ curIndex != QList.length - 1 }}">
|
|
|
下一题
|
|
|
@@ -48,6 +48,11 @@ export default {
|
|
|
resultText: ''
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ AlistArr() {
|
|
|
+ return this.QList[this.curIndex].AlistArr
|
|
|
+ }
|
|
|
+ },
|
|
|
onInit() {
|
|
|
// 把 Alist 转成数组方便 for 渲染
|
|
|
this.QList.forEach(q => {
|
|
|
@@ -69,12 +74,18 @@ export default {
|
|
|
this.curChoose = null;
|
|
|
this.curIndex += 1;
|
|
|
} else {
|
|
|
+ if(this.finishStatus){ // 重新测评
|
|
|
+ this.curIndex = 0
|
|
|
+ this.chooseList = []
|
|
|
+ this.curChoose = null
|
|
|
+ this.finishStatus = false
|
|
|
+ return
|
|
|
+ }
|
|
|
this.finishStatus = true;
|
|
|
this.resultText = this.generatePersonality();
|
|
|
$utils.showToast('提交成功!')
|
|
|
- return
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
generatePersonality() {
|
|
|
if (this.chooseList.length !== 5) return "请完成所有问题";
|
|
|
@@ -127,7 +138,7 @@ export default {
|
|
|
}
|
|
|
.box {
|
|
|
margin-top: 100px;
|
|
|
- height: 850px;
|
|
|
+ height: 800px;
|
|
|
width: 100%;
|
|
|
flex-direction: column;
|
|
|
background-color: #fff;
|
|
|
@@ -146,11 +157,11 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.Aitem {
|
|
|
- border: 1px solid #000;
|
|
|
+ border: 1px solid #666;
|
|
|
height: 80px;
|
|
|
line-height: 80px;
|
|
|
border-radius: 22px;
|
|
|
- margin-bottom: 20px;
|
|
|
+ margin-bottom: 30px;
|
|
|
padding: 0 20px;
|
|
|
}
|
|
|
.btn{
|