|
|
@@ -15,17 +15,30 @@ export default class WalletCashOut extends cc.Component {
|
|
|
private lbl_redMoney: cc.Label = null;
|
|
|
@property({ displayName: '金额', type: cc.Label })
|
|
|
private lbl_value: cc.Label = null;
|
|
|
- @property({ displayName: '提示', type: cc.Label })
|
|
|
+ @property({ displayName: '下提示', type: cc.Label })
|
|
|
private lbl_tip: cc.Label = null;
|
|
|
|
|
|
+ @property({displayName: '提现按钮文本', type: cc.Label})
|
|
|
+ private lbl_cashOut: cc.Label = null;
|
|
|
+ @property({displayName: '新手描述', type: cc.Label})
|
|
|
+ private lbl_noviceTitle: cc.Label = null;
|
|
|
+ @property({displayName: '新手金额', type: cc.Label})
|
|
|
+ private lbl_noviceValue: cc.Label = null;
|
|
|
+ @property({ displayName: '上提示', type: cc.Label })
|
|
|
+ private lbl_tipUp: cc.Label = null;
|
|
|
+
|
|
|
@property({ displayName: '6个选择按钮', type: CheckButton })
|
|
|
private check_button: CheckButton[] = [];
|
|
|
|
|
|
private curChooseIndex: number = 0;
|
|
|
|
|
|
+ private intV: number = 0;
|
|
|
+
|
|
|
start() {
|
|
|
// mk.ad.showNative(4);
|
|
|
|
|
|
+ this.initNoviceUI();
|
|
|
+
|
|
|
let data = [{}, {}, {}, {}, {}, {}];
|
|
|
for (let i = 0; i != this.check_button.length; ++i) {
|
|
|
if (i < data.length) {
|
|
|
@@ -36,6 +49,30 @@ export default class WalletCashOut extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private initNoviceUI()
|
|
|
+ {
|
|
|
+ let data = gData.gameData.gameData.userNoviceWeFareInfo;
|
|
|
+ if(data)
|
|
|
+ {
|
|
|
+ this.lbl_noviceTitle.string = data.name + ':';
|
|
|
+ this.sp_progress.fillRange = data.progressRate;
|
|
|
+ let value = data.cashmoney / 100;
|
|
|
+ this.lbl_noviceValue.string = (value * data.progressRate).toFixed(1) + '元';
|
|
|
+ this.intV = Math.round(value);
|
|
|
+ this.lbl_tipUp.string = `进度加满后必得${this.intV}元现金`;
|
|
|
+ this.lbl_cashOut.string = `满${this.intV}元提现`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ update(dt)
|
|
|
+ {
|
|
|
+ if(gData.walletCashOutData.init_novice)
|
|
|
+ {
|
|
|
+ this.initNoviceUI();
|
|
|
+ gData.walletCashOutData.init_novice = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private clickChooseBtn(event, customEvenData) {
|
|
|
mk.audio.playEffect('button');
|
|
|
|
|
|
@@ -74,9 +111,7 @@ export default class WalletCashOut extends cc.Component {
|
|
|
mk.ad.watchAd((success: boolean) => {
|
|
|
mk.console.log("watchAD:" + success);
|
|
|
if (success) {
|
|
|
- gData.adData.watchVideo(AdFun.cashOutNoviceWelfare);
|
|
|
-
|
|
|
- // mk.ad.destroyNativeAd();
|
|
|
+ gData.walletCashOutData.addProgress();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -100,6 +135,18 @@ export default class WalletCashOut extends cc.Component {
|
|
|
|
|
|
private clickEnoughCashOutBtn() {
|
|
|
mk.audio.playEffect("button");
|
|
|
+
|
|
|
+ let data = gData.gameData.gameData.userNoviceWeFareInfo;
|
|
|
+ if(data)
|
|
|
+ {
|
|
|
+ if(data.progressRate >= 1)
|
|
|
+ {
|
|
|
+ gData.walletCashOutData.HttpCashOut(this.intV);
|
|
|
+ }else{
|
|
|
+ mk.tip.pop(`满${this.intV}元提现`);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private clickCloseBtn() {
|