|
@@ -852,7 +852,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {mapGetters,mapActions} from 'vuex'
|
|
export default {
|
|
export default {
|
|
|
|
+ computed:{
|
|
|
|
+ ...mapGetters(['sysTime']),
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
subscribeId:0,
|
|
subscribeId:0,
|
|
@@ -886,14 +890,20 @@ export default {
|
|
normal:'',
|
|
normal:'',
|
|
isAutoSubmit:false,
|
|
isAutoSubmit:false,
|
|
cgType: 0, //对应设计稿弹窗编码
|
|
cgType: 0, //对应设计稿弹窗编码
|
|
|
|
+ examStartTime:0,
|
|
|
|
+ examEndTime:0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async onLoad(option) {
|
|
async onLoad(option) {
|
|
console.log(option)
|
|
console.log(option)
|
|
|
|
+
|
|
|
|
+ this.examStartTime = option.examStartTime;
|
|
|
|
+ this.examEndTime = option.examEndTime;
|
|
this.subscribeId = option.subscribeId || ''
|
|
this.subscribeId = option.subscribeId || ''
|
|
this.current = +option.current || 0;
|
|
this.current = +option.current || 0;
|
|
this.eachExamId = option.eachExamId
|
|
this.eachExamId = option.eachExamId
|
|
this.examId = option.examId;
|
|
this.examId = option.examId;
|
|
|
|
+ this.allTimes = this.examEndTime - this.examStartTime || "";
|
|
let isBack = option.isback;
|
|
let isBack = option.isback;
|
|
|
|
|
|
let showDialog = uni.getStorageSync("showDialog");
|
|
let showDialog = uni.getStorageSync("showDialog");
|
|
@@ -914,7 +924,7 @@ export default {
|
|
this[k] = globalData.bankData[k];
|
|
this[k] = globalData.bankData[k];
|
|
}
|
|
}
|
|
this.showArrow = true;
|
|
this.showArrow = true;
|
|
-
|
|
|
|
|
|
+
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
if (this.lastTime <= 0) {
|
|
if (this.lastTime <= 0) {
|
|
clearInterval(this.timer);
|
|
clearInterval(this.timer);
|
|
@@ -935,6 +945,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
//进入页面
|
|
//进入页面
|
|
// await this.bankExam();
|
|
// await this.bankExam();
|
|
|
|
+ await this.setSystemTime()
|
|
this.goodsQuestionList();
|
|
this.goodsQuestionList();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -956,7 +967,9 @@ export default {
|
|
this.eachExamId +
|
|
this.eachExamId +
|
|
"&isback=true"+
|
|
"&isback=true"+
|
|
"&subscribeId="+
|
|
"&subscribeId="+
|
|
- this.subscribeId
|
|
|
|
|
|
+ this.subscribeId+
|
|
|
|
+ '&examStartTime='+this.examStartTime+
|
|
|
|
+ '&examEndTime='+this.examEndTime
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
//点击返回按钮确认允许退出,记录答题记录
|
|
//点击返回按钮确认允许退出,记录答题记录
|
|
@@ -966,6 +979,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapActions(['setSystemTime']),
|
|
/**
|
|
/**
|
|
* 是否有上传图片
|
|
* 是否有上传图片
|
|
*/
|
|
*/
|
|
@@ -1511,28 +1525,32 @@ export default {
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.allTimes = res.data.data[0].answerTime * 60;
|
|
|
|
- this.lastTime =
|
|
|
|
- res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
|
|
|
|
- //考试时间到了自动交卷
|
|
|
|
- if (this.lastTime) {
|
|
|
|
- this.timer = setInterval(() => {
|
|
|
|
- if (this.lastTime <= 0) {
|
|
|
|
- clearInterval(this.timer);
|
|
|
|
- uni.showToast({
|
|
|
|
- icon: "none",
|
|
|
|
- mask: true,
|
|
|
|
- title: "考试时间已到,系统将自动交卷",
|
|
|
|
- duration: 10000,
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- this.submit();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this.lastTime--;
|
|
|
|
- }, 1000);
|
|
|
|
- } else {
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ if (this.subscribeId) {
|
|
|
|
+ this.lastTime = this.examEndTime - this.sysTime;
|
|
|
|
+ //考试时间到了自动交卷
|
|
|
|
+ if (this.lastTime) {
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
|
+ clearInterval(this.timer);
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ mask: true,
|
|
|
|
+ title: "考试时间已到,系统将自动交卷",
|
|
|
|
+ duration: 5000,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.isAutoSubmit = true;
|
|
|
|
+
|
|
|
|
+ this.submit();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.lastTime--;
|
|
|
|
+ }, 1000);
|
|
|
|
+ } else {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
res.data.data.forEach((item, index) => {
|
|
res.data.data.forEach((item, index) => {
|
|
// if (typeof item.jsonStr == 'string') {
|
|
// if (typeof item.jsonStr == 'string') {
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|