CashNormalItem.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { TCashList } from "../../data/module/CashNormalData";
  2. const { ccclass, property } = cc._decorator;
  3. /**
  4. * 提现记录条目
  5. * @author 薛鸿潇
  6. */
  7. @ccclass
  8. export default class CashNormalItem extends cc.Component {
  9. @property({ displayName: 'lbl提现类型', type: cc.Label })
  10. private lbl_cash_type: cc.Label = null;
  11. @property({ displayName: 'lbl提现时间', type: cc.Label })
  12. private lbl_cash_time: cc.Label = null;
  13. @property({ displayName: 'lbl红包码', type: cc.Label })
  14. private lbl_red_ma: cc.Label = null;
  15. @property({ displayName: 'lbl毛币数量', type: cc.Label })
  16. private lbl_rmb_value: cc.Label = null;
  17. // onLoad () {}
  18. // start () {
  19. // }
  20. /**
  21. * 初始化数据
  22. */
  23. public async setItemData(item_data) {
  24. await this.initStyle(item_data);
  25. }
  26. private initStyle(item_data: TCashList) {
  27. this.lbl_cash_type.string = gData.cashNormal.cash_type[item_data.cashType] || '未知类型';
  28. this.lbl_cash_time.string = mk.time.getNowDayString(item_data.applyTime * 1000);
  29. this.lbl_red_ma.string = item_data.withdrawalCode ? '红包码:' + item_data.withdrawalCode : '';
  30. this.lbl_rmb_value.string = '¥' + (item_data.amount / 100).toFixed(2) + '元';
  31. }
  32. }