ReservePopup.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { _decorator, Component, Node } from 'cc';
  2. import { oops } from 'db://oops-framework/core/Oops';
  3. import VMParent from 'db://oops-framework/libs/model-view/VMParent';
  4. import { UIID } from '../../common/config/GameUIConfig';
  5. import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
  6. import { smc } from '../../common/SingletonModuleComp';
  7. import { Format } from '../../utils/Format';
  8. import { DCHandler } from '../../common/manager/DCHandler';
  9. import { ServerHandler } from '../../common/manager/ServerHandler';
  10. const { ccclass, property } = _decorator;
  11. @ccclass('ReservePopup')
  12. export class ReservePopup extends VMParent {
  13. data: any = {
  14. nickName: "小白",
  15. time: "2025-04-28",
  16. money: 1000,
  17. goldNum: 10
  18. }
  19. start() {
  20. DCHandler.inst.reportData(3000200);
  21. this.setButton();
  22. this.updateData();
  23. }
  24. //更新数据
  25. updateData() {
  26. if (DeviceUtil.isAndroid && DeviceUtil.isNative) {
  27. this.data.nickName = smc.account.AccountModel.accountName;
  28. this.data.money = Format.formatWxCoin(smc.account.AccountModel.wxCoin);
  29. this.data.goldNum = smc.account.AccountModel.goldCoin;
  30. //当前时间的后三天,只要年月日
  31. // this.data.time =
  32. }
  33. }
  34. async btn_confirm() {
  35. //加载微信转账中
  36. // await oops.gui.open(UIID.WechaatTransfer);
  37. oops.gui.remove(UIID.ReservePopup);
  38. this.updateState();
  39. }
  40. updateState() {
  41. ServerHandler.inst.updatePopupState({
  42. level: smc.account.AccountModel.curLevel,
  43. type: smc.game.GameModel.popupType
  44. })
  45. }
  46. }