<view v-for="item,index of tilist" :key="item.id" v-if="index===isti" class="topic">
<view class="topic_1">
<view class="topic_1_1">{{item.id+1}}</view>
<view class="topic_1_2">/{{tilist.length}}</view>
</view>
<view class="topic_2">{{item.title}}</view>
<view @click="xuanbtn(i,index)" :class="i_d==index?'zhong':'wei'" v-for="(i,index) in item.xuan" :key="index" class="topic_3">{{i}}</view>
</view>
<view class="shagnxia">
<view @click="shangtibtn"><< 上一题</view>
<view v-show="chang==tilist.length?false:true" @click="xaitibtn">下一题 >></view>
<view v-show="chang==tilist.length?true:false" @click="querybtn" class="shagnxia_3">查看报告</view>
</view>
data() {
return {
tilist:[],
i_d:null,
isti:0,
chang:1,
}
},
onLoad() {
this.tilist=[{
id:0,
title:'去哪',
xuan:[
'A:说走就走',
'B:说去就去',
]
},
{
id:1,
title:'题1',
xuan:[
'A:哈哈',
'B:嘿嘿',
]
},{
id:2,
title:'草帽船长',
xuan:[
'A:路飞',
'B:索隆',
]
}]
},
methods: {
xuanbtn(val,index){
this.i_d=index
},
querybtn(){
uni.navigateTo({
url:'/pages/query/query'
})
},
shangtibtn(){
if(this.isti==0) return
this.isti--
this.chang--
},
xaitibtn(){
this.isti++
this.chang++
},
}