Compare commits
2 Commits
a9a7b8fe14
...
4d41365727
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d41365727 | ||
|
|
40210437ea |
@ -40,7 +40,7 @@
|
|||||||
<u--input v-model="SelUsrNAME" disabled disabledColor="#fff" border="none"
|
<u--input v-model="SelUsrNAME" disabled disabledColor="#fff" border="none"
|
||||||
inputAlign="right"></u--input>
|
inputAlign="right"></u--input>
|
||||||
</u-form-item>
|
</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"
|
<u--input v-model="score" disabled disabledColor="#fff" border="none"
|
||||||
inputAlign="right"></u--input>
|
inputAlign="right"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<uni-card margin="0" :is-shadow="true">
|
<uni-card margin="0" :is-shadow="true">
|
||||||
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" ref="wForm"
|
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" ref="wForm"
|
||||||
errorType="border-bottom">
|
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>
|
controls></video>
|
||||||
</u--form>
|
</u--form>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
@ -105,7 +105,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
<view class="bottom-button">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -175,8 +177,10 @@
|
|||||||
btnText: '提交', //'下一题'
|
btnText: '提交', //'下一题'
|
||||||
perPaper: [], //每次的答题 wyw 20260306
|
perPaper: [], //每次的答题 wyw 20260306
|
||||||
listPath: [],
|
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/251226100216835841.mp4
|
||||||
// https: //sps.cxtc.com:3199/BT/VIDEO/20251226/12345.mp4
|
// https: //sps.cxtc.com:3199/BT/VIDEO/20251226/12345.mp4
|
||||||
@ -262,11 +266,17 @@
|
|||||||
let record = res.Nav_Papers[0].Nav_Record;
|
let record = res.Nav_Papers[0].Nav_Record;
|
||||||
let notify = record ? record.Nav_Notify : null;
|
let notify = record ? record.Nav_Notify : null;
|
||||||
let hasAnswered = false;
|
let hasAnswered = false;
|
||||||
for (let i = 0; i < res.Nav_Papers.length; i++) {
|
// for (let i = 0; i < res.Nav_Papers.length; i++) {
|
||||||
if (res.Nav_Papers[i].ANSWER !== 0) {
|
// if (res.Nav_Papers[i].ANSWER !== 0) {
|
||||||
hasAnswered = true;
|
// 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 = papers;
|
||||||
this.papers.forEach(item => {
|
this.papers.forEach(item => {
|
||||||
if (item.Nav_Test.TYPE == 2) {
|
if (item.Nav_Test.TYPE == 2) {
|
||||||
@ -307,6 +317,7 @@
|
|||||||
this.notify = notify;
|
this.notify = notify;
|
||||||
this.readonly = hasAnswered;
|
this.readonly = hasAnswered;
|
||||||
this.score = this.papers[0].SCORE;
|
this.score = this.papers[0].SCORE;
|
||||||
|
this.listViewInfo = res.ListViewInfo
|
||||||
if (this.isCourEdit) {
|
if (this.isCourEdit) {
|
||||||
this.submit()
|
this.submit()
|
||||||
} else {
|
} else {
|
||||||
@ -493,40 +504,135 @@
|
|||||||
this.filepath = this.listPath[this.indexCour]
|
this.filepath = this.listPath[this.indexCour]
|
||||||
this.perPaper = this.papers.filter(e => e.FILE_PATH == this.filepath)
|
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) {
|
if (this.filepath.indexOf('/VIDEO/') > -1) {
|
||||||
this.isViedo = true
|
this.isViedo = true
|
||||||
this.isVideoEnd = false
|
this.isVideoEnd = false
|
||||||
this.filepath = config.uni_app_web_video_source_url + this.filepath
|
this.filepath = config.uni_app_web_video_source_url + this.filepath
|
||||||
this.filepathf = []
|
this.filepathf = []
|
||||||
|
if (ISEND && VIEWSEC == 0) {
|
||||||
|
ISEND = false
|
||||||
|
}
|
||||||
} else if (this.filepath.indexOf('.mp4') > -1 || this.filepath
|
} else if (this.filepath.indexOf('.mp4') > -1 || this.filepath
|
||||||
.indexOf('.avi') > -1) {
|
.indexOf('.avi') > -1) {
|
||||||
//暂时不应该进来
|
//暂时不应该进来
|
||||||
this.isViedo = true
|
this.isViedo = true
|
||||||
this.isVideoEnd = false
|
if (ISEND) {
|
||||||
|
ISEND = false
|
||||||
|
}
|
||||||
|
// this.isVideoEnd = false
|
||||||
this.filepath = config.uni_app_web_source_url + this.filepath
|
this.filepath = config.uni_app_web_source_url + this.filepath
|
||||||
this.filepathf = []
|
this.filepathf = []
|
||||||
} else {
|
} else {
|
||||||
this.isViedo = false
|
this.isViedo = false
|
||||||
this.isVideoEnd = true
|
// this.isVideoEnd = true
|
||||||
this.filepath = this.filepath
|
this.filepath = this.filepath
|
||||||
this.filepathf = getFileShow(this.filepath)
|
this.filepathf = getFileShow(this.filepath)
|
||||||
}
|
}
|
||||||
|
this.isVideoEnd = ISEND
|
||||||
|
this.VIEWSEC = VIEWSEC
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onTimeUpdate(e) {
|
onTimeUpdate(e) {
|
||||||
const currentTime = e.detail.currentTime;
|
const currentTime = e.detail.currentTime;
|
||||||
|
if (Math.abs(e.detail.currentTime - this.VIEWSEC) < 1) {
|
||||||
|
this.lastTime = this.VIEWSEC
|
||||||
|
}
|
||||||
if (currentTime > this.lastTime + 1) {
|
if (currentTime > this.lastTime + 1) {
|
||||||
uni.$showErrorInfo('禁止快进');
|
if (this.isVideoEnd || currentTime < this.VIEWSEC) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.$showErrorInfo('禁止快进')
|
||||||
const videoContext = uni.createVideoContext('myVideo', this)
|
const videoContext = uni.createVideoContext('myVideo', this)
|
||||||
videoContext.seek(this.lastTime);
|
videoContext.seek(this.lastTime)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.lastTime = currentTime;
|
this.lastTime = currentTime;
|
||||||
}
|
}
|
||||||
|
this.currSce = currentTime
|
||||||
},
|
},
|
||||||
//播放结束
|
//播放结束
|
||||||
onEnd() {
|
onEnd(e) {
|
||||||
this.isVideoEnd = true
|
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>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user