qa-education-exam-weapp/pages/mine/survey/question.wxml

54 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2026-04-17 16:26:28 +08:00
<wxs module="tool" src="../../../utils/util.wxs"></wxs>
<view class="content">
<view class="question-info">
<view class="container">
<van-tag type="primary" size="small">
<block wx:if="{{topic[current].QUESTIONTYPE === '1'}}">单选题</block>
<block wx:if="{{topic[current].QUESTIONTYPE === '2'}}">多选题</block>
<block wx:if="{{topic[current].QUESTIONTYPE === '3'}}">问答题</block>
</van-tag>
<text class="index">{{current + 1}}.</text>
<text class="stem">{{topic[current].QUESTIONDRY}}</text>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '1'}}">
<view class="option" bind:tap="chooseTopic" wx:for="{{topic[current].itemList}}" data-type="radio" data-check="{{item.OPTIONDES}}" data-itemid="{{item.ITEM_ID}}">
<!--单选样式-->
<text class="choice {{topic[current].CHECK === item.OPTIONDES ? 'check' : ''}}">{{index + 1}}</text>
<text class="title">{{item.OPTIONDES}}</text>
</view>
</view>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '2'}}">
<view class="option" bind:tap="chooseTopic" wx:for="{{topic[current].itemList}}" data-type="multiple" data-check="{{item.OPTIONDES}}" data-itemid="{{item.ITEM_ID}}">
<!--多选样式-->
<text class="choice {{tool.indexOf(topic[current].CHECK,item.OPTIONDES) !== -1 ? 'check' : ''}}">{{index + 1}}</text>
<text class="title">{{item.OPTIONDES}}</text>
</view>
</view>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '3'}}">
<view class="option">
<van-field value="{{ topic[current].ANSWER }}" placeholder="请输入答案" border="{{ true }} " bind:change="onChange" data-index="{{ current }}" />
</view>
</view>
</view>
<view class="button">
<van-button color="#d0d0d2" custom-style="color:#000;border-radius: 10rpx;width:{{current === topic.length - 1 ? 630 : 280}}rpx;" size="large" wx:if="{{current !== 0}}" bind:click="previousQuestion">
上一题
</van-button>
<van-button type="info" custom-style="border-radius: 10rpx;width:{{current === 0 ? 630 : 280}}rpx;" size="large" wx:if="{{current !== topic.length - 1}}" bind:click="nextQuestion">
下一题
</van-button>
</view>
</view>
<view class="footer">
<van-button color="linear-gradient(to right, #00ccff, #3676f2)" round size="small" bind:click="submitPapers">
提交问卷
</van-button>
<view class="surplus">
<!-- <van-icon name="../../../assets/images/fenlei.png" /> -->
<view class="ml-10">
<text class="text-blue">{{current + 1}} </text>
<text>/ {{topic.length}}</text>
</view>
</view>
</view>
<van-dialog id="nation"></van-dialog>
</view>