ReceiptNotice.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const { ccclass, property } = cc._decorator;
  2. /**
  3. * 到账通知样式
  4. * @author 薛鸿潇
  5. */
  6. @ccclass
  7. export default class ReceiptNotice extends cc.Component {
  8. @property({ displayName: 'lbl收款金额', type: cc.Label })
  9. private lbl_receipt_rmb: cc.Label = null!;
  10. @property({ displayName: 'lbl累计提现', type: cc.Label })
  11. private lbl_rmb_total: cc.Label = null!;
  12. @property({ displayName: 'lbl用户名', type: cc.Label })
  13. private lbl_user_name: cc.Label = null!;
  14. // onLoad() {
  15. // }
  16. start() {
  17. mk.audio.playEffect("receiptNotice");
  18. }
  19. update(dt) {
  20. if (gData.receiptNotice.init_style) {
  21. gData.receiptNotice.init_style = false;
  22. this.initStyle();
  23. }
  24. }
  25. /**
  26. * 初始化样式
  27. */
  28. private initStyle() {
  29. this.lbl_receipt_rmb.string = '¥' + (gData.receiptNotice.receip_rmb / 100).toFixed(2) + '元';
  30. this.lbl_rmb_total.string = '¥' + (gData.cashNormal.receip_total_rmb / 100).toFixed(2) + '元';
  31. this.lbl_user_name.string = gData.wechatData.nickName || '';
  32. }
  33. }