NewNotice.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. times = gData.gameData.getProp(GameProp.cashTimes);
  19. console.log(`cashTimes2222======${times}`);
  20. if(gData.gameData.showRichBankIconLimit == times && gData.gameData.funOpenData[13] == "1"){
  21. mk.event.emit("showRichBankIcon");
  22. }
  23. if(gData.gameData.taskRedBagAutoShowLimit == times && gData.gameData.funOpenData[4] == "1"){
  24. mk.event.emit("showTaskRedBagAction");
  25. }
  26. }
  27. onEnable()
  28. {
  29. mk.ad.showNative();
  30. }
  31. update(dt) {
  32. if (gData.receiptNotice.init_style) {
  33. gData.receiptNotice.init_style = false;
  34. this.initUI();
  35. }
  36. }
  37. private initUI() {
  38. this.lbl_reward_value.string = (gData.receiptNotice.receip_rmb / 100).toFixed(2);
  39. this.lbl_time.string = mk.time.getNowDayStringExtend();
  40. }
  41. private clickCloseBtn() {
  42. mk.audio.playEffect('button');
  43. gData.cashPro.openCashPro(gData.receiptNotice.receip_rmb);
  44. gData.cashPro.init_success = true;
  45. mk.ad.destroyNativeAd();
  46. }
  47. }