|
@@ -10,8 +10,8 @@
|
|
|
<text v-if="bank.type==1">单选</text>
|
|
|
<text v-if="bank.type==2">多选</text>
|
|
|
<text v-if="bank.type==3">判断</text>
|
|
|
- <text v-if="bank.type==4">案例题</text>
|
|
|
- <text v-if="bank.type==5">简答题</text>
|
|
|
+ <text v-if="bank.type==4">案例</text>
|
|
|
+ <text v-if="bank.type==5">简答</text>
|
|
|
</view>
|
|
|
<text>{{bankIndex+1}}/{{questionList.length}}</text>
|
|
|
</view>
|
|
@@ -22,8 +22,8 @@
|
|
|
<rich-text :nodes="bank.content"></rich-text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="pad_8 titBox">
|
|
|
- <template v-if="bank.type == 1">
|
|
|
+ <template v-if="bank.type == 1">
|
|
|
+ <view class="pad_8 titBox no-margin">
|
|
|
<view v-if="!bank.ques">
|
|
|
<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
|
|
|
<view class="activeTI">{{ ast[index] }}</view>
|
|
@@ -48,9 +48,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
- <template v-if="bank.type == 2">
|
|
|
+ <template v-if="bank.type == 2">
|
|
|
+ <view class="pad_8 titBox no-margin">
|
|
|
<view v-if="!bank.ques">
|
|
|
<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
|
|
|
<view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
|
|
@@ -82,9 +84,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
- <template v-if="bank.type == 3">
|
|
|
+ <template v-if="bank.type == 3">
|
|
|
+ <view class="pad_8 titBox no-margin">
|
|
|
<view v-if="!bank.ques">
|
|
|
<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
|
|
|
<view class="activeTI">{{ ast[index] }}</view>
|
|
@@ -109,16 +113,18 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
|
|
|
- <!-- 简答题 -->
|
|
|
- <template v-if="bank.type == 5">
|
|
|
+ <!-- 简答题 -->
|
|
|
+ <template v-if="bank.type == 5">
|
|
|
+ <view class="pad_8 titBox">
|
|
|
<view class="ans">
|
|
|
<view class="ans_input" v-if="!bank.ques">
|
|
|
<view class="top flex">
|
|
|
- <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
|
|
|
- <view class="progress">0/4</view>
|
|
|
+ <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
|
|
|
+ <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
|
|
|
<view class="submit" @click="submitAns(bankIndex)" >确认答案</view>
|
|
|
</view>
|
|
|
<view class="textarea">
|
|
@@ -147,10 +153,12 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
- <!-- 案例题 -->
|
|
|
- <template v-if="bank.type == 4">
|
|
|
+ <!-- 案例题 -->
|
|
|
+ <template v-if="bank.type == 4">
|
|
|
+ <view class="pad_8 titBox">
|
|
|
<view class="tabs">
|
|
|
<view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
|
|
|
</view>
|
|
@@ -286,21 +294,30 @@
|
|
|
|
|
|
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
|
|
<view class="footer_btn" v-if="isContinue || !isHistory">
|
|
|
- <view class="collect"></view>
|
|
|
+ <view class="collect" :class="{ show: goodsId ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
|
|
|
+ <view v-if="collectList[bankIndex]">
|
|
|
+ <image src="/static/icon/collected.png" mode=""></image>
|
|
|
+ <view>取消收藏</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="!collectList[bankIndex]">
|
|
|
+ <image src="/static/icon/collect.png" mode=""></image>
|
|
|
+ <view>收藏</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="flex_center" @click="openFooterTab">
|
|
|
<view class="up-icon">
|
|
|
<image src="/static/up.png"></image>
|
|
|
</view>
|
|
|
答题卡
|
|
|
</view>
|
|
|
- <view class="collect show" @click="submit">
|
|
|
+ <view class="collect" :class="{ show: explain ? false : true }" @click="submit">
|
|
|
<view>
|
|
|
<image src="/static/jj.png" mode=""></image>
|
|
|
<view>交卷</view>
|
|
@@ -374,7 +391,44 @@ export default {
|
|
|
this.examRecordEdit();
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ /**
|
|
|
+ * @param {Object} state
|
|
|
+ * @param {Object} index
|
|
|
+ * 收藏
|
|
|
+ */
|
|
|
+ collect(state, index) {
|
|
|
+ if (!state) {
|
|
|
+ this.$api
|
|
|
+ .collectQuestion({
|
|
|
+ examId: this.id,
|
|
|
+ questionId: this.questionList[index].questionId,
|
|
|
+ goodsId: this.goodsId || ''
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$set(this.collectList, index, true);
|
|
|
+ uni.showToast({
|
|
|
+ title: '收藏成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ this.getCollectInfo(index)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$set(this.collectList, index, false);
|
|
|
+ uni.showToast({
|
|
|
+ title: '取消收藏成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ },
|
|
|
goodsQuestionList() {
|
|
|
//继续答题
|
|
|
if(this.isContinue || this.isHistory) {
|
|
@@ -474,13 +528,33 @@ export default {
|
|
|
})
|
|
|
|
|
|
this.questionList = res.data.data;
|
|
|
-
|
|
|
+ this.getCollectInfo(this.current);
|
|
|
console.log(this.questionList)
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param {Object} current
|
|
|
+ * 获取收藏信息
|
|
|
+ */
|
|
|
+ getCollectInfo(current) {
|
|
|
+ this.$api
|
|
|
+ .getCollectInfo({
|
|
|
+ examId: this.id,
|
|
|
+ questionId: this.questionList[current].questionId,
|
|
|
+ goodsId: this.goodsId
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == 500) {
|
|
|
+ this.$set(this.collectList, current, false);
|
|
|
+ } else if (res.data.code == 200) {
|
|
|
+ this.$set(this.collectList, current, res.data.data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* @param {Object} e单选点击
|
|
|
*/
|
|
@@ -1182,6 +1256,11 @@ export default {
|
|
|
background-color: #fff;
|
|
|
margin: 0rpx 8rpx 8rpx;
|
|
|
border-radius: 16rpx;
|
|
|
+
|
|
|
+ &.no-margin {
|
|
|
+ margin-top:-16rpx;
|
|
|
+ border-radius: 0 0 16rpx 16rpx;
|
|
|
+ }
|
|
|
}
|
|
|
.answer {
|
|
|
height: 80rpx;
|
|
@@ -1232,6 +1311,7 @@ export default {
|
|
|
|
|
|
.collect {
|
|
|
visibility: hidden;
|
|
|
+ width:100rpx;
|
|
|
|
|
|
&.show {
|
|
|
visibility: visible;
|