From 2e6f381d09669635473faf5dd4a3f01b5797d97e Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期一, 27 五月 2024 16:25:09 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- h5/pages/answer/answer.vue | 83 +++++++++++++++-------------------------- 1 files changed, 30 insertions(+), 53 deletions(-) diff --git a/h5/pages/answer/answer.vue b/h5/pages/answer/answer.vue index 9b2c532..89aaf04 100644 --- a/h5/pages/answer/answer.vue +++ b/h5/pages/answer/answer.vue @@ -1,8 +1,8 @@ <template> <view class="box"> <view class="box_bgimage" :style="{backgroundImage: 'url(' + bg + ')'}"> - <text class="box_bgimage_a">璁垮闂嵎灏忚皟鐮�</text> - <text class="box_bgimage_b">绛旈鍒嗗�奸渶瑕佽揪鍒�30鍒嗘墠鑳界敵璇疯闂摝锝�</text> + <text class="box_bgimage_a">{{ title }}</text> + <text class="box_bgimage_b">{{ content }}</text> </view> <view class="box_list"> <view class="box_list_answer" v-if="list && list.length > 0"> @@ -19,21 +19,27 @@ </template> --> <!-- 鍗曢�� --> <view v-for="(item,index) in list" :key="index" class="list_item"> - <view class="box_list_answer_name"> - {{index + 1}}銆亄{item.title}} + <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_item" v-for="(line, lIndex) in item.options" :key="lIndex" @click="select(index)"> - <image src="@/static/video_error@2x.png" /> - <image src="@/static/video@2x.png" /> - <image src="@/static/video_sel@2x.png" /> - <text style="color: rgba(237, 69, 69, 1)" >{{line.code}} {{line.value}}</text> - <text >{{line.code}} {{line.value}}</text> - <text style="color: rgba(2, 94, 239, 1)" >{{line.code}} {{line.value}}</text> + <view class="box_list_answer_item" v-for="(line, lIndex) in item.options" :key="lIndex" @click="select(line, index)"> + <image src="@/static/video@2x.png" v-if="!item.selAnswer || item.selAnswer !== line.code" /> + <image src="@/static/video_sel@2x.png" v-if="item.selAnswer && item.selAnswer == line.code && item.answer === item.selAnswer" /> + <image src="@/static/video_error@2x.png" v-if="item.selAnswer && item.selAnswer == line.code && item.answer !== item.selAnswer" /> + <text v-if="!item.selAnswer"><text class="mr24">{{line.code}}</text> {{line.value}}</text> + <text v-if="item.selAnswer && item.answer === item.selAnswer" 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" 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="success"> + <view class="box_list_answer_tips" v-if="item.selAnswer && item.answer !== item.selAnswer"> <image src="@/static/ic_wrong@2x.png" /> <text>鍥炵瓟閿欒</text> </view> + <view class="box_list_answer_tips" v-if="item.selAnswer && item.answer === item.selAnswer"> + <image src="@/static/meeting/icon/ic_choose_sel@2x.png" /> + <text>鍥炵瓟姝g‘</text> + </view> + </template> </view> <view class="empty"></view> <view class="box_list_answer_btn" @click="next()">鎻愪氦</view> @@ -66,42 +72,7 @@ data() { return { - i: 0, - problemIndex: 0, - multiple: null, - success: true, - list: [ - { - type: '1', - title: '绗竴棰�', - options: [ - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - ] - }, - { - type: '1', - title: '绗竴棰�', - options: [ - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - ] - }, - { - type: '1', - title: '绗竴棰�', - options: [ - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - { code: '骞村垔', value: '111111' }, - ] - } - ], + list: [], bg: require("@/static/banner_dati.jpg"), title: '', content: '' @@ -109,7 +80,7 @@ }, onLoad() { - // this.getProblems() + this.getProblems() this.getInfo() }, @@ -147,9 +118,11 @@ if (item.type === 1 || item.type === 2) { item.options = JSON.parse(item.options) } + item.status = '0' + item.selAnswer = null }) + console.log('options', res.data); this.list = res.data - console.log(this.list) } // res.param.problemsDOList.forEach(item => { // item.options = JSON.parse(item.options) @@ -159,9 +132,13 @@ }) }, // 鍗曢�夐�夋嫨涓鐩� - select(index) { - console.log(index) - this.problemIndex = index + select(line, i) { + this.list.forEach((item,index)=>{ + if(index === i){ + item.selAnswer = line.code + } + }) + // this.problemIndex = index }, sort(arr) { arr.sort(function(a, b) { -- Gitblit v1.9.3