|
@@ -626,11 +626,24 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<view class="footer_btn">
|
|
<view class="footer_btn">
|
|
- <view class="collect">
|
|
|
|
|
|
+ <!-- <view class="collect">
|
|
<view v-if="collectList[bankIndex]">
|
|
<view v-if="collectList[bankIndex]">
|
|
<image src="/static/icon/collected.png" mode=""></image>
|
|
<image src="/static/icon/collected.png" mode=""></image>
|
|
<view>取消收藏</view>
|
|
<view>取消收藏</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view> -->
|
|
|
|
+ <view
|
|
|
|
+ class="collect show"
|
|
|
|
+ @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>
|
|
<view class="flex_center" @click="openFooterTab">
|
|
<view class="flex_center" @click="openFooterTab">
|
|
<view class="up-icon">
|
|
<view class="up-icon">
|
|
@@ -744,7 +757,7 @@
|
|
}}
|
|
}}
|
|
</view>
|
|
</view>
|
|
<view class="classFootsty" v-if="cgType === 6">
|
|
<view class="classFootsty" v-if="cgType === 6">
|
|
- <view class="btnsty btns1" @click="submit">立即交卷</view>
|
|
|
|
|
|
+ <view class="btnsty btns1" @click="submit()">立即交卷</view>
|
|
<view class="btnsty btns2" @click="showpopups = false">继续做题</view>
|
|
<view class="btnsty btns2" @click="showpopups = false">继续做题</view>
|
|
</view>
|
|
</view>
|
|
<view class="classFootsty" v-if="cgType === 7">
|
|
<view class="classFootsty" v-if="cgType === 7">
|
|
@@ -757,7 +770,7 @@
|
|
</view>
|
|
</view>
|
|
<view class="classFootsty" v-if="cgType === 9">
|
|
<view class="classFootsty" v-if="cgType === 9">
|
|
<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
|
|
<view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
|
|
- <view class="btnsty btns2" @click="submit">立即交卷</view>
|
|
|
|
|
|
+ <view class="btnsty btns2" @click="submit()">立即交卷</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-popup>
|
|
</u-popup>
|
|
@@ -1367,6 +1380,8 @@ export default {
|
|
if (this.needPhoto && !this.isTakePhoto) {
|
|
if (this.needPhoto && !this.isTakePhoto) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ this.submit('leaveNow')
|
|
|
|
+ return
|
|
let score = 0; //计算总分
|
|
let score = 0; //计算总分
|
|
let reportStatus = 0;
|
|
let reportStatus = 0;
|
|
let number = 0;
|
|
let number = 0;
|
|
@@ -1473,20 +1488,20 @@ export default {
|
|
|
|
|
|
this.$api
|
|
this.$api
|
|
.bankRecordEdit({
|
|
.bankRecordEdit({
|
|
- chapterId: this.chapterId || 0,
|
|
|
|
moduleId: this.moduleId || 0,
|
|
moduleId: this.moduleId || 0,
|
|
|
|
+ chapterId: this.chapterId || 0,
|
|
sectionId: this.sectionId || 0,
|
|
sectionId: this.sectionId || 0,
|
|
- examId: this.id,
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
|
|
+ gradeId: this.gradeId,
|
|
|
|
+ courseId: this.courseId,
|
|
orderGoodsId: this.orderGoodsId,
|
|
orderGoodsId: this.orderGoodsId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ examId: this.id,
|
|
recordId: this.recordId,
|
|
recordId: this.recordId,
|
|
- courseId: this.courseId,
|
|
|
|
reportStatus: reportStatus,
|
|
reportStatus: reportStatus,
|
|
rightQuestionNum: number,
|
|
rightQuestionNum: number,
|
|
doQuestionNum: doQuestionNum,
|
|
doQuestionNum: doQuestionNum,
|
|
status: 1,
|
|
status: 1,
|
|
doQuestionIds: doQuestionIds.join(","),
|
|
doQuestionIds: doQuestionIds.join(","),
|
|
- gradeId: this.gradeId,
|
|
|
|
performance: score,
|
|
performance: score,
|
|
totalScore: allScore,
|
|
totalScore: allScore,
|
|
type: this.examType,
|
|
type: this.examType,
|
|
@@ -1509,6 +1524,8 @@ export default {
|
|
*/
|
|
*/
|
|
examRecordEdit() {
|
|
examRecordEdit() {
|
|
if (!this.isSubmit) {
|
|
if (!this.isSubmit) {
|
|
|
|
+ this.submit('leave')
|
|
|
|
+ return
|
|
let number = 0;
|
|
let number = 0;
|
|
let score = 0;
|
|
let score = 0;
|
|
let doQuestionNum = 0;
|
|
let doQuestionNum = 0;
|
|
@@ -1603,14 +1620,14 @@ export default {
|
|
|
|
|
|
this.$api
|
|
this.$api
|
|
.bankRecordEdit({
|
|
.bankRecordEdit({
|
|
- chapterId: this.chapterId || 0,
|
|
|
|
moduleId: this.moduleId || 0,
|
|
moduleId: this.moduleId || 0,
|
|
|
|
+ chapterId: this.chapterId || 0,
|
|
sectionId: this.sectionId || 0,
|
|
sectionId: this.sectionId || 0,
|
|
gradeId: this.gradeId,
|
|
gradeId: this.gradeId,
|
|
- examId: this.id,
|
|
|
|
courseId: this.courseId,
|
|
courseId: this.courseId,
|
|
orderGoodsId: this.orderGoodsId,
|
|
orderGoodsId: this.orderGoodsId,
|
|
goodsId: this.goodsId,
|
|
goodsId: this.goodsId,
|
|
|
|
+ examId: this.id,
|
|
recordId: this.recordId,
|
|
recordId: this.recordId,
|
|
lessQuestionNum:lessQuestionNum,
|
|
lessQuestionNum:lessQuestionNum,
|
|
performance: score,
|
|
performance: score,
|
|
@@ -1789,7 +1806,7 @@ export default {
|
|
|
|
|
|
this.questionList = res.data.data;
|
|
this.questionList = res.data.data;
|
|
this.lastCount = this.questionList.length;
|
|
this.lastCount = this.questionList.length;
|
|
-
|
|
|
|
|
|
+ this.getCollectInfo(this.current)
|
|
await this.examRecord();
|
|
await this.examRecord();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -2026,15 +2043,73 @@ export default {
|
|
this.showDialog = false;
|
|
this.showDialog = false;
|
|
},
|
|
},
|
|
changeIndex(index) {
|
|
changeIndex(index) {
|
|
- console.log('点击变化', index)
|
|
|
|
this.current = index;
|
|
this.current = index;
|
|
},
|
|
},
|
|
|
|
|
|
swiperChange(e) {
|
|
swiperChange(e) {
|
|
- console.log('切换', e.detail.current, this.questionList.length)
|
|
|
|
this.current = e.detail.current;
|
|
this.current = e.detail.current;
|
|
|
|
+ this.getCollectInfo(this.current)
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @param {Object} current
|
|
|
|
+ * 获取收藏信息
|
|
|
|
+ */
|
|
|
|
+ getCollectInfo(current) {
|
|
|
|
+ this.$api
|
|
|
|
+ .getCollectInfo({
|
|
|
|
+ examId: this.id,
|
|
|
|
+ questionId: this.questionList[current].questionId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ })
|
|
|
|
+ .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} state
|
|
|
|
+ * @param {Object} index
|
|
|
|
+ * 收藏
|
|
|
|
+ */
|
|
|
|
+ collect(state, index) {
|
|
|
|
+ if (!state) {
|
|
|
|
+ this.$api.collectQuestion({
|
|
|
|
+ examId: this.id,
|
|
|
|
+ questionId: this.questionList[index].questionId,
|
|
|
|
+ goodsId: this.goodsId || "",
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ })
|
|
|
|
+ .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;
|
|
},
|
|
},
|
|
-
|
|
|
|
pdsubmit() {
|
|
pdsubmit() {
|
|
let ansCount = this.questionOverNum(true); //已答题数
|
|
let ansCount = this.questionOverNum(true); //已答题数
|
|
this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
@@ -2071,7 +2146,8 @@ export default {
|
|
/**
|
|
/**
|
|
* 交卷
|
|
* 交卷
|
|
*/
|
|
*/
|
|
- submit() {
|
|
|
|
|
|
+ submit(typesubmit) {
|
|
|
|
+ console.log('交卷', typesubmit)
|
|
let score = 0; //计算总分
|
|
let score = 0; //计算总分
|
|
let reportStatus = 0;
|
|
let reportStatus = 0;
|
|
let number = 0; //做对的题目数量
|
|
let number = 0; //做对的题目数量
|
|
@@ -2227,16 +2303,17 @@ export default {
|
|
recordId: this.recordId,
|
|
recordId: this.recordId,
|
|
courseId: this.courseId,
|
|
courseId: this.courseId,
|
|
rightQuestionNum: number,
|
|
rightQuestionNum: number,
|
|
|
|
+ lessQuestionNum: lessQuestionNum,
|
|
status: 1,
|
|
status: 1,
|
|
doQuestionIds: doQuestionIds.join(","),
|
|
doQuestionIds: doQuestionIds.join(","),
|
|
- // rightQuestionIds:rightQuestionIds.join(','),
|
|
|
|
- // doQuestionNum: doQuestionNum,
|
|
|
|
|
|
+ rightQuestionIds: rightQuestionIds.join(','),
|
|
|
|
+ doQuestionNum: doQuestionNum,
|
|
performance: score,
|
|
performance: score,
|
|
totalScore: allScore,
|
|
totalScore: allScore,
|
|
type: this.examType,
|
|
type: this.examType,
|
|
- // examTime: parseInt(this.allTimes),
|
|
|
|
- // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
|
- // historyExamJson: JSON.stringify(this.questionList)
|
|
|
|
|
|
+ examTime: parseInt(this.allTimes),
|
|
|
|
+ doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
|
|
|
|
+ historyExamJson: JSON.stringify(this.questionList)
|
|
})
|
|
})
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.isSubmit = true;
|
|
this.isSubmit = true;
|
|
@@ -2247,7 +2324,8 @@ export default {
|
|
mask: true,
|
|
mask: true,
|
|
icon: "none",
|
|
icon: "none",
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ if (!typesubmit) {
|
|
|
|
+ console.log('跳转----')
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
url:
|
|
url:
|
|
@@ -2263,11 +2341,30 @@ export default {
|
|
reportStatus +
|
|
reportStatus +
|
|
"&lessQuestionNum=" +
|
|
"&lessQuestionNum=" +
|
|
lessQuestionNum +
|
|
lessQuestionNum +
|
|
- "&examId=" + this.id
|
|
|
|
|
|
+ "&examId=" + this.id + '&recordId=' + this.recordId + '&type=' + this.examType + '&orderGoodsId='+ this.orderGoodsId,
|
|
});
|
|
});
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ //错题集id提交(客观题)
|
|
|
|
+ this.$api
|
|
|
|
+ .examWrongRecord({
|
|
|
|
+ moduleId: this.moduleId || 0,
|
|
|
|
+ chapterId: this.chapterId || 0,
|
|
|
|
+ sectionId: this.sectionId || 0,
|
|
|
|
+ gradeId: this.gradeId,
|
|
|
|
+ courseId: this.courseId,
|
|
|
|
+ examId: this.id,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ questionIds: doWrongQuestionIds,
|
|
|
|
+ recordId: this.recordId,
|
|
|
|
+ type: 2, // 视频课程的传2
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {})
|
|
|
|
+ .catch((err) => {})
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|