Files
Monopoly/assets/app-bundle/app-view/page/tips/native/PageTips.ts
2026-03-30 09:39:59 +08:00

27 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { _decorator, Label } from 'cc';
import BaseView from '../../../../../../extensions/app/assets/base/BaseView';
import { USERDATA } from 'db://assets/res-native/data/UserData';
import { Tools } from 'db://assets/res-native/tools/Tools';
const { ccclass, property } = _decorator;
@ccclass('PageTips')
export class PageTips extends BaseView {
/** tips */
@property(Label)
lab_tips: Label = null!;
// 初始化的相关逻辑写在这
onLoad() {}
// 界面打开时的相关逻辑写在这(onShow可被多次调用-它与onHide不成对)
onShow(params: any) {
Tools.httpReq("game/config", {}, (res:any) => {
this.lab_tips.string = res.game_config[0].value
})
}
// 界面关闭时的相关逻辑写在这(已经关闭的界面不会触发onHide)
onHide(result: undefined) {
// app.manager.ui.show<PageTips>({name: 'PageTips', onHide:(result) => { 接收到return的数据并且有类型提示 }})
return result;
}
}