CashRebateView.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-21 11:45:43
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-29 18:11:07
  6. * @Description: 提现必返
  7. */
  8. import { _decorator, Label } from 'cc';
  9. import { oops } from 'db://oops-framework/core/Oops';
  10. import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
  11. import { GameComponent } from "db://oops-framework/module/common/GameComponent";
  12. import { UIID } from '../common/config/GameUIConfig';
  13. import { ADHandler } from '../common/manager/ADHandler';
  14. import { smc } from '../common/SingletonModuleComp';
  15. import { GameEvent } from '../common/config/GameEvent';
  16. import { ServerHandler } from '../common/manager/ServerHandler';
  17. import { Format } from '../utils/Format';
  18. import { DCHandler } from '../common/manager/DCHandler';
  19. const { ccclass, property } = _decorator;
  20. /** 显示对象控制 */
  21. @ccclass('CashRebateView')
  22. export class CashRebateView extends GameComponent {
  23. @property(Label)
  24. lab_num: Label = null!;
  25. protected start() {
  26. DCHandler.inst.reportData(3000702);
  27. this.setButton();
  28. this.setData();
  29. }
  30. setData() {
  31. if (this.lab_num) {
  32. this.lab_num.string = Format.formatRedPacketCoin(smc.game.GameModel.changeHbCoin);
  33. }
  34. }
  35. private btn_ok() {
  36. //看广告
  37. if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
  38. oops.gui.remove(UIID.CashRebate);
  39. ADHandler.inst.showAd("105");
  40. oops.message.dispatchEvent(GameEvent.showCoinAnimation, "showCoin");
  41. //下一关
  42. ServerHandler.inst.getNextLevel();
  43. DCHandler.inst.reportData(3000704);
  44. } else {
  45. oops.gui.remove(UIID.CashRebate);
  46. }
  47. }
  48. }