|
|
@@ -1,15 +1,17 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <view class="pdy-60 pdx-28 mgt-100 radio-20 bg-white w border-0_1 box">
|
|
|
- <view class="title mgb-50" >
|
|
|
- {{ curIndex + 1 }}、{{ QList[curIndex].title }}
|
|
|
- </view>
|
|
|
- <view class="Aitem flex" v-for="(a,key) in QList[curIndex].Alist"
|
|
|
- @click="chooseA(key)" :class="chooseList[curIndex] == key ?'active':''">
|
|
|
- <view class="">{{ key }}、</view>
|
|
|
- <view class="">{{ a }}</view>
|
|
|
- </view>
|
|
|
- <view class="next_btn cursor" @click="nextFn">{{ curIndex == QList.length - 1 ? '提交' : '下一题'}}</view>
|
|
|
+ <view :style="{ paddingTop: statusBarHeight + 'px' }">
|
|
|
+ <view class="pdy-60 pdx-28 mgt-100 radio-20 bg-white w border-0_1 box">
|
|
|
+ <view class="title mgb-50" >
|
|
|
+ {{ curIndex + 1 }}、{{ QList[curIndex].title }}
|
|
|
+ </view>
|
|
|
+ <view class="Aitem flex" v-for="(a,key) in QList[curIndex].Alist"
|
|
|
+ @click="chooseA(key)" :class="chooseList[curIndex] == key ?'active':''">
|
|
|
+ <view class="">{{ key }}、</view>
|
|
|
+ <view class="">{{ a }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="next_btn cursor" @click="nextFn">{{ curIndex == QList.length - 1 ? '显示结果' : '下一题'}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -17,13 +19,15 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted } from "vue";
|
|
|
import { onShow } from "@dcloudio/uni-app";
|
|
|
+var statusBarHeight = uni.getStorageSync('statusBarHeight')
|
|
|
const QList = ref([
|
|
|
- { title:'你更喜欢哪种社交场合1?',Alist:{'A':'大型会所1','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} },
|
|
|
- { title:'你更喜欢哪种社交场合2?',Alist:{'A':'大型会所2','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} },
|
|
|
- { title:'你更喜欢哪种社交场合3?',Alist:{'A':'大型会所3','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} },
|
|
|
- { title:'你更喜欢哪种社交场合4?',Alist:{'A':'大型会所4','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} },
|
|
|
- { title:'你更喜欢哪种社交场合5?',Alist:{'A':'大型会所5','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} }
|
|
|
-])
|
|
|
+ { title:'你更喜欢哪种社交场合?',Alist:{'A':'大型会所','B':'小型会所','C':'与几位亲朋密友聚会','D':'独自一人'} },
|
|
|
+ { title:'你在做决定时更倾向于?',Alist:{'A':'依靠逻辑和事实','B':'依靠直觉和感觉','C':'参考别人的意见','D':'随机应变'} },
|
|
|
+ { title:'你更喜欢哪种工作环境?',Alist:{'A':'有条不紊的办公室','B':'灵活自由的环境','C':'家庭办公','D':'合作共享的空间'} },
|
|
|
+ { title:'在团队中,你通常扮演什么角色?',Alist:{'A':'领导者','B':'执行者','C':'协调者','D':'创新者'} },
|
|
|
+ { title:'你更喜欢哪种娱乐方式?',Alist:{'A':'阅读书籍','B':'参加派对','C':'看电影','D':'运动健身'} }
|
|
|
+])
|
|
|
+
|
|
|
const curIndex = ref(0)
|
|
|
const curChoose = ref(null)
|
|
|
const chooseList = ref([]) // 选择的数组 AABCD
|
|
|
@@ -31,6 +35,13 @@ const chooseA = (key) =>{
|
|
|
chooseList.value[curIndex.value] = key
|
|
|
}
|
|
|
const nextFn = ()=>{
|
|
|
+ if(!chooseList.value[curIndex.value]){
|
|
|
+ uni.showToast({
|
|
|
+ title:'请先选择选项',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
if(curIndex.value < QList.value.length - 1){
|
|
|
curIndex.value += 1
|
|
|
}else{
|