| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /**
- * @description 提现数据类
- * @author kaka
- */
- import { Data } from "../../../mk/data/Data";
- import { DataEventId } from "../GameData";
- export default class CashProData extends Data {
- init_data = false;
- cashPro_type: cashProType;
- cashPro_money = 0;
- init_success = false;
- init_fail = false;
- openCashPro(type: cashProType, money) {
- this.cashPro_type = type;
- this.cashPro_money = money;
- this.init_data = true;
- mk.ui.openPanel('module/cashPro/cashPro');
- }
- async onCash() {
- let response = null;
- switch (this.cashPro_type) {
- case cashProType.blessing_bigCash:
- response = await gData.blessingBag.HttpCashBig();
- if (response && response.data.code == 1) {
- gData.cashPro.init_success = true;
- mk.data.sendDataEvent(DataEventId.fudaiFunction, `视频红包大额提现第${gData.blessingBag.taskRbId}档领取成功`)
- }
- else {
- if (response.data.count) {
- gData.tipPanelData.openCashFailTip(response.data.count);
- }
- else {
- mk.tip.pop('提现排队中,多看视频优先提现');
- }
- gData.cashPro.init_fail = true;
- }
- break;
- case cashProType.blessing_taskCash:
- response = await gData.blessingBag.HttpCashTask();
- if (response && response.data.code == 1) {
- gData.cashPro.init_success = true;
- mk.data.sendDataEvent(DataEventId.fudaiFunction, `视频红包第${gData.blessingBag.taskRbId}档领取成功`)
- }
- else {
- if (response.data.count) {
- gData.tipPanelData.openCashFailTip(response.data.count);
- }
- else {
- mk.tip.pop('提现排队中,多看视频优先提现');
- }
- gData.cashPro.init_fail = true;
- }
- break;
- }
- gData.cashNormal.getRecord();// 请求新的提现记录
- }
- }
- /** 提现类型枚举 */
- export enum cashProType {
- blessing_bigCash, //福袋大额红包提现
- blessing_taskCash, //福袋任务提现
- }
|