Browse Source

视频黑屏问题改为动态查找初始视频

h5_css
蟑螂恶霸 2 years ago
parent
commit
17777b476f
  1. 11
      components/s-video/res-s-video.vue
  2. 15
      components/s-video/s-video.vue
  3. 1
      subpkg/complete/complete.vue

11
components/s-video/res-s-video.vue

@ -88,6 +88,7 @@
isResVideo: false, isResVideo: false,
innerAudioContext: null, innerAudioContext: null,
failUrl: uni.$http.baseUrl + "/profile//images/fail.gif", failUrl: uni.$http.baseUrl + "/profile//images/fail.gif",
startNodeId: 2,
}; };
}, },
computed: { computed: {
@ -190,7 +191,7 @@
}, },
nextQuestion(outId, obj) { nextQuestion(outId, obj) {
// //
if (2 == outId) { if(this.startNodeId==outId) {
// this.$api.addQuestionFre({ // this.$api.addQuestionFre({
// roleId : this.jsonId, // roleId : this.jsonId,
// // userId : this.userId // // userId : this.userId
@ -231,7 +232,7 @@
} }
// 1: // 1:
if (isCorrect == 0 && 2 != outId) { if(isCorrect == 0 && this.startNodeId != outId) {
this.isError = true; this.isError = true;
this.isOk = false; this.isOk = false;
} else { } else {
@ -295,12 +296,16 @@
this.videoObj = this.videoObjList[i]; this.videoObj = this.videoObjList[i];
this.correct = this.videoObjList[i].correct; this.correct = this.videoObjList[i].correct;
this.ask = this.videoObjList[i].ask; this.ask = this.videoObjList[i].ask;
//
if(nodeId == 1) {
this.startNodeId = this.videoObj.outs[0]
}
} }
} }
this.preQuestionId = this.videoObj.questionId; this.preQuestionId = this.videoObj.questionId;
// //
if(nodeId == 1) { if(nodeId == 1) {
this.nextQuestion(2, null) this.nextQuestion(this.startNodeId, null)
} }
}, },
getAnswer(outId) { getAnswer(outId) {

15
components/s-video/s-video.vue

@ -80,6 +80,7 @@
isResVideo: false, isResVideo: false,
failUrl: uni.$http.baseUrl + "/profile//images/fail.gif", failUrl: uni.$http.baseUrl + "/profile//images/fail.gif",
innerAudioContext: null, innerAudioContext: null,
startNodeId: 2,
}; };
}, },
computed: { computed: {
@ -194,7 +195,7 @@
nextQuestion(outId, obj) { nextQuestion(outId, obj) {
this.innerAudioContext.stop(); this.innerAudioContext.stop();
// //
if (2 == outId) { if (this.startNodeId == outId) {
this.$api.addQuestionFre({ this.$api.addQuestionFre({
roleId: this.jsonId, roleId: this.jsonId,
sceneId: this.sceneId, sceneId: this.sceneId,
@ -236,7 +237,7 @@
} }
// 1: // 1:
if (isCorrect == 0 && 2 != outId) { if (isCorrect == 0 && this.startNodeId != outId) {
this.isError = true; this.isError = true;
this.isOk = false; this.isOk = false;
} else { } else {
@ -289,17 +290,23 @@
}).catch((e) => console.log(e)); // }).catch((e) => console.log(e)); //
}, },
hasNodeId(nodeId) { hasNodeId(nodeId) {
for (var i = 0; i < this.videoObjList.length; i++) { for (let i=0; i < this.videoObjList.length; i++) {
if (nodeId == this.videoObjList[i].nodeId) { if (nodeId == this.videoObjList[i].nodeId) {
this.videoObj = this.videoObjList[i]; this.videoObj = this.videoObjList[i];
console.log(this.videoObj)
console.log(this.videoObj.videoUrl)
this.correct = this.videoObjList[i].correct; this.correct = this.videoObjList[i].correct;
this.ask = this.videoObjList[i].ask; this.ask = this.videoObjList[i].ask;
//
if(nodeId == 1) {
this.startNodeId = this.videoObj.outs[0]
}
} }
} }
this.preQuestionId = this.videoObj.questionId; this.preQuestionId = this.videoObj.questionId;
// //
if (nodeId == 1) { if (nodeId == 1) {
this.nextQuestion(2, null) this.nextQuestion(this.startNodeId, null)
} }
}, },
getAnswer(outId) { getAnswer(outId) {

1
subpkg/complete/complete.vue

@ -161,6 +161,7 @@
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.showMedal = false this.showMedal = false
this.showLayer = false this.showLayer = false
this.resCheck = false
clearTimeout(this.timer) clearTimeout(this.timer)
}, 5000) }, 5000)
this.roleId = options.roleId != null ? options.roleId : this.roleId this.roleId = options.roleId != null ? options.roleId : this.roleId

Loading…
Cancel
Save