CashRebateView.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-23 16:06:31
  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 { CocosHandler } from '../common/manager/CocosHandler';
  14. import { ADHandler } from '../common/manager/ADHandler';
  15. import { smc } from '../common/SingletonModuleComp';
  16. import { GameEvent } from '../common/config/GameEvent';
  17. import { ServerHandler } from '../common/manager/ServerHandler';
  18. import { Format } from '../utils/Format';
  19. import { DCHandler } from '../common/manager/DCHandler';
  20. const { ccclass, property } = _decorator;
  21. /** 显示对象控制 */
  22. @ccclass('CashRebateView')
  23. export class CashRebateView extends GameComponent {
  24. @property(Label)
  25. lab_num: Label = null!;
  26. protected start() {
  27. DCHandler.inst.reportData(3000702);
  28. this.setButton();
  29. this.setData();
  30. }
  31. setData() {
  32. if (this.lab_num) {
  33. this.lab_num.string = Format.formatRedPacketCoin(smc.game.GameModel.changeHbCoin);
  34. }
  35. }
  36. private btn_ok() {
  37. //看广告
  38. if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
  39. oops.gui.remove(UIID.CashRebate);
  40. ADHandler.inst.showAd("105");
  41. oops.message.dispatchEvent(GameEvent.showCoinAnimation, "showCoin");
  42. //下一关
  43. ServerHandler.inst.getNextLevel();
  44. DCHandler.inst.reportData(3000704);
  45. } else {
  46. oops.gui.remove(UIID.CashRebate);
  47. }
  48. }
  49. }