Commit d8219af0 authored by limingzhe's avatar limingzhe

fix: debug

parent 85fc32d4
...@@ -767,8 +767,8 @@ initMask() { ...@@ -767,8 +767,8 @@ initMask() {
// this.readingItemArr = this.curQues.readingItemArr; this.readingItemArr = this.curQues.readingItemArr;
// this.readingItemArrIndex = 0; this.readingItemArrIndex = 0;
// playAudio(this.readingTip2Clip, () => { // playAudio(this.readingTip2Clip, () => {
// this.showReadingItem(); // this.showReadingItem();
...@@ -841,6 +841,7 @@ initMask() { ...@@ -841,6 +841,7 @@ initMask() {
this.readingPanel = readingPanel this.readingPanel = readingPanel
this.readingPanelCenter = cc.find("panel", readingPanel); this.readingPanelCenter = cc.find("panel", readingPanel);
this.readingPanelCenter.baseScale = this.readingPanelCenter.scale;
this.readingPanelBg = cc.find("panel/bg_2", readingPanel); this.readingPanelBg = cc.find("panel/bg_2", readingPanel);
...@@ -937,9 +938,7 @@ initMask() { ...@@ -937,9 +938,7 @@ initMask() {
this.finishBtn.active = false; this.finishBtn.active = false;
if (!this.readingPanelCenter.baseScale) {
this.readingPanelCenter.baseScale = this.readingPanelCenter.scale;
}
const baseScale = this.readingPanelCenter.baseScale; const baseScale = this.readingPanelCenter.baseScale;
...@@ -955,29 +954,33 @@ initMask() { ...@@ -955,29 +954,33 @@ initMask() {
.to(0.3, {scale: 0}, {easing: "cubicOut"}) .to(0.3, {scale: 0}, {easing: "cubicOut"})
.call(() => { .call(() => {
this.stopRecordToText(); // this.stopRecordToText();
this.readingItemArrIndex ++ ; // this.readingItemArrIndex ++ ;
this.showReadingItem(); // this.showReadingItem();
if (this.curReadingItem) { // if (this.curReadingItem) {
showFunc(); // showFunc();
} else { // } else {
this.readingPanel.active = false; this.readingPanel.active = false;
}
this.readingPanelCenter.scale = baseScale;
// }
}) })
.start(); .start();
} }
hideFunc(); hideFunc();
// // this.readingPanel.active = false; // this.readingPanel.active = false;
// this.stopRecordToText(); this.stopRecordToText();
// this.readingItemArrIndex ++ ; this.readingItemArrIndex ++ ;
// this.showReadingItem(); // this.showReadingItem();
...@@ -987,13 +990,13 @@ initMask() { ...@@ -987,13 +990,13 @@ initMask() {
// this.initCurReadingItem(); // this.initCurReadingItem();
// this.initCurQuesReadingItem(); this.initCurQuesReadingItem();
// if (this.isGameEnd) { if (this.isGameEnd) {
// return; return;
// } }
// this.video.play(); this.video.play();
}, },
...@@ -1627,36 +1630,36 @@ showStartLight() { ...@@ -1627,36 +1630,36 @@ showStartLight() {
startQuesVideo(currentTime = null) { startQuesVideo(currentTime = null) {
this.curQues.ques_start = 0; // this.curQues.ques_start = 0;
this.curQues.ques_end = this.video.getDuration() - 0.1; // this.curQues.ques_end = this.video.getDuration() - 0.1;
console.log(' in startQuesVideo') // console.log(' in startQuesVideo')
this.wrongTimes = 0; // this.wrongTimes = 0;
const video = this.video; // const video = this.video;
video.node.name = 'ques_video'; // video.node.name = 'ques_video';
console.log("this.curQues: ", this.curQues); // console.log("this.curQues: ", this.curQues);
// if (currentTime) { // // if (currentTime) {
// video.currentTime = currentTime; // // video.currentTime = currentTime;
// } else { // // } else {
// video.currentTime = Number(this.curQues.ques_start); // // video.currentTime = Number(this.curQues.ques_start);
// } // // }
if (this.curQues) { // if (this.curQues) {
this.curEndTime = Number(this.curQues.ques_end); // this.curEndTime = Number(this.curQues.ques_end);
} // }
delayCall(0.1, () => { // delayCall(0.1, () => {
video.play(); // video.play();
}) // })
}, },
...@@ -1699,91 +1702,91 @@ showStartLight() { ...@@ -1699,91 +1702,91 @@ showStartLight() {
} }
}, },
continueWaitVideo() { continueWaitVideo() {
console.log(' in continueWaitVideo ') // console.log(' in continueWaitVideo ')
this.video.currentTime = Number(this.curQues.wait_start); // this.video.currentTime = Number(this.curQues.wait_start);
this.curEndTime = Number(this.curQues.wait_end); // this.curEndTime = Number(this.curQues.wait_end);
delayCall(0.01, () => { // delayCall(0.01, () => {
this.video.play(); // this.video.play();
}) // })
}, },
startRightVideo() { startRightVideo() {
console.log(' in startRightVideo ') console.log(' in startRightVideo ')
// const videoNode = this.curQues?.videoObj?.right_video; // // const videoNode = this.curQues?.videoObj?.right_video;
// const video = videoNode.getComponent(cc.VideoPlayer); // // const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'right_video'; // // video.node.name = 'right_video';
// video.play(); // // video.play();
// this.curVideo = video; // // this.curVideo = video;
// this.resetVideoPos(videoNode); // // this.resetVideoPos(videoNode);
const video = this.video; // const video = this.video;
video.node.name = 'right_video'; // video.node.name = 'right_video';
video.currentTime = Number(this.curQues.right_start); // video.currentTime = Number(this.curQues.right_start);
this.curEndTime = Number(this.curQues.right_end); // this.curEndTime = Number(this.curQues.right_end);
delayCall(0.01, () => { // delayCall(0.01, () => {
video.play(); // video.play();
}) // })
}, },
startWrongVideo() { startWrongVideo() {
console.log(' in startWrongVideo ') console.log(' in startWrongVideo ')
// const videoNode = this.curQues?.videoObj?.wrong_video; // // const videoNode = this.curQues?.videoObj?.wrong_video;
// const video = videoNode.getComponent(cc.VideoPlayer); // // const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'wrong_video'; // // video.node.name = 'wrong_video';
// video.play(); // // video.play();
// this.curVideo = video; // // this.curVideo = video;
// this.resetVideoPos(videoNode); // // this.resetVideoPos(videoNode);
const video = this.video; // const video = this.video;
video.node.name = 'wrong_video'; // video.node.name = 'wrong_video';
if (this.wrongStartTime && this.wrongEndTime) { // if (this.wrongStartTime && this.wrongEndTime) {
video.currentTime = this.wrongStartTime; // video.currentTime = this.wrongStartTime;
this.curEndTime = this.wrongEndTime; // this.curEndTime = this.wrongEndTime;
} else { // } else {
video.currentTime = Number(this.curQues.wrong_start); // video.currentTime = Number(this.curQues.wrong_start);
this.curEndTime = Number(this.curQues.wrong_end); // this.curEndTime = Number(this.curQues.wrong_end);
} // }
delayCall(0.01, () => { // delayCall(0.01, () => {
video.play(); // video.play();
}) // })
}, },
startEndVideo() { startEndVideo() {
console.log(' in startEndVideo ') console.log(' in startEndVideo ')
// const videoNode = this.curQues?.videoObj?.end_video; // // const videoNode = this.curQues?.videoObj?.end_video;
// const video = videoNode.getComponent(cc.VideoPlayer); // // const video = videoNode.getComponent(cc.VideoPlayer);
// video.node.name = 'end_video'; // // video.node.name = 'end_video';
// video.play(); // // video.play();
// this.curVideo = video; // // this.curVideo = video;
// this.resetVideoPos(videoNode); // // this.resetVideoPos(videoNode);
if (!this.curQues.end_start) { // if (!this.curQues.end_start) {
this.checkNextQues(); // this.checkNextQues();
return; // return;
} // }
const video = this.video; // const video = this.video;
video.node.name = 'end_video'; // video.node.name = 'end_video';
video.currentTime = Number(this.curQues.end_start); // video.currentTime = Number(this.curQues.end_start);
this.curEndTime = Number(this.curQues.end_end); // this.curEndTime = Number(this.curQues.end_end);
delayCall(0.01, () => { // delayCall(0.01, () => {
video.play(); // video.play();
}) // })
}, },
resetVideoPos(videoNode) { resetVideoPos(videoNode) {
...@@ -1805,14 +1808,14 @@ showStartLight() { ...@@ -1805,14 +1808,14 @@ showStartLight() {
}, },
initCurReadingItem() { initCurReadingItem() {
this.curReadingItem = this.readingItemArr[this.readingItemArrIndex]; // this.curReadingItem = this.readingItemArr[this.readingItemArrIndex];
if (!this.curReadingItem) { // if (!this.curReadingItem) {
this.gameEnd(); // this.gameEnd();
return; // return;
} // }
this.curEndTime = this.curReadingItem.time; // this.curEndTime = this.curReadingItem.time;
}, },
...@@ -1934,13 +1937,30 @@ showStartLight() { ...@@ -1934,13 +1937,30 @@ showStartLight() {
} }
console.log('this.curQues.readingItemArr: ', this.curQues.readingItemArr);
if (this.curQues.readingItemArr && this.curQues.readingItemArr.length > 0) { if (this.curQues.readingItemArr && this.curQues.readingItemArr.length > 0) {
this.readingItemArr = this.curQues.readingItemArr; this.readingItemArr = this.curQues.readingItemArr;
this.readingItemArrIndex = 0; this.readingItemArrIndex = 0;
playAudio(this.readingTip2Clip, () => { playAudio(this.readingTip2Clip, async () => {
this.showReadingItem();
this.video.currentTime = 0;
this.video.play();
await asyncDelay(0.01);
this.initCurQuesReadingItem();
// this.showReadingItem();
}) })
// this.showReadingItem(); // this.showReadingItem();
...@@ -2108,7 +2128,6 @@ showStartLight() { ...@@ -2108,7 +2128,6 @@ showStartLight() {
console.log(' showCurReadingText ... 2 ') console.log(' showCurReadingText ... 2 ')
this.initCurQuesReadingItem();
if (!this.curReadingItem) { if (!this.curReadingItem) {
this.curQues.readingItemArr = null; this.curQues.readingItemArr = null;
...@@ -2120,17 +2139,19 @@ showStartLight() { ...@@ -2120,17 +2139,19 @@ showStartLight() {
this.initReadingSound(); this.initReadingSound();
this.readingPanel.active = true; this.readingPanel.active = true;
this.readingPanelCenter.scale = this.readingPanelCenter.baseScale;
this.finishBtn.active = true;
playAudio(this.readingTipClip, () => { playAudio(this.readingTipClip, () => {
// playAudioByUrl(this.curReadingAudioUrl, () => { // playAudioByUrl(this.curReadingAudioUrl, () => {
// this.recordIconStart(); this.recordIconStart();
// this.startRecordToText(); this.startRecordToText();
this.readingSoundBtnClick(); // this.readingSoundBtnClick();
// }) // })
}) })
...@@ -2142,10 +2163,11 @@ showStartLight() { ...@@ -2142,10 +2163,11 @@ showStartLight() {
if (!this.curReadingItem) { if (!this.curReadingItem) {
// this.gameEnd(); // this.gameEnd();
this.curQues.readingItemArr = null;
return; return;
} }
// this.curEndTime = this.curReadingItem.time; this.curEndTime = this.curReadingItem.time;
}, },
...@@ -2265,6 +2287,8 @@ showStartLight() { ...@@ -2265,6 +2287,8 @@ showStartLight() {
showCurReadingLabelColor() { showCurReadingLabelColor() {
console.log(' in showCurReadingLabelColor')
const normalColor = '#c48814'; const normalColor = '#c48814';
const readEndColor = '#37bafe' const readEndColor = '#37bafe'
let str = ""; let str = "";
...@@ -2288,6 +2312,11 @@ showStartLight() { ...@@ -2288,6 +2312,11 @@ showStartLight() {
str += `"<color=${wordColor}>${this.readingWordArr[i]}</color>"`; str += `"<color=${wordColor}>${this.readingWordArr[i]}</color>"`;
} }
console.log('this.readingWordArr~: ' + JSON.stringify(this.readingWordArr));
console.log('this.readingEndWordArr~: ' + JSON.stringify(this.readingEndWordArr));
console.log(' showCurReadingText ... 1 ') console.log(' showCurReadingText ... 1 ')
this.showCurReadingText(str); this.showCurReadingText(str);
...@@ -2359,8 +2388,12 @@ showStartLight() { ...@@ -2359,8 +2388,12 @@ showStartLight() {
curVideoPlayEnd() { curVideoPlayOnEndTime() {
console.log(" in curVideoPlayOnEndTime")
this.showReadingItem();
return;
if (this.playTimes && this.playTimes == 1) { if (this.playTimes && this.playTimes == 1) {
...@@ -2496,7 +2529,7 @@ showStartLight() { ...@@ -2496,7 +2529,7 @@ showStartLight() {
updateCheckStop() { updateCheckStop() {
return; // return;
if (!this.video || this.curEndTime == -1) { if (!this.video || this.curEndTime == -1) {
return; return;
...@@ -2510,7 +2543,7 @@ showStartLight() { ...@@ -2510,7 +2543,7 @@ showStartLight() {
this.curEndTime = -1; this.curEndTime = -1;
this.curVideoPlayEnd(); this.curVideoPlayOnEndTime();
} }
...@@ -2794,7 +2827,11 @@ showStartLight() { ...@@ -2794,7 +2827,11 @@ showStartLight() {
if (this.quesIndex == 0) { if (this.quesIndex == 0) {
// 封面特殊处理 // 封面特殊处理
this.startQuesVideo(); // this.startQuesVideo();
delayCall(0.1, () => {
this.video.play();
})
return; return;
} }
......
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