You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.8 KiB
96 lines
2.8 KiB
// Learn TypeScript:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
|
|
// Learn Attribute:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
|
|
// Learn life-cycle callbacks:
|
|
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
|
|
|
|
import { ryw_Event } from "../../../FrameWork/Event/EventEnum";
|
|
import EventMgr from "../../../FrameWork/Event/EventMgr";
|
|
|
|
import User from "../../../FrameWork/User/User";
|
|
import AppPlatform from "../../../FrameWork/Util/AppPlatform";
|
|
import Common from "../../../FrameWork/Util/Common";
|
|
import Common5 from "../../../Platform/th/Common5";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class GZTipBtnScript extends cc.Component {
|
|
|
|
@property(cc.Node)
|
|
vdIcon: cc.Node = null;
|
|
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {}
|
|
isVideo = false
|
|
start() {
|
|
this.refreshTipsCurView()
|
|
}
|
|
|
|
//更新界面更新按钮
|
|
refreshTipsCurView() {
|
|
let answer = User.getUnlockWordgameAnswer(Common5.selectGameNum)
|
|
console.log(answer, 'answer++++++++===')
|
|
if (!answer) {
|
|
this.vdIcon.active = true
|
|
|
|
} else {
|
|
console.log(Common.subLevel, 'Common.subLevel++++++++===')
|
|
let answerIndex = answer[Common.subLevel]
|
|
console.log(answerIndex, 'answerIndex++++++++===')
|
|
if (answerIndex == 1) {
|
|
this.vdIcon.active = true
|
|
} else if (answerIndex == 2) {
|
|
this.vdIcon.active = false
|
|
} else {
|
|
this.vdIcon.active = true
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
openTipLayerClickEvent() {
|
|
Common5.playEffect("点击音效");
|
|
if (!this.vdIcon.active) {
|
|
this.openLayer()
|
|
} else {
|
|
let tab = {
|
|
onClose: (finish) => {
|
|
if (finish) {
|
|
|
|
Common5.ReportDY("inLevel", Common5.selectGameInfo.title2 + "-AD-提示");
|
|
User.unlockWordgameAnswer(Common5.selectGameNum, Common.subLevel, 2);
|
|
|
|
this.openLayer()
|
|
this.refreshTipsCurView()
|
|
}
|
|
else {
|
|
|
|
Common5.showTips_custom("广告未观看完");
|
|
}
|
|
}, onFailed: () => {
|
|
}
|
|
}
|
|
AppPlatform.playVideo_custom(tab);
|
|
}
|
|
|
|
}
|
|
|
|
openLayer() {
|
|
Common.getPrefabFromBundle("WordGame", "guizeGame/comPrefab/VideoTipPrefab", null, (node: cc.Node) => {
|
|
|
|
})
|
|
}
|
|
|
|
openGuizeClickEvent() {
|
|
Common5.playEffect("点击音效");
|
|
EventMgr.emitEvent_custom(ryw_Event.openGuizeLayerEvent)
|
|
}
|
|
// update (dt) {}
|
|
}
|
|
|