Compare commits

..

2 Commits

Author SHA1 Message Date
wyw
4d41365727 Merge branch 'main' of http://121.41.2.71:3000/ykx/jy-safe-app 2026-04-02 14:27:36 +08:00
wyw
40210437ea 暂存 2026-04-02 14:27:25 +08:00

View File

@ -40,7 +40,7 @@
<u--input v-model="SelUsrNAME" disabled disabledColor="#fff" border="none"
inputAlign="right"></u--input>
</u-form-item>
<u-form-item label="成绩:" prop="score" borderBottom>
<u-form-item v-if="tableKey!=1" label="成绩:" prop="score" borderBottom>
<u--input v-model="score" disabled disabledColor="#fff" border="none"
inputAlign="right"></u--input>
</u-form-item>
@ -48,7 +48,7 @@
<uni-card margin="0" :is-shadow="true">
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" ref="wForm"
errorType="border-bottom">
<video id="myVideo" @ended="onEnd()" @timeupdate="onTimeUpdate" :src='this.filepath'
<video id="myVideo" @ended="onEnd" @timeupdate="onTimeUpdate" :src='this.filepath'
controls></video>
</u--form>
</uni-card>
@ -105,7 +105,9 @@
</view>
</u-sticky>
<view class="bottom-button">
<button type="primary" v-if="tableKey==1" @click="submit">{{this.btnText}}</button>
<button type="primary" style="width: 45%; float: left;" v-if="tableKey==1" @click="onTempSave">暂存</button>
<button type="primary" style="width: 45%; float: left; margin-left: 5px;" v-if="tableKey==1"
@click="submit">{{this.btnText}}</button>
</view>
</view>
</template>
@ -175,8 +177,10 @@
btnText: '提交', //''
perPaper: [], // wyw 20260306
listPath: [],
indexCour: -1 //
indexCour: -1, //
listViewInfo: [],
VIEWSEC: 0,
currSce: 0,
}
// https: //sps.cxtc.com:3199/BT/VIDEO/20251226/251226100216835841.mp4
// https: //sps.cxtc.com:3199/BT/VIDEO/20251226/12345.mp4
@ -262,11 +266,17 @@
let record = res.Nav_Papers[0].Nav_Record;
let notify = record ? record.Nav_Notify : null;
let hasAnswered = false;
for (let i = 0; i < res.Nav_Papers.length; i++) {
if (res.Nav_Papers[i].ANSWER !== 0) {
hasAnswered = true;
}
}
// for (let i = 0; i < res.Nav_Papers.length; i++) {
// if (res.Nav_Papers[i].ANSWER !== 0) {
// hasAnswered = true;
// }
// }
var check = res.Nav_Papers.filter(e => e.ANSWER == 0)
if (check != null || check.length > 0)
hasAnswered = false
else
hasAnswered = true
this.papers = papers;
this.papers.forEach(item => {
if (item.Nav_Test.TYPE == 2) {
@ -307,6 +317,7 @@
this.notify = notify;
this.readonly = hasAnswered;
this.score = this.papers[0].SCORE;
this.listViewInfo = res.ListViewInfo
if (this.isCourEdit) {
this.submit()
} else {
@ -493,40 +504,135 @@
this.filepath = this.listPath[this.indexCour]
this.perPaper = this.papers.filter(e => e.FILE_PATH == this.filepath)
var ISEND = true
var VIEWSEC = 0
if (this.listViewInfo != null && this.listViewInfo.length > 0 && this.perPaper != null &&
this.perPaper.length > 0) {
var checkV = this.listViewInfo.filter(e => e.EDU_CARD_ID == this.perPaper[0].EDU_CARD_ID)
if (checkV != null && checkV.length > 0) {
ISEND = checkV[0].ISEND
VIEWSEC = checkV[0].VIEWSEC
}
}
if (this.filepath.indexOf('/VIDEO/') > -1) {
this.isViedo = true
this.isVideoEnd = false
this.filepath = config.uni_app_web_video_source_url + this.filepath
this.filepathf = []
if (ISEND && VIEWSEC == 0) {
ISEND = false
}
} else if (this.filepath.indexOf('.mp4') > -1 || this.filepath
.indexOf('.avi') > -1) {
//
this.isViedo = true
this.isVideoEnd = false
if (ISEND) {
ISEND = false
}
// this.isVideoEnd = false
this.filepath = config.uni_app_web_source_url + this.filepath
this.filepathf = []
} else {
this.isViedo = false
this.isVideoEnd = true
// this.isVideoEnd = true
this.filepath = this.filepath
this.filepathf = getFileShow(this.filepath)
}
this.isVideoEnd = ISEND
this.VIEWSEC = VIEWSEC
}
},
onTimeUpdate(e) {
const currentTime = e.detail.currentTime;
if (Math.abs(e.detail.currentTime - this.VIEWSEC) < 1) {
this.lastTime = this.VIEWSEC
}
if (currentTime > this.lastTime + 1) {
uni.$showErrorInfo('禁止快进');
const videoContext = uni.createVideoContext('myVideo', this)
videoContext.seek(this.lastTime);
if (this.isVideoEnd || currentTime < this.VIEWSEC) {
} else {
uni.$showErrorInfo('禁止快进')
const videoContext = uni.createVideoContext('myVideo', this)
videoContext.seek(this.lastTime)
}
} else {
this.lastTime = currentTime;
}
this.currSce = currentTime
},
//
onEnd() {
onEnd(e) {
this.isVideoEnd = true
var check = this.listViewInfo.filter(e => e.EDU_CARD_ID == this.perPaper[0].EDU_CARD_ID)
if (check == null || check.length < 1) {
this.listViewInfo.push({
ID: guid(),
ORG_ID: this.perPaper[0].ORG_ID,
EDU_CARD_ID: this.perPaper[0].EDU_CARD_ID,
USER_ID: this.perPaper[0].USER_ID,
RECORD_ID: this.perPaper[0].RECORD_ID,
TEXT_ID: this.perPaper[0].TEXT_ID,
EDU_CARD_ID: this.perPaper[0].EDU_CARD_ID,
ISEND: true,
VIEWSEC: parseInt(this.currSce) + 1,
})
} else {
this.listViewInfo.forEach(e => {
if (e.EDU_CARD_ID == this.perPaper[0].EDU_CARD_ID) {
e.ISEND = true
e.VIEWSEC = parseInt(this.currSce) + 1
}
});
}
},
onTempSave() {
if (this.readonly) {
return
}
if (this.isViedo) {
var check = this.listViewInfo.filter(e => e.EDU_CARD_ID == this.perPaper[0].EDU_CARD_ID)
if (check == null || check.length < 1) {
this.listViewInfo.push({
ID: guid(),
ORG_ID: this.perPaper[0].ORG_ID,
EDU_CARD_ID: this.perPaper[0].EDU_CARD_ID,
USER_ID: this.perPaper[0].USER_ID,
RECORD_ID: this.perPaper[0].RECORD_ID,
TEXT_ID: this.perPaper[0].TEXT_ID,
EDU_CARD_ID: this.perPaper[0].EDU_CARD_ID,
ISEND: false,
VIEWSEC: parseInt(this.currSce) - 1,
})
} else if (check.length > 0 && !check[0].ISEND) {
this.listViewInfo.forEach(e => {
e.VIEWSEC = parseInt(this.currSce) - 1
})
}
}
let data = {
Nav_Config: JSON.parse(JSON.stringify(this.configE)),
Nav_Papers: JSON.parse(JSON.stringify(this.papers)),
TaskID: this.TaskID,
ORG_ID: this.ORG_ID,
TEXT_ID: this.EDIT_ID,
ListViewInfo: this.listViewInfo
}
getRequest(data, "/SE/SETrainRecord/SavePapersTemp").then(res => {
if (res && res.IsOperateSuccessful) {
var icon = 'success'
var duration = 1000
if (!res.IsPass) {
icon = 'error'
duration = 2000
}
uni.$showMsgFunc('执行成功', () => {
uni.navigateBack()
}, icon, duration)
}
})
}
}
}
</script>