Commit 14cec8da authored by 李维's avatar 李维

修复最后一题跳转错误的问题

parent 0503c238
......@@ -1687,6 +1687,8 @@
"__id__": 15
},
"_enabled": true,
"setTimeoutIDs": [],
"setIntervalIDs": [],
"_id": "42XWQfk9tE94NY0efe9K5z"
},
{
......
......@@ -448,10 +448,8 @@ cc.Class({
console.log("preloadArr: ", JSON.stringify(preloadArr));
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
// console.log(' preload data, ', data);
// this.loadEnd();
this.addServerListener();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
}
......@@ -550,10 +548,8 @@ cc.Class({
// return;
console.log(" in getState 1");
callMiddleLayerFunction("PSQS_get_course_info", {}, (data) => {
console.log("PSQS_get_course_info",data.first, data.last, data.playTime, JSON.stringify(data.saveData));
this.isFirst = data.first; //this.checkIsFirst();
this.isLast = data.last // this.checkIsLast();
this.playTimes = data.playTime// this.checkPlayTimes();
......@@ -585,7 +581,7 @@ cc.Class({
},
getJumpData() {
return {step: 1};
return {step: 7};
},
maskSpr: null,
......@@ -694,9 +690,8 @@ cc.Class({
addServerListener() {
console.log(" in addServerListener");
const c = window.courseware;
// this.loadEnd(()=>{});
const c = window.courseware;
if (!c) {
return;
}
......@@ -1053,7 +1048,7 @@ cc.Class({
},
startQuesVideo(currentTime = null) {
console.log(" in startQuesVideo");
console.log("in startQuesVideo", currentTime);
this.wrongTimes = 0;
const video = this.video;
......@@ -1073,6 +1068,11 @@ cc.Class({
}
}
// 如果是最后一题
if(this.isTheEndVideo) {
this.curEndTime = -1;
}
delayCall(0.01, () => {
video.play();
this.videoControlBar.emit("update_video_status", 1);
......@@ -1081,7 +1081,7 @@ cc.Class({
isWaitingUserAction: false,
startWaitVideo() {
console.log(" in startWaitVideo ");
console.log("in startWaitVideo");
this.isWaitingUserAction = true;
this.curQues.hotZoneBg.active = true;
this.hand.active = true;
......@@ -1137,7 +1137,7 @@ cc.Class({
},
startRightVideo() {
console.log(" in startRightVideo ");
console.log("in startRightVideo");
// const videoNode = this.curQues?.videoObj?.right_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
......@@ -1159,7 +1159,7 @@ cc.Class({
},
startWrongVideo() {
console.log(" in startWrongVideo ");
console.log("in startWrongVideo");
// const videoNode = this.curQues?.videoObj?.wrong_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
......@@ -1187,7 +1187,7 @@ cc.Class({
},
startEndVideo() {
console.log(" in startEndVideo ");
console.log("in startEndVideo");
// const videoNode = this.curQues?.videoObj?.end_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
......@@ -1225,11 +1225,12 @@ cc.Class({
},
initCurQues() {
if(this.quesIndex >=0) {
if(this.quesIndex >= 0) {
this.curQues = this.data.quesArr[this.quesIndex];
console.log("curQues: ", this.curQues);
} else {
console.log('题目序号不能为负数');
this.curQues = this.data.quesArr[this.data.quesArr.length-1];
console.log('题目序号为负 - 跳转到最后一段音频');
}
},
......@@ -1363,6 +1364,7 @@ cc.Class({
this.startQuesVideo(this.jumpTime);
},
isTheEndVideo: false,
setJumpTime() {
let isFind = false;
for (let i = 0; i < this.data.quesArr.length; i++) {
......@@ -1377,8 +1379,10 @@ cc.Class({
}
if (!isFind) {
// 没有找到就是最后一题
const lastQuesData = this.data.quesArr[this.data.quesArr.length - 1];
this.jumpTime = lastQuesData.ques_end;
this.isTheEndVideo = true;
}
},
......@@ -1386,7 +1390,6 @@ cc.Class({
if (this.playTimes == 0) {
return;
}
switch (this.video.node.name) {
case "ques_video":
this.startWaitVideo();
......@@ -2925,7 +2928,6 @@ cc.Class({
console.log("clicked");
this.video.pause();
this.videoControlBar.emit("update_video_status", 0);
this.curQues.isRight = isRight;
if (isRight) {
this.startRightVideo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment