ReceiptNotice.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. start() {
  15. mk.audio.playEffect("receiptNotice");
  16. }
  17. update(dt) {
  18. if (gData.receiptNotice.init_style) {
  19. gData.receiptNotice.init_style = false;
  20. this.initStyle();
  21. gData.adData.checkShowFullInter(1);
  22. }
  23. }
  24. /**
  25. * 初始化样式
  26. */
  27. private initStyle() {
  28. this.lbl_receipt_rmb.string = '¥' + (gData.receiptNotice.receip_rmb / 100).toFixed(2) + '元';
  29. this.lbl_rmb_total.string = '¥' + (gData.cashNormal.receip_total_rmb / 100).toFixed(2) + '元';
  30. this.lbl_user_name.string = gData.wechatData.nickName || '';
  31. //累计成功提现次数
  32. mk.data.setTAEventUser(1, 'cash_time', 1);
  33. //累计提现金额
  34. mk.data.setTAEventUser(1, 'cash_total', gData.receiptNotice.receip_rmb / 100);
  35. }
  36. }