|
@@ -33,6 +33,9 @@ export default class Scene extends cc.Component {
|
|
@property({ tooltip: '下一个游戏', type: cc.Node })
|
|
@property({ tooltip: '下一个游戏', type: cc.Node })
|
|
btnNext: cc.Node = null;
|
|
btnNext: cc.Node = null;
|
|
|
|
|
|
|
|
+ @property({ tooltip: '返回', type: cc.Node })
|
|
|
|
+ btnBack: cc.Node = null;
|
|
|
|
+
|
|
nodeShow: cc.Node = null; // 显示节点
|
|
nodeShow: cc.Node = null; // 显示节点
|
|
nodeVideo: cc.Node = null;
|
|
nodeVideo: cc.Node = null;
|
|
nodeStart: cc.Node = null;
|
|
nodeStart: cc.Node = null;
|
|
@@ -152,6 +155,7 @@ export default class Scene extends cc.Component {
|
|
this.node.addChild(this.nodeStart, CConst.ZORDER_LJG_START);
|
|
this.node.addChild(this.nodeStart, CConst.ZORDER_LJG_START);
|
|
this.node.addChild(this.nodeFinish, CConst.ZORDER_LJG_FINISH);
|
|
this.node.addChild(this.nodeFinish, CConst.ZORDER_LJG_FINISH);
|
|
this.btnNext.zIndex = CConst.ZORDER_BUTTON_NEXT;
|
|
this.btnNext.zIndex = CConst.ZORDER_BUTTON_NEXT;
|
|
|
|
+ this.btnBack.zIndex = CConst.ZORDER_BUTTON_NEXT;
|
|
|
|
|
|
this.nodeShow = null;
|
|
this.nodeShow = null;
|
|
}
|
|
}
|
|
@@ -259,18 +263,20 @@ export default class Scene extends cc.Component {
|
|
this.addPrefab(curUint, curPage + 1);
|
|
this.addPrefab(curUint, curPage + 1);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- this.scheduleOnce(()=>{
|
|
|
|
|
|
+ this.scheduleOnce(() => {
|
|
// 返回课程详情页
|
|
// 返回课程详情页
|
|
common.httpReplaceUrl(common.urlClass);
|
|
common.httpReplaceUrl(common.urlClass);
|
|
}, 0.5);
|
|
}, 0.5);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 根据 组件名 获取 脚本组件
|
|
|
|
- * @param scriptName
|
|
|
|
- * @returns
|
|
|
|
- */
|
|
|
|
|
|
+ /** 返回详情页面 */
|
|
|
|
+ eventBack() {
|
|
|
|
+ let url = common.urlClass + '?id=' + common.getCourseId() + '&mode=luojigou';
|
|
|
|
+ window.location.replace(url);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** 根据 组件名 获取 脚本组件 */
|
|
getScriptByNode(node: cc.Node, scriptName: string): any {
|
|
getScriptByNode(node: cc.Node, scriptName: string): any {
|
|
if (!node || !scriptName) return null;
|
|
if (!node || !scriptName) return null;
|
|
let script = node.getComponent(scriptName);
|
|
let script = node.getComponent(scriptName);
|
|
@@ -280,17 +286,13 @@ export default class Scene extends cc.Component {
|
|
return script;
|
|
return script;
|
|
};
|
|
};
|
|
|
|
|
|
- /**
|
|
|
|
- * 窗口变化回调
|
|
|
|
- */
|
|
|
|
|
|
+ /** 窗口变化回调 */
|
|
protected onResize() {
|
|
protected onResize() {
|
|
// 适配
|
|
// 适配
|
|
this.adapt();
|
|
this.adapt();
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 适配
|
|
|
|
- */
|
|
|
|
|
|
+ /** 适配 */
|
|
protected adapt() {
|
|
protected adapt() {
|
|
// 实际屏幕比例
|
|
// 实际屏幕比例
|
|
const winSize = cc.winSize,
|
|
const winSize = cc.winSize,
|
|
@@ -311,18 +313,14 @@ export default class Scene extends cc.Component {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 适配高度模式
|
|
|
|
- */
|
|
|
|
|
|
+ /** 适配高度模式 */
|
|
protected setFitHeight() {
|
|
protected setFitHeight() {
|
|
const canvas = cc.Canvas.instance;
|
|
const canvas = cc.Canvas.instance;
|
|
canvas.fitHeight = true;
|
|
canvas.fitHeight = true;
|
|
canvas.fitWidth = false;
|
|
canvas.fitWidth = false;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 适配宽度模式
|
|
|
|
- */
|
|
|
|
|
|
+ /** 适配宽度模式 */
|
|
protected setFitWidth() {
|
|
protected setFitWidth() {
|
|
const canvas = cc.Canvas.instance;
|
|
const canvas = cc.Canvas.instance;
|
|
canvas.fitHeight = false;
|
|
canvas.fitHeight = false;
|