| | |
| | | </view> |
| | | <view class="box_list"> |
| | | <view class="box_list_answer" v-if="list && list.length > 0"> |
| | | <!-- 判断 --> |
| | | <!-- <template v-if="list[i].type === 0"> |
| | | <view class="box_list_answer_item" v-for="(item, index) in list[i].options" :key="index" @click="select(index)"> |
| | | <image src="@/static/video_error@2x.png" v-if="success && problemIndex === index" /> |
| | | <image src="@/static/video@2x.png" v-else-if="!String(problemIndex) || problemIndex !== index" /> |
| | | <image src="@/static/video_sel@2x.png" v-else-if="problemIndex === index" /> |
| | | <text style="color: rgba(237, 69, 69, 1)" v-if="success && problemIndex === index">{{item.code}}</text> |
| | | <text v-else-if="!String(problemIndex) || problemIndex !== index">{{item.code}}</text> |
| | | <text style="color: rgba(2, 94, 239, 1)" v-else-if="problemIndex === index">{{item.code}}</text> |
| | | </view> |
| | | </template> --> |
| | | <!-- 单选 --> |
| | | <!-- 单选/判断 --> |
| | | <view v-for="(item, index) in list" :key="index" class="list_item"> |
| | | <template v-if="item.type == 1"> |
| | | <view class="box_list_answer_name"> |
| | | {{ index + 1 }}、{{ item.title |
| | | }}<text style="color: #ed4545">*</text> |
| | | </view> |
| | | <view class="box_list_answer_name"> |
| | | {{ index + 1 }}、{{ item.title |
| | | }}<text style="color: #ed4545">*</text> |
| | | </view> |
| | | <template v-if="item.type == 1 || item.type == 0"> |
| | | <view |
| | | class="box_list_answer_item" |
| | | v-for="(line, lIndex) in item.options" |
| | |
| | | </view> |
| | | <view |
| | | class="box_list_answer_tips" |
| | | v-if="item.selAnswer && item.answer !== item.selAnswer && status != '0'" |
| | | v-if=" |
| | | item.selAnswer && |
| | | item.answer !== item.selAnswer && |
| | | status != '0' |
| | | " |
| | | > |
| | | <image src="@/static/ic_wrong@2x.png" /> |
| | | <text>回答错误</text> |
| | | </view> |
| | | <view |
| | | class="box_list_answer_tips" |
| | | v-if="item.selAnswer && item.answer === item.selAnswer && status != '0'" |
| | | v-if=" |
| | | item.selAnswer && |
| | | item.answer === item.selAnswer && |
| | | status != '0' |
| | | " |
| | | > |
| | | <image src="@/static/meeting/icon/ic_choose_sel@2x.png" /> |
| | | <text>回答正确</text> |
| | | </view> |
| | | </template> |
| | | <template v-if="item.type == 2"> |
| | | <view |
| | | class="box_list_answer_item" |
| | | v-for="(line, lIndex) in item.options" |
| | | :key="lIndex" |
| | | @click="changeBox(index, lIndex)" |
| | | > |
| | | <image src="@/static/checkbox@2x.png" v-if="!line.checked" /> |
| | | <image |
| | | src="@/static/checkbo1x_sel@2x.png" |
| | | v-if="line.checked || (item.selAnswer === item.answer && line.checked)" |
| | | /> |
| | | <image |
| | | src="@/static/checkbox_wrong@2x.png" |
| | | v-if=" |
| | | line.checked && |
| | | item.selAnswer !== item.answer && |
| | | status == '2' |
| | | " |
| | | /> |
| | | <text v-if="!item.selAnswer || item.selAnswer !== line.code" |
| | | ><text class="mr24">{{ line.code }}</text> |
| | | {{ line.value }}</text |
| | | > |
| | | <text |
| | | v-if=" |
| | | (item.selAnswer && |
| | | item.answer === item.selAnswer && |
| | | item.selAnswer == line.code) || |
| | | item.selAnswer == line.code |
| | | " |
| | | style="color: rgba(2, 94, 239, 1)" |
| | | ><text class="mr24" style="color: rgba(2, 94, 239, 1)">{{ |
| | | line.code |
| | | }}</text> |
| | | {{ line.value }}</text |
| | | > |
| | | <text |
| | | v-if=" |
| | | item.selAnswer && |
| | | item.answer !== item.selAnswer && |
| | | status == '2' |
| | | " |
| | | style="color: rgba(237, 69, 69, 1)" |
| | | ><text class="mr24" style="color: rgba(237, 69, 69, 1)">{{ |
| | | line.code |
| | | }}</text> |
| | | {{ line.value }}</text |
| | | > |
| | | </view> |
| | | <view |
| | | class="box_list_answer_tips" |
| | | v-if=" |
| | | item.selAnswer && |
| | | item.answer !== item.selAnswer && |
| | | status != '0' |
| | | " |
| | | > |
| | | <image src="@/static/ic_wrong@2x.png" /> |
| | | <text>回答错误</text> |
| | | </view> |
| | | <view |
| | | class="box_list_answer_tips" |
| | | v-if=" |
| | | item.selAnswer && |
| | | item.answer === item.selAnswer && |
| | | status != '0' |
| | | " |
| | | > |
| | | <image src="@/static/meeting/icon/ic_choose_sel@2x.png" /> |
| | | <text>回答正确</text> |
| | |
| | | res.data.forEach(item => { |
| | | // 判断 |
| | | if (item.type === 0) { |
| | | item.options = [{ code: '正确', value: '正确' }, { code: '错误', value: '错误' }] |
| | | item.options = [{ code: '正确' }, { code: '错误' }] |
| | | } |
| | | // 单选/多选 |
| | | if (item.type === 1 || item.type === 2) { |
| | | item.options = JSON.parse(item.options) |
| | | } |
| | | if (item.type === 2) { |
| | | item.options.forEach(i => { |
| | | i.checked = false |
| | | }) |
| | | } |
| | | item.status = '0' |
| | | item.selAnswer = null |
| | | }) |
| | | console.log('options', res.data) |
| | | console.log(res.data) |
| | | this.list = res.data |
| | | } |
| | | // res.param.problemsDOList.forEach(item => { |
| | |
| | | } |
| | | }) |
| | | // this.problemIndex = index |
| | | }, |
| | | changeBox(index, jeck) { |
| | | this.list.forEach((item, i) => { |
| | | if (index === i) { |
| | | item.options.forEach((item2, j) => { |
| | | if(j === jeck){ |
| | | item2.checked = !item2.checked |
| | | } |
| | | }) |
| | | item.selAnswer = item.options.filter(a => a.checked).map(b => b.code).sort().join(',') |
| | | } |
| | | }) |
| | | }, |
| | | sort(arr) { |
| | | arr.sort(function (a, b) { |
| | |
| | | } |
| | | } |
| | | .list_item { |
| | | margin-bottom: 24rpx; |
| | | margin-bottom: 46rpx; |
| | | } |
| | | .box_list_answer_item { |
| | | width: 100%; |