PigBankData.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { Data } from "../../../mk/data/Data";
  2. /**
  3. * 存钱罐数据
  4. * - 提现描述显示:
  5. * 1.判断是否可提,
  6. * 可提显示“直接提现”
  7. * 不可提判断存款是否满足提现最低限制
  8. * 满足显示:“明日提现”,
  9. * 不满足显示:“满x可提”
  10. * @author 薛鸿潇
  11. */
  12. export class PigBankData extends Data {
  13. /**
  14. * 数据初始化
  15. */
  16. public init() {
  17. // 提现状态
  18. this.cash_enable = gData.gameData.gameData.isWithdrawable;
  19. }
  20. /** 标志位:是否需要刷新数据 */
  21. public init_data: boolean = true;
  22. /** 是否可提现 */
  23. private _cash_enable: boolean = true;
  24. set cash_enable(bool: boolean) {
  25. if (this._cash_enable != bool) {
  26. this._cash_enable = bool;
  27. this.init_data = true;
  28. }
  29. }
  30. get cash_enable(): boolean {
  31. return this._cash_enable;
  32. }
  33. /** 当前存款 */
  34. private _cur_cash_count: number = 0;
  35. set cur_cash_count(value: number) {
  36. if (this._cur_cash_count != value) {
  37. this._cur_cash_count = value;
  38. this.init_data = true;
  39. }
  40. }
  41. get cur_cash_count(): number {
  42. return this._cur_cash_count;
  43. }
  44. /** 提现最低限制 */
  45. public cash_min_limit: number = 0.3;
  46. /**
  47. * 提现操作
  48. * - 此处需要对接服务端数据
  49. */
  50. public cashOP() {
  51. this.cash_enable = false;
  52. }
  53. }