NewNotice.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { GameProp } from "../../data/GameData";
  2. const { ccclass, property } = cc._decorator;
  3. @ccclass
  4. export default class NewNotice extends cc.Component {
  5. @property({ displayName: '提现金额', type: cc.Label })
  6. private lbl_reward_value: cc.Label = null;
  7. @property({ displayName: '提现时间', type: cc.Label })
  8. private lbl_time: cc.Label = null;
  9. onLoad() {
  10. }
  11. start() {
  12. //mk.audio.playEffect("receiptNotice");
  13. let times = gData.gameData.getProp(GameProp.cashTimes);
  14. if (!times) {
  15. times = 0;
  16. }
  17. gData.gameData.setProp(GameProp.cashTimes, ++times);
  18. if(gData.gameData.taskRedBagAutoShowLimit == times && gData.gameData.funOpenData[4] == "1"){
  19. mk.event.emit("showTaskRedBagAction");
  20. }
  21. //获取账单记录数据
  22. //gData.cashOutBillData.getUserBillInfo();
  23. }
  24. onEnable()
  25. {
  26. mk.ad.showNative();
  27. }
  28. update(dt) {
  29. if (gData.receiptNotice.init_style) {
  30. gData.receiptNotice.init_style = false;
  31. this.initUI();
  32. }
  33. }
  34. private initUI() {
  35. this.lbl_reward_value.string = (gData.receiptNotice.receip_rmb / 100).toFixed(2);
  36. this.lbl_time.string = mk.time.getNowDayStringExtend();
  37. }
  38. private clickCloseBtn() {
  39. mk.audio.playEffect('button');
  40. gData.cashPro.openCashPro(gData.receiptNotice.receip_rmb);
  41. gData.cashPro.init_success = true;
  42. mk.ad.destroyNativeAd();
  43. }
  44. }