| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /**
- * @description 等级奖励数据
- */
- import { Data } from "../../../mk/data/Data";
- import { ExpAddType, GameProp } from "../GameData";
- const { ccclass } = cc._decorator;
- @ccclass
- export class GradeRewardData extends Data {
- //提现id
- private cashId: number;
- public changeExp = false;
- /**
- * 等级奖励提现
- * @param cb 提现回调
- */
- public async HttpCashOut(id: number) {
- this.cashId = id;
- let data = { id: this.cashId };
-
- let response = await mk.http.sendData('farmGrade/farmGradeCash', data);
- if (response.errcode != 0) {
- return null;
- }
- gData.gameData.gameData.farmGradeData = response.data.userFarmGrageRewardInfo
- //const rewardNum = Math.round(gData.blessingBag.taskRbNum * 100);
- gData.receiptNotice.receip_rmb = 30;
- mk.ui.openPanel('module/newNotice/newNotice');
- return response
- }
- /**
- * 加进度
- */
- async addGradeExp() {
- let data = { "expAddType": ExpAddType.EAT_video };
- let response = await mk.http.sendData('farmGrade/updateFarmGrageInfo', data);
- if (response.errcode != 0) {
- return;
- }
- this.changeExp = true;
- gData.gameData.gameData.gradeLevel = response.data.farmLevel;
- gData.gameData.gameData.farmExpValue = response.data.userExp;
- gData.gameData.gameData.farmGradeData = response.data.userFarmGrageRewardInfo;
- }
- }
|