Commit d8fc1375 authored by limingzhe's avatar limingzhe

fix: debug

parent 7f90f7d7
{
"ver": "2.0.1",
"uuid": "a4e7516c-7a9a-4403-bf15-94250bff5888",
"downloadMode": 0,
"duration": 0.156735,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -718,6 +718,7 @@ cc.Class({ ...@@ -718,6 +718,7 @@ cc.Class({
audioGoodjob: null, audioGoodjob: null,
audioTryagain: null, audioTryagain: null,
audioRolling: null,
initAudioEffect() { initAudioEffect() {
const audioNode = cc.find('Canvas/res/audio'); const audioNode = cc.find('Canvas/res/audio');
...@@ -728,6 +729,8 @@ cc.Class({ ...@@ -728,6 +729,8 @@ cc.Class({
this.audioGoodjob = getAudioByResName('goodjob'); this.audioGoodjob = getAudioByResName('goodjob');
this.audioTryagain = getAudioByResName('tryagain'); this.audioTryagain = getAudioByResName('tryagain');
this.audioRolling = getAudioByResName('rolling');
}, },
...@@ -973,7 +976,7 @@ cc.Class({ ...@@ -973,7 +976,7 @@ cc.Class({
svNode.y = -topH / 2 // 100 * this._mapScaleMin; svNode.y = -topH / 2 // 100 * this._mapScaleMin;
svNode.x = this.canvas.width / 4 + 10 * this._mapScaleMin;// - (item.width / 2 + 10) * this._mapScaleMin; svNode.x = this.canvas.width / 4.5 + 10 * this._mapScaleMin;// - (item.width / 2 + 10) * this._mapScaleMin;
svNode.scale = this._mapScaleMin; svNode.scale = this._mapScaleMin;
...@@ -986,8 +989,8 @@ cc.Class({ ...@@ -986,8 +989,8 @@ cc.Class({
this.recordItemArr = []; this.recordItemArr = [];
const baseX = 0 //this.canvas.width/2 - 300 * this._mapScaleMin; const baseX = 0 //this.canvas.width/2 - 300 * this._mapScaleMin;
const baseY = -item.height / 2; // item.height / 2 // this.canvas.height / 2 - 200 * this._mapScaleMin; const disH = item.height + 50;
const disH = item.height + 20; const baseY = -item.height / 2 - 35; // item.height / 2 // this.canvas.height / 2 - 200 * this._mapScaleMin;
let h = 0; let h = 0;
let count = 0; let count = 0;
...@@ -1078,6 +1081,7 @@ cc.Class({ ...@@ -1078,6 +1081,7 @@ cc.Class({
// } // }
console.log('targetY : ', targetY); console.log('targetY : ', targetY);
this.sv.scrollToOffset(cc.v2(0, - item.y - item.height / 2 * 3), 0.5); this.sv.scrollToOffset(cc.v2(0, - item.y - item.height / 2 * 3), 0.5);
playAudio(this.audioRolling.clip);
}) })
}, },
...@@ -1409,6 +1413,8 @@ cc.Class({ ...@@ -1409,6 +1413,8 @@ cc.Class({
item.addChild(progress); item.addChild(progress);
item.progressComp = progress.getComponent(cc.ProgressBar); item.progressComp = progress.getComponent(cc.ProgressBar);
item.progressComp.progress = 0; item.progressComp.progress = 0;
// item.progressJs = progress.getComponent('OP_06_3_myProgressScript'); // item.progressJs = progress.getComponent('OP_06_3_myProgressScript');
const timeLabel = this.getLabel(); const timeLabel = this.getLabel();
...@@ -1450,18 +1456,18 @@ cc.Class({ ...@@ -1450,18 +1456,18 @@ cc.Class({
const recordIcon = getSprNode('icon_record_normal'); const recordIcon = getSprNode('icon_record_normal');
recordBtnNode.addChild(recordIcon); recordBtnNode.addChild(recordIcon);
const recordAnim = getSprNode('icon_recording');
// const recordAnim = this.getAnim('record'); const soundProgressBase = cc.find("Canvas/res/progress/soundProgressBar")
const soundProgressNode = cc.instantiate(soundProgressBase);
soundProgressNode.parent = recordBtnNode;
// recordAnim.scale = 0.8;
// recordAnim.x = -0.1;
recordAnim.y = 3.5;
// const anim = recordAnim.getComponent(cc.Animation);
// anim.play(); // const recordAnim = getSprNode('icon_recording');
recordBtnNode.addChild(recordAnim); // recordAnim.y = 3.5;
recordAnim.active = false; // recordBtnNode.addChild(recordAnim);
// recordAnim.active = false;
...@@ -1475,7 +1481,10 @@ cc.Class({ ...@@ -1475,7 +1481,10 @@ cc.Class({
item.playIcon = playBtn; item.playIcon = playBtn;
item.pauseIcon = stopBtn; item.pauseIcon = stopBtn;
item.recordEndIcon = recordIcon; item.recordEndIcon = recordIcon;
item.recordStartIcon = recordAnim; item.recordStartIcon = soundProgressNode;
item.soundProgress = soundProgressNode.getComponent(cc.ProgressBar);
// item.listenBtn = listenBtn; // item.listenBtn = listenBtn;
item.listenBtn = playBtnNode; item.listenBtn = playBtnNode;
...@@ -1567,6 +1576,7 @@ cc.Class({ ...@@ -1567,6 +1576,7 @@ cc.Class({
this.isRecord = true; this.isRecord = true;
this.refreshRecordBtnState(item); this.refreshRecordBtnState(item);
item.soundProgress.progress = 0;
this.curRecordItem = item; this.curRecordItem = item;
...@@ -1713,16 +1723,16 @@ cc.Class({ ...@@ -1713,16 +1723,16 @@ cc.Class({
serverStopTest(item) { serverStopTest(item) {
// const tmpData = { const tmpData = {
// refText: 'ant apple alligator ax.', refText: 'ant apple alligator ax.',
// audio_url: 'https://staging-teach.cdn.ireadabc.com/f01f0d63c0c4c0dd1203a6202ecaf34b.wav', audioUrl: 'https://staging-teach.cdn.ireadabc.com/f01f0d63c0c4c0dd1203a6202ecaf34b.wav',
// result:{ result:{
// overall: 49, overall: 49,
// } }
// } }
// this.setRecordItemAudio(tmpData, item); this.setRecordItemAudio(tmpData, item);
// return; return;
const cw = window?.courseware const cw = window?.courseware
if (cw) { if (cw) {
...@@ -1792,7 +1802,7 @@ cc.Class({ ...@@ -1792,7 +1802,7 @@ cc.Class({
item.starCount = count; item.starCount = count;
this.showStar(item, count); this.showStar(item, count, score);
this.showListenBtn(item); this.showListenBtn(item);
...@@ -1863,10 +1873,13 @@ cc.Class({ ...@@ -1863,10 +1873,13 @@ cc.Class({
showStar(item, count) { showStar(item, count, score) {
if (!item.starLayer) {
this.initItemStarLayer(item);
}
// if (!item.starLayer) {
// this.initItemStarLayer(item);
// }
const starShowEnd = () => { const starShowEnd = () => {
this.isStarShowEnd = true; this.isStarShowEnd = true;
...@@ -1884,10 +1897,10 @@ cc.Class({ ...@@ -1884,10 +1897,10 @@ cc.Class({
this.isShowFightAudio = true; this.isShowFightAudio = true;
this.canTouch = false; this.canTouch = false;
console.log("禁止点击 - 4") console.log("禁止点击 - 4")
this.playAni('begin', 0); // this.playAni('begin', 0);
this.needEnableTouchOnStopAudio = true; this.needEnableTouchOnStopAudio = true;
playAudioByUrl(this.data.fight_audio_url, () => { playAudioByUrl(this.data.fight_audio_url, () => {
this.playAni('normal', 0); // this.playAni('normal', 0);
this.needEnableTouchOnStopAudio = false; this.needEnableTouchOnStopAudio = false;
if (this.isDestroy) { if (this.isDestroy) {
...@@ -1903,39 +1916,74 @@ cc.Class({ ...@@ -1903,39 +1916,74 @@ cc.Class({
} }
} }
if (count >= 2) {
this.playAni('begin', 0);
let resName;
if (score >= 60) {
resName = "bg_gj";
playAudio(this.audioGoodjob.clip, ()=>{ playAudio(this.audioGoodjob.clip, ()=>{
this.playAni('normal', 0);
callback() callback()
}); });
} else { } else {
this.playAni('begin', 0); resName = "bg_ta";
playAudio(this.audioTryagain.clip, ()=>{ playAudio(this.audioTryagain.clip, ()=>{
this.playAni('normal', 0);
callback() callback()
}); });
} }
const resNode = getSprNode(resName);
item.addChild(resNode);
resNode.x = -140;
resNode.y = 156;
const starArr = item.starArr; resNode.scale = 0;
for (let i = 0; i < 3; i++) {
const star = starArr[i];
if (i > count - 1) {
star.active = false;
continue;
}
star.active = true;
star.scale = 0;
const time = 1; const time = 1;
cc.tween(star) cc.tween(resNode)
.delay(i * 0.25) .delay(1 * 0.25)
.to(time, { scale: 1 }, { easing: 'elasticOut' }) .to(time, { scale: 1 }, { easing: 'elasticOut' })
.start() .start()
}
// if (count >= 2) {
// this.playAni('begin', 0);
// playAudio(this.audioGoodjob.clip, ()=>{
// this.playAni('normal', 0);
// callback()
// });
// } else {
// this.playAni('begin', 0);
// playAudio(this.audioTryagain.clip, ()=>{
// this.playAni('normal', 0);
// callback()
// });
// }
// const starArr = item.starArr;
// for (let i = 0; i < 3; i++) {
// const star = starArr[i];
// if (i > count - 1) {
// star.active = false;
// continue;
// }
// star.active = true;
// star.scale = 0;
// const time = 1;
// cc.tween(star)
// .delay(i * 0.25)
// .to(time, { scale: 1 }, { easing: 'elasticOut' })
// .start()
// }
}, },
initItemStarLayer(item) { initItemStarLayer(item) {
...@@ -2628,6 +2676,9 @@ cc.Class({ ...@@ -2628,6 +2676,9 @@ cc.Class({
let percent = (currentTime - item.startTime) / item.duration; let percent = (currentTime - item.startTime) / item.duration;
console.log('percent: ', percent);
console.log('this.lastTime: ', this.lastTime);
if((currentTime - this.lastTime) == 0) { if((currentTime - this.lastTime) == 0) {
console.log("时间不变"); console.log("时间不变");
this.fakePrecent += 0.001; this.fakePrecent += 0.001;
...@@ -2659,10 +2710,14 @@ cc.Class({ ...@@ -2659,10 +2710,14 @@ cc.Class({
if (item.progressComp) { if (item.progressComp) {
item.progressComp.progress = percent; item.progressComp.progress = percent;
} }
if (this.isRecord && item.soundProgress) {
item.soundProgress.progress = percent;
}
}, },
updateRecordEnd() { updateRecordEnd() {
console.log("in updateRecordEnd")
if (!this.curRecordItem) { if (!this.curRecordItem) {
return; return;
} }
...@@ -2676,6 +2731,8 @@ cc.Class({ ...@@ -2676,6 +2731,8 @@ cc.Class({
this.hideBtn = null; this.hideBtn = null;
} }
console.log("isRecord ~", this.isRecord);
if (this.isRecord) { if (this.isRecord) {
this.isRecord = false; this.isRecord = false;
this.refreshRecordBtnState(item); this.refreshRecordBtnState(item);
......
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