|
@@ -22,6 +22,7 @@
|
|
|
></image>
|
|
|
</view>
|
|
|
<!-- 单选 -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
<view
|
|
|
v-if="
|
|
|
problemList[problemListIndex].questionType < 3 &&
|
|
@@ -89,7 +90,9 @@
|
|
|
<text class="problem-opAnswer">{{ item.value }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- #endif -->
|
|
|
<!-- 多选 -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
<view
|
|
|
v-if="
|
|
|
problemList[problemListIndex].questionType == 3 &&
|
|
@@ -170,6 +173,144 @@
|
|
|
<text class="problem-opAnswer">{{ item.value }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <!-- #endif -->
|
|
|
+
|
|
|
+ <!-- 单选 -->
|
|
|
+ <!-- #ifdef MP-TOUTIAO -->
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType < 3 &&
|
|
|
+ !problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ class="problem-ops"
|
|
|
+ >
|
|
|
+ <m-radio-group
|
|
|
+ @change="changeRadioGroup"
|
|
|
+ :value.sync="problemList[problemListIndex].userAnswer"
|
|
|
+ >
|
|
|
+ <m-radio
|
|
|
+ :value="item.value"
|
|
|
+ :item="item"
|
|
|
+ :useIconSlot="true"
|
|
|
+ :key="index"
|
|
|
+ :name="numberToLetter(index)"
|
|
|
+ v-for="(item, index) in problemList[problemListIndex].optsArr"
|
|
|
+ >
|
|
|
+ </m-radio>
|
|
|
+ </m-radio-group>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType < 3 &&
|
|
|
+ problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in problemList[problemListIndex].optsArr"
|
|
|
+ :key="index"
|
|
|
+ class="problem-select"
|
|
|
+ >
|
|
|
+ <icon
|
|
|
+ v-if="item.isAnswer && item.selected"
|
|
|
+ class="icon-box-img"
|
|
|
+ type="success"
|
|
|
+ color="#06c05f"
|
|
|
+ size="37"
|
|
|
+ ></icon>
|
|
|
+ <icon
|
|
|
+ v-if="!item.isAnswer && item.selected"
|
|
|
+ class="icon-box-img"
|
|
|
+ type="clear"
|
|
|
+ size="37"
|
|
|
+ ></icon>
|
|
|
+ <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
|
|
|
+ numberToLetter(index)
|
|
|
+ }}</text>
|
|
|
+ <text
|
|
|
+ v-if="item.isAnswer && !item.selected"
|
|
|
+ class="problem-op_green"
|
|
|
+ >{{ numberToLetter(index) }}</text
|
|
|
+ >
|
|
|
+ <text class="problem-opAnswer">{{ item.value }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- #endif -->
|
|
|
+
|
|
|
+ <!-- 多选 -->
|
|
|
+ <!-- #ifdef MP-TOUTIAO -->
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType == 3 &&
|
|
|
+ !problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ class="problem-ops"
|
|
|
+ >
|
|
|
+ <van-checkbox-group
|
|
|
+ @change="changeCheckGroup"
|
|
|
+ :value="problemList[problemListIndex].userAnswer"
|
|
|
+ :max="4"
|
|
|
+ >
|
|
|
+ <m-checkbox
|
|
|
+ @change="changeCheckbox"
|
|
|
+ :item="item"
|
|
|
+ :value="item.value"
|
|
|
+ class="problem-checkbox"
|
|
|
+ use-icon-slot
|
|
|
+ v-for="(item, index) in problemList[problemListIndex].optsArr"
|
|
|
+ :key="index"
|
|
|
+ :name="numberToLetter(index)"
|
|
|
+ >
|
|
|
+
|
|
|
+ </m-checkbox>
|
|
|
+ </van-checkbox-group>
|
|
|
+ <view class="flex-center">
|
|
|
+ <van-button
|
|
|
+ @click="confirmMult"
|
|
|
+ color="#498ef5"
|
|
|
+ round
|
|
|
+ custom-style="width:600rpx"
|
|
|
+ type="primary"
|
|
|
+ >确定</van-button
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType == 3 &&
|
|
|
+ problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in problemList[problemListIndex].optsArr"
|
|
|
+ :key="index"
|
|
|
+ class="problem-select"
|
|
|
+ >
|
|
|
+ <icon
|
|
|
+ v-if="item.isAnswer && item.selected"
|
|
|
+ class="icon-box-img"
|
|
|
+ type="success"
|
|
|
+ size="75rpx"
|
|
|
+ ></icon>
|
|
|
+ <icon
|
|
|
+ v-if="!item.isAnswer && item.selected"
|
|
|
+ class="icon-box-img"
|
|
|
+ type="cancel"
|
|
|
+ size="75rpx"
|
|
|
+ ></icon>
|
|
|
+ <text v-if="!item.isAnswer && !item.selected" class="problem-op">{{
|
|
|
+ numberToLetter(index)
|
|
|
+ }}</text>
|
|
|
+ <text
|
|
|
+ v-if="item.isAnswer && !item.selected"
|
|
|
+ class="problem-op_green"
|
|
|
+ >{{ numberToLetter(index) }}</text
|
|
|
+ >
|
|
|
+ <text class="problem-opAnswer">{{ item.value }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- #endif -->
|
|
|
<view class="function-list">
|
|
|
<div class="function-item">
|
|
|
<van-icon name="star-o" size="25px" />
|
|
@@ -326,6 +467,10 @@ import api from "@/api/index";
|
|
|
import utils from "@/utils/index";
|
|
|
import explainJs from "./components/explainJs.vue";
|
|
|
import tabbar from "./components/tabbar.vue";
|
|
|
+import mRadio from "./components/m-radio.vue";
|
|
|
+import mRadioGroup from "./components/m-radio-group.vue";
|
|
|
+import mCheckbox from "./components/m-radio.vue";
|
|
|
+import mCheckboxGroup from './components/m-checkbox-group.vue'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -613,17 +758,18 @@ export default {
|
|
|
this.$set(
|
|
|
this.problemList[this.problemListIndex],
|
|
|
"userAnswer",
|
|
|
- e.value
|
|
|
+ e.detail.value
|
|
|
);
|
|
|
- e.selected = true;
|
|
|
+ e.detail.selected = true;
|
|
|
this.$set(
|
|
|
this.problemList[this.problemListIndex].optsArr,
|
|
|
- e.index,
|
|
|
- e
|
|
|
+ e.detail.index,
|
|
|
+ e.detail
|
|
|
);
|
|
|
- e.value === this.problemList[this.problemListIndex].answer
|
|
|
+ e.detail.value === this.problemList[this.problemListIndex].answer
|
|
|
? (this.trueNum = this.trueNum + 1)
|
|
|
: (this.falseNum = this.falseNum + 1);
|
|
|
+
|
|
|
//#endif
|
|
|
},
|
|
|
changeCheckbox(e) {
|
|
@@ -691,6 +837,10 @@ export default {
|
|
|
navBar,
|
|
|
explainJs,
|
|
|
tabbar,
|
|
|
+ mRadio,
|
|
|
+ mRadioGroup,
|
|
|
+ mCheckbox,
|
|
|
+ mCheckboxGroup
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -761,7 +911,7 @@ export default {
|
|
|
}
|
|
|
.problem-box {
|
|
|
padding: 15rpx;
|
|
|
- padding-bottom: 50rpx;
|
|
|
+ padding-bottom: 70rpx;
|
|
|
background: #fff;
|
|
|
/deep/ .van-checkbox {
|
|
|
padding-bottom: 15rpx;
|