76 lines
2.0 KiB
Plaintext
76 lines
2.0 KiB
Plaintext
import { _decorator, Node, Sprite } from 'cc';
|
|
import { GButton } from '../../Main/Common/GButton';
|
|
import Utils from '../../Main/Common/Utils';
|
|
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
|
import li_BaseView from '../../Main/Common/li_BaseView';
|
|
import GameManager from '../../Main/Manager/GameManager';
|
|
import ResManager from '../../Main/Manager/ResManager';
|
|
import HttpUnit from '../../Main/Common/HttpUnit';
|
|
import SubManager from '../SubManager';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
//关卡内看广告弹窗界面
|
|
@ccclass('TalkAdDialog')
|
|
export class TalkAdDialog extends li_BaseView {
|
|
|
|
private _nodeTab: any = {};
|
|
private _data;
|
|
|
|
//----重写父类接口---------------------------------------
|
|
onLoadCT() {
|
|
this.registerListenner();
|
|
Utils.parseNode(this.node, this._nodeTab)
|
|
|
|
}
|
|
openUIDataCT(data: any): void {
|
|
this._data = data || {};
|
|
}
|
|
|
|
|
|
registerListenner() {
|
|
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
|
|
}
|
|
|
|
|
|
start() {
|
|
GButton.BandClick(this._nodeTab.mask, ()=>{
|
|
if (this._data.closeCallback) {
|
|
this._data.closeCallback();
|
|
}
|
|
this.doClose();
|
|
}, this, 0, null, null, false);
|
|
|
|
GButton.BandClick(this._nodeTab.btnShare, ()=>{
|
|
if (HttpUnit.GetShareNum() <= 0) {
|
|
SubManager.ShowPrompt("今日分享次数已用完");
|
|
return;
|
|
}
|
|
|
|
if (this._data.shareCallback) {
|
|
this._data.shareCallback();
|
|
}
|
|
this.doClose();
|
|
}, this);
|
|
|
|
GButton.BandClick(this._nodeTab.btnAD, ()=>{
|
|
if (HttpUnit.GetAdNum() <= 0) {
|
|
SubManager.ShowPrompt("今日广告次数已用完");
|
|
return;
|
|
}
|
|
|
|
if (this._data.adCallback) {
|
|
this._data.adCallback();
|
|
}
|
|
this.doClose();
|
|
}, this);
|
|
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|