Files
18xchat/.svn/pristine/0e/0e58e4963fe5e78f062a9de8bad28bcfb29c5b2f.svn-base
T
2025-07-17 17:18:21 +08:00

80 lines
2.2 KiB
Plaintext

import { _decorator, Node, Sprite, Toggle } from 'cc';
import { GButton } from '../../Main/Common/GButton';
import AudioManager from '../../Main/Manager/AudioManager';
import Utils from '../../Main/Common/Utils';
import { ViewManager } from '../../Main/Manager/ViewManager';
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
import li_BaseView from '../../Main/Common/li_BaseView';
import GameRootUI from '../../Main/Common/GameRootUI';
import ResManager from '../../Main/Manager/ResManager';
import PlayerDataManager from '../../Main/Manager/PlayerDataManager';
import { ByteDanceSDK } from '../../Main/Channel/bdSDK';
import SubManager from '../SubManager';
const { ccclass, property } = _decorator;
//抖音侧边栏弹窗
@ccclass('BDSidebar_UI')
export class BDSidebar_UI extends li_BaseView {
private _nodeTab: any = {};
private _data;
//----重写父类接口---------------------------------------
onLoadCT() {
this.registerListenner();
}
openUIDataCT(data: any): void {
this._data = data
}
registerListenner() {
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
}
start() {
Utils.parseNode(this.node, this._nodeTab)
GButton.BandClick(this._nodeTab.bgmask, ()=>{
this.onClose()
}, this, null, null, null, false);
GButton.BandClick(this._nodeTab.btnClose, ()=>{
this.onClose()
}, this);
GButton.BandClick(this._nodeTab.btnGoto, ()=>{
this.onGotoClick()
}, this);
this.refreshState()
}
update(deltaTime: number) {
}
//刷新状态
refreshState() {
let stage = ByteDanceSDK.SidebarState
if (stage == 2) {
Utils.setString(this._nodeTab.labGoto, "领奖")
} else {
Utils.setString(this._nodeTab.labGoto, "前往侧边栏")
}
}
//点击前往侧边栏按钮
onGotoClick() {
let stage = ByteDanceSDK.SidebarState
if (stage == 2) {
SubManager.ShowPrompt("领取奖励")
} else {
ByteDanceSDK.GotoSidebar(()=>{
this.onClose()
})
}
}
}