|
@@ -35,13 +35,18 @@ export default class SpeedUpUI extends cc.Component {
|
|
|
if (gData.reward.add_redbag_value) {
|
|
if (gData.reward.add_redbag_value) {
|
|
|
this.initCashOutStyle(gData.gameData.playerProp.redMoney + gData.reward.add_redbag_value);
|
|
this.initCashOutStyle(gData.gameData.playerProp.redMoney + gData.reward.add_redbag_value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (gData.gameData.init_speedup) {
|
|
|
|
|
+ gData.gameData.init_speedup = false;
|
|
|
|
|
+ this.lbl_remainTimes.string = `今日剩余次数:${gData.gameData.playerProp.speedUpLeftTimes}`;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 底部提现相关样式
|
|
* 底部提现相关样式
|
|
|
*/
|
|
*/
|
|
|
private initCashOutStyle(redMoney: number = 0) {
|
|
private initCashOutStyle(redMoney: number = 0) {
|
|
|
- redMoney = redMoney/100;
|
|
|
|
|
|
|
+ redMoney = redMoney / 100;
|
|
|
const cash_bar = gData.redBagCash.cash_bar;
|
|
const cash_bar = gData.redBagCash.cash_bar;
|
|
|
let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
|
|
let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
|
|
|
if (!cash_data) return;
|
|
if (!cash_data) return;
|
|
@@ -79,13 +84,14 @@ export default class SpeedUpUI extends cc.Component {
|
|
|
if (gData.gameData.checkCanSpeedUp()) {
|
|
if (gData.gameData.checkCanSpeedUp()) {
|
|
|
mk.ui.closePanel(this.node.name);
|
|
mk.ui.closePanel(this.node.name);
|
|
|
mk.ad.videoAdType = VideoAdType.video_init_14;
|
|
mk.ad.videoAdType = VideoAdType.video_init_14;
|
|
|
|
|
+ let self = this;
|
|
|
mk.ad.watchAd(async (success) => {
|
|
mk.ad.watchAd(async (success) => {
|
|
|
if (success) {
|
|
if (success) {
|
|
|
gData.adData.watchVideo(null);
|
|
gData.adData.watchVideo(null);
|
|
|
let response = await mk.http.sendData('farmSpeedUp', {});
|
|
let response = await mk.http.sendData('farmSpeedUp', {});
|
|
|
- if (response && response.errcore == 0) {
|
|
|
|
|
|
|
+ if (response && response.errcode == 0) {
|
|
|
gData.gameData.playerProp.speedUpLeftTimes = response.data.speedUpLeftTimes;
|
|
gData.gameData.playerProp.speedUpLeftTimes = response.data.speedUpLeftTimes;
|
|
|
- this.lbl_remainTimes.string = `今日剩余次数:${gData.gameData.playerProp.speedUpLeftTimes}`;
|
|
|
|
|
|
|
+ gData.gameData.init_speedup = true;
|
|
|
}
|
|
}
|
|
|
gData.gameData.setHarvest();
|
|
gData.gameData.setHarvest();
|
|
|
mk.tip.pop('加速成功!');
|
|
mk.tip.pop('加速成功!');
|