import { _decorator, Component, Node, Label, Sprite, SpriteFrame } from 'cc'; import { ResourcesUtils } from '../core/resourceManager/ResourcesUtils'; import { WindowManager } from '../core/ui/window/WindowManager'; import { WindowSystem } from '../core/ui/window/WindowSystem'; import { g } from '../Data/g'; import { FsUtils } from '../FsUtils/FsUtils'; const { ccclass, property } = _decorator; /**公共对话框 */ @ccclass('DialogWindow') export class DialogWindow extends Component { @property({ type: Label, tooltip: "数量文本" }) numLabel: Label; @property({ type: Label, tooltip: "内容文本" }) contentLabel: Label; @property({ type: Sprite, tooltip: "icon图标" }) iconSprite: Sprite; private type = 0; start() { } private async onOpenHandler(data: any) { this.type = data.type; this.contentLabel.string = data.content; this.numLabel.string = ' X' + FsUtils.moneyFormat(data.num); if (data.type == 2) {// this.iconSprite.node.active = false; this.numLabel.node.active = false; } } private async onButtonTouch() { if (this.type == 2) { g.battleData.hasBattleTimesUpdate = true; } } }