|
|
@@ -61,12 +61,13 @@ export default class Reward extends cc.Component {
|
|
|
start() {
|
|
|
/** 盖子 */
|
|
|
this.initLid();
|
|
|
- gData.reward.init_cash_style = true;
|
|
|
+ // gData.gameData.gameData.redMoney = 1500;// 测试数据
|
|
|
+ this.initCashOutStyle(gData.gameData.gameData.redMoney);
|
|
|
}
|
|
|
|
|
|
update(dt) {
|
|
|
- if (gData.reward.init_cash_style) {
|
|
|
- this.initCashOutStyle();
|
|
|
+ if (gData.reward.add_redbag_value) {
|
|
|
+ this.initCashOutStyle(gData.gameData.gameData.redMoney + gData.reward.add_redbag_value);
|
|
|
}
|
|
|
if (gData.reward.adData) {
|
|
|
// 展示奖励
|
|
|
@@ -76,7 +77,7 @@ export default class Reward extends cc.Component {
|
|
|
}
|
|
|
|
|
|
lateUpdate() {
|
|
|
- gData.reward.init_cash_style = null;
|
|
|
+ gData.reward.add_redbag_value = 0;
|
|
|
gData.reward.adData = null;
|
|
|
}
|
|
|
|
|
|
@@ -107,16 +108,18 @@ export default class Reward extends cc.Component {
|
|
|
/**
|
|
|
* 底部提现相关样式
|
|
|
*/
|
|
|
- private initCashOutStyle() {
|
|
|
+ private initCashOutStyle(redMoney: number = 0) {
|
|
|
const cash_bar = gData.redBagCash.cash_bar;
|
|
|
let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
|
|
|
if (!cash_data) return;
|
|
|
|
|
|
this.lbl_cash.string = cash_data.money / 100 + '元';
|
|
|
- this.lbl_cash_out.string = gData.gameData.gameData.redMoney + '/' + cash_data.type_value;
|
|
|
- this.spr_cash_out.fillRange = gData.gameData.gameData.redMoney / cash_data.type_value;
|
|
|
+ this.lbl_cash_out.string = redMoney + '/' + cash_data.type_value;
|
|
|
+ const fillRange = redMoney / cash_data.type_value >= 1 ? 1 : redMoney / cash_data.type_value;
|
|
|
+ // this.spr_cash_out.fillRange = fillRange;
|
|
|
+ cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 看广告
|
|
|
*/
|
|
|
@@ -187,6 +190,11 @@ export default class Reward extends cc.Component {
|
|
|
this.node_luck.active = false;
|
|
|
this.node_mission.active = false;
|
|
|
this.btn_watch_video.node.active = false;
|
|
|
+
|
|
|
+ // 底部进度动画
|
|
|
+ if (gData.reward.data[0].rewardType === RewardType.redBag) {
|
|
|
+ gData.reward.add_redbag_value = gData.reward.data[0].rewardNum;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|