Commit 41b4a23f authored by liujiangnan's avatar liujiangnan

debug

parent 64337e52
...@@ -153,7 +153,7 @@ cc.Class({ ...@@ -153,7 +153,7 @@ cc.Class({
// this.playButton.node.active = true; // this.playButton.node.active = true;
// this.pauseButton.node.active = false; // this.pauseButton.node.active = false;
}); });
this.videoPlayer.node.on('completed', () => { this.videoPlayer.node.on('completed', async () => {
console.log('completed'); console.log('completed');
this.videoPlayer.currentTime = 0; this.videoPlayer.currentTime = 0;
// this.playButton.node.active = true; // this.playButton.node.active = true;
...@@ -161,7 +161,17 @@ cc.Class({ ...@@ -161,7 +161,17 @@ cc.Class({
// 上报答题结果 // 上报答题结果
if (window && window.courseware) { if (window && window.courseware) {
window.courseware.sendAnswer({isOver: true, video_url: this.data.video_url}); window.courseware.sendAnswer({isOver: true, video_url: this.data.video_url, score: this.data.questionScore});
await this.showFinal();
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const mc = middleLayer.getComponent('middleLayer');
// // 切换下一页
mc.goNextPage();
} else {
console.log("==切换下一页==");
}
} }
}); });
...@@ -263,7 +273,46 @@ cc.Class({ ...@@ -263,7 +273,46 @@ cc.Class({
this.page_view.getComponent(cc.PageView).scrollToPage(index + 1, 0.3); this.page_view.getComponent(cc.PageView).scrollToPage(index + 1, 0.3);
this.updataTipArrow(); this.updataTipArrow();
}); });
}, },
async showFinal() {
let final = cc.find("final", this.node);
let f_group = cc.find("f_group", final);
f_group.scale = 1;
f_group.setPosition(0, -265);
f_group.active = true;
await asyncLoadDragonBoneAnime(f_group, {
skeJsonData: this.data.endImgAni.ske,
texJsonData: this.data.endImgAni.tex,
texPngData: this.data.endImgAni.png
});
const animaNode = f_group['animaNode'];
const db = animaNode.getComponent(dragonBones.ArmatureDisplay);
let anis = db.getAnimationNames("armatureName");
db.playAnimation(anis[0], 0);
this.playLocalAudio("success");
final.active = true;
let desc = cc.find("desc", f_group);
let final_title = cc.find("final_title", f_group);
let head = cc.find("top/player/mask", this.node);
let worldPoint = head.convertToWorldSpaceAR(cc.v2(0, 0));
let pos = final.convertToNodeSpaceAR(worldPoint);
desc.getComponent(cc.Label).string = this.data.endImgTitle || "";
await asyncDelay(2);
desc.active = true;
final_title.active = true;
await asyncDelay(1);
let sc = cc.scaleTo(0.2, 0.2);
var actionTo = cc.jumpTo(1, cc.v2(pos.x, pos.y), 300, 1);
let call = cc.callFunc(() => {
final.active = false;
})
f_group.runAction(cc.sequence(sc, actionTo, call));
},
initdDrag() { initdDrag() {
const maxX = this.ProgressBar.node.width; const maxX = this.ProgressBar.node.width;
const minX = 0; const minX = 0;
......
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