flx:提交安全考试系统bug 资料只需要学习一遍

This commit is contained in:
X_Rian 2024-07-23 15:53:49 +08:00
parent ebf1f6960e
commit 698f4cfc0b

View File

@ -44,7 +44,7 @@
</view> </view>
</view> </view>
<!-- || pageData.examCount<=0 --> <!-- || pageData.examCount<=0 -->
<button type="primary" :disabled="isStartExam || isPageLength.length > 0" class="btn" @click="goHiidden" <button type="primary" :disabled="isStartExam" class="btn" @click="goHiidden"
v-if="pageData.examPaperId">开始考试</button> v-if="pageData.examPaperId">开始考试</button>
<levitatedsphere :x="100" :y="80"></levitatedsphere> <levitatedsphere :x="100" :y="80"></levitatedsphere>
</view> </view>
@ -63,6 +63,7 @@
userInfo: "", userInfo: "",
responseData: {}, responseData: {},
isPageLength: 0, isPageLength: 0,
startFlag: true,
// isStartExam: false // isStartExam: false
} }
}, },
@ -71,6 +72,26 @@
const videoEvery = this.videoList.every(item => item.isVideoOver && item.controlsBool); const videoEvery = this.videoList.every(item => item.isVideoOver && item.controlsBool);
const dataEvery = this.dataList.every(item => item.isFileOver); const dataEvery = this.dataList.every(item => item.isFileOver);
console.log('计算属性执行了', this.videoList, this.dataList, videoEvery, dataEvery) console.log('计算属性执行了', this.videoList, this.dataList, videoEvery, dataEvery)
if(this.startFlag){
this.videoStartTime = this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss');
this.startFlag = false;
}
console.log(dataEvery && videoEvery && (this.videoList.length > 0 || this.dataList > 0))
if(dataEvery && videoEvery && (this.videoList.length > 0 || this.dataList > 0)){
let requestData = {
workerId: this.userInfo.id,
trainId: this.pageData.trainId,
beginTime: this.videoStartTime,
endTime: this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss')
}
this.sendRequest({
url: "xmgl/workerExam/submitStudy",
data: requestData,
method: 'post',
success(res) {}
})
}
return !(videoEvery && dataEvery); return !(videoEvery && dataEvery);
} }
}, },
@ -84,7 +105,6 @@
this.pageData = JSON.parse(options.transportData) this.pageData = JSON.parse(options.transportData)
console.log(this.pageData) console.log(this.pageData)
this.getDataFn(); this.getDataFn();
this.trainRecordId();
}, },
onShow() { onShow() {
// //
@ -160,7 +180,7 @@
}) })
}, },
videoStart(index) { videoStart(index) {
this.videoStartTime = this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss');
}, },
videoEnd(index) { videoEnd(index) {
var that = this var that = this
@ -183,18 +203,7 @@
// } else { // } else {
// that.isStartExam = false; // that.isStartExam = false;
// } // }
let requestData = {
workerId: this.userInfo.id,
trainId: this.pageData.trainId,
beginTime: this.videoStartTime,
endTime: this.$formatDates(new Date().getTime(), 'yyyy-MM-dd HH:mm:ss')
}
this.sendRequest({
url: "xmgl/workerExam/submitStudy",
data: requestData,
method: 'post',
success(res) {}
})
}, },
getDataFn() { getDataFn() {
var that = this var that = this
@ -217,17 +226,11 @@
console.log(result, that.videoList, that.dataList); console.log(result, that.videoList, that.dataList);
// that.videoList // that.videoList
// dataList // dataList
that.dataList.map(item => {
that.$set(item,'isFileOver',false)
})
that.videoList.map(item => {
that.$set(item,'isVideoOver',false)
that.$set(item,'controlsBool',false)
})
// if (that.videoList.length) { // if (that.videoList.length) {
// that.isStartExam = true; // that.isStartExam = true;
// that.videoUrl = that.videoList[0].url // that.videoUrl = that.videoList[0].url
// } // }
that.trainRecordId();
console.log(that.src) console.log(that.src)
} }
} }
@ -241,13 +244,14 @@
}, },
trainRecordId() { trainRecordId() {
var that = this var that = this
console.log(uni.getStorageSync('devInfoList').projectSn) const devInfoList = uni.getStorageSync('devInfoList')
let requestData = { let requestData = {
pageNo: 1, pageNo: 1,
pageSize: 1, pageSize: 10,
number: 1, number: 1,
trainId: this.pageData.trainRecordId, trainId: this.pageData.trainId,
projectSn: uni.getStorageSync('devInfoList').projectSn, workerCard: devInfoList.idCard,
projectSn: devInfoList.projectSn,
} }
this.sendRequest({ this.sendRequest({
url: "exam/courseRecord/page", url: "exam/courseRecord/page",
@ -255,8 +259,16 @@
method: 'post', method: 'post',
success(res) { success(res) {
if (res.code == 200) { if (res.code == 200) {
console.log(22222, res); that.isPageLength = res.result.records instanceof Array ? res.result.records.length : 0;
that.isPageLength = res.result.length; console.log(22222, res, that.isPageLength);
const isPageFlag = that.isPageLength > 0 ? true : false;
that.dataList.map(item => {
that.$set(item,'isFileOver',isPageFlag)
})
that.videoList.map(item => {
that.$set(item,'isVideoOver',isPageFlag)
that.$set(item,'controlsBool',isPageFlag)
})
} }
} }
}) })