|
|
@@ -1,3 +1,4 @@
|
|
|
+import { BannerAdType } from "../../data/GameData";
|
|
|
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
@@ -9,7 +10,7 @@ export default class Turnablerule extends cc.Component {
|
|
|
@property(cc.Label)
|
|
|
private lbl_reward_value: cc.Label = null;
|
|
|
@property(cc.Sprite)
|
|
|
- private spr_cash_out: cc.Sprite = null;
|
|
|
+ private spr_cash_out: cc.Sprite = null;
|
|
|
@property(cc.Label)
|
|
|
private lbl_progress: cc.Label = null;
|
|
|
@property(cc.Animation)
|
|
|
@@ -21,12 +22,12 @@ export default class Turnablerule extends cc.Component {
|
|
|
}
|
|
|
|
|
|
start() {
|
|
|
- mk.ad.showBanner();
|
|
|
-
|
|
|
+ mk.ad.showBanner(BannerAdType.banner_click_9);
|
|
|
+
|
|
|
this.initCashOutStyle(gData.gameData.gameData.redMoney);
|
|
|
}
|
|
|
|
|
|
- update(dt){
|
|
|
+ update(dt) {
|
|
|
|
|
|
if (gData.reward.add_redbag_value) {
|
|
|
this.initCashOutStyle(gData.gameData.gameData.redMoney + gData.reward.add_redbag_value);
|
|
|
@@ -36,17 +37,17 @@ export default class Turnablerule extends cc.Component {
|
|
|
/**
|
|
|
* 底部提现相关样式
|
|
|
*/
|
|
|
- private initCashOutStyle(redMoney: number = 0) {
|
|
|
+ private initCashOutStyle(redMoney: number = 0) {
|
|
|
const cash_bar = gData.redBagCash.cash_bar;
|
|
|
let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
|
|
|
if (!cash_data) return;
|
|
|
- const newRedMoney = redMoney > cash_data.type_value ? cash_data.type_value : redMoney;
|
|
|
+ const newRedMoney = redMoney > cash_data.redMoney ? cash_data.redMoney : redMoney;
|
|
|
this.lbl_reward_value.string = cash_data.money / 100 + '元';
|
|
|
- this.lbl_progress.string = newRedMoney + '/' + cash_data.type_value;
|
|
|
- const fillRange = newRedMoney / cash_data.type_value >= 1 ? 1 : newRedMoney / cash_data.type_value;
|
|
|
+ this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney;
|
|
|
+ const fillRange = newRedMoney / cash_data.redMoney >= 1 ? 1 : newRedMoney / cash_data.redMoney;
|
|
|
// this.spr_cash_out.fillRange = fillRange;
|
|
|
cc.tween(this.spr_cash_out).to(fillRange, { fillRange: fillRange }).start();
|
|
|
- if (redMoney >= cash_data.type_value) {
|
|
|
+ if (redMoney >= cash_data.redMoney) {
|
|
|
this.node_cash.play();
|
|
|
} else {
|
|
|
this.node_cash.stop();
|
|
|
@@ -56,7 +57,7 @@ export default class Turnablerule extends cc.Component {
|
|
|
/**
|
|
|
* 提现操作
|
|
|
*/
|
|
|
- private clickCashOut() {
|
|
|
+ private clickCashOut() {
|
|
|
mk.audio.playEffect("button");
|
|
|
gData.reward.addReward();
|
|
|
mk.ui.closePanel(this.node.name);
|
|
|
@@ -64,7 +65,7 @@ export default class Turnablerule extends cc.Component {
|
|
|
// mk.ui.openPanel(path);
|
|
|
}
|
|
|
|
|
|
- private onClickClose(){
|
|
|
+ private onClickClose() {
|
|
|
mk.audio.playEffect("closeButton");
|
|
|
mk.ad.destoryBanner();
|
|
|
}
|