| 12345678910111213141516171819202122232425262728293031 |
- import { _decorator, Component, Node, labelAssembler, Label, RichText } from 'cc';
- import { ConfigData } from '../Data/ConfigData';
- import { FsUtils } from '../FsUtils/FsUtils';
- const { ccclass, property } = _decorator;
- @ccclass('WithdrawIteml')
- export class WithdrawIteml extends Component {
- @property({ tooltip: "记录类型", type: Node })
- public withdrawType: Node;
- @property({ tooltip: "记录时间", type: Node })
- public withdrawTime: Node;
- @property({ tooltip: "记录金额", type: Node })
- public money: Node;
- start() {
- }
- /**
- * 初始化ui
- * @param type 记录类型
- * @param time 记录时间
- * @param money 金额
- */
- public setData(data: any) {
- // this.withdrawType.getComponent(Label).string = data.type == 1 ? "提现申请" : "贡献红包";
- this.withdrawType.getComponent(Label).string = "提现申请";
- this.withdrawTime.getComponent(Label).string = FsUtils.dateFormat(data.createTime * 1000);
- let color = data.value < 0 ? 'ff0000' : '238e23';
- this.money.getComponent(RichText).string = "<color=#" + color + ">¥ " + data.value / ConfigData.configMap.get("systemConfig").moneyRate + "元</color>";
- }
- }
|