|
|
@@ -91,7 +91,6 @@ export default class RedBagTask extends cc.Component {
|
|
|
onDisable() {
|
|
|
mk.ui.removeRefreshEvent(this.node);
|
|
|
mk.ad.destoryBanner();
|
|
|
- mk.guide.open(3);
|
|
|
}
|
|
|
|
|
|
update(dt) {
|
|
|
@@ -158,22 +157,21 @@ export default class RedBagTask extends cc.Component {
|
|
|
let com = gData.gameData.playerProp.userFarmTaskInfo.completeCount;
|
|
|
let count = gData.gameData.playerProp.userFarmTaskInfo.taskCount;
|
|
|
let per = com / count;
|
|
|
- if(!this.isRefreshTask)
|
|
|
- {
|
|
|
+ if (!this.isRefreshTask) {
|
|
|
cc.tween(this.sp_taskProgress).delay(0.2).to(0.2, { fillRange: per }, {
|
|
|
onUpdate: () => {
|
|
|
let num = Math.round(this.sp_taskProgress.fillRange * count);
|
|
|
this.lbl_taskProgress.string = `${num}/${count}`;
|
|
|
}
|
|
|
- }).call(()=>{
|
|
|
+ }).call(() => {
|
|
|
this.lbl_taskProgress.string = `${com}/${count}`;
|
|
|
}).start();
|
|
|
-
|
|
|
- }else{
|
|
|
+
|
|
|
+ } else {
|
|
|
this.sp_taskProgress.fillRange = per;
|
|
|
this.lbl_taskProgress.string = `${com}/${count}`;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.lbl_taskNum.string = count.toString();
|
|
|
|
|
|
let gray = this.openBtn_ani.getComponent(SetGray);
|
|
|
@@ -206,17 +204,16 @@ export default class RedBagTask extends cc.Component {
|
|
|
* 底部提现相关样式
|
|
|
*/
|
|
|
private initCashOutStyle(redMoney: number = 0) {
|
|
|
- if(redMoney == 0)
|
|
|
- {
|
|
|
+ if (redMoney == 0) {
|
|
|
redMoney = gData.gameData.playerProp.redMoney;
|
|
|
}
|
|
|
- redMoney = redMoney/100;
|
|
|
+ redMoney = redMoney / 100;
|
|
|
const cash_bar = gData.redBagCash.cash_bar;
|
|
|
let cash_data = gData.redBagCash.getItemDataByIndex(cash_bar);
|
|
|
if (!cash_data) return;
|
|
|
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.redMoney/100;
|
|
|
+ this.lbl_progress.string = newRedMoney + '/' + cash_data.redMoney / 100;
|
|
|
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();
|