|
|
@@ -1,3 +1,6 @@
|
|
|
+import JsbSystem from "../../../mk/system/JsbSystem";
|
|
|
+import { DataEventId } from "../../data/GameData";
|
|
|
+import { StorageKey } from "../../data/StorageData";
|
|
|
import MoneySaveItem from "./MoneySaveItem";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
@@ -152,32 +155,33 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
|
|
|
async start() {
|
|
|
if (!this.test) {
|
|
|
- let response = await mk.http.sendData('richbank/getCashRecord', {});
|
|
|
+ //let response = await mk.http.sendData('richbank/getCashRecord', {});
|
|
|
+ let response = await mk.http.sendData('newrichbank/getCashRecord', {});
|
|
|
mk.console.logSingle('getCashRecord ', response);
|
|
|
if (response && response.errcode == 0) {
|
|
|
this.updateScrollView(response.data);
|
|
|
}
|
|
|
|
|
|
- if (gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0) {
|
|
|
- let response = await mk.http.sendData('richbank/getRichBankInfo', {});
|
|
|
- mk.console.logSingle('getRichBankInfo ', response);
|
|
|
- if (response && response.errcode == 0) {
|
|
|
- if (response.data.richBankDailyVideoTimes >= 0) {
|
|
|
- gData.safeDepositBoxData.richBankDailyVideoTimes = response.data.richBankDailyVideoTimes;
|
|
|
- }
|
|
|
-
|
|
|
- if (response.data.richbankLoginDays >= 0) {
|
|
|
- gData.safeDepositBoxData.richbankLoginDays = response.data.richbankLoginDays;
|
|
|
- if (gData.safeDepositBoxData.richbankLoginDays == 0) {
|
|
|
- gData.safeDepositBoxData.richbankLoginDays = 1;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- gData.safeDepositBoxData.richBankDailyTotelVideoTimes = response.data.richBankDailyTotelVideoTimes;
|
|
|
-
|
|
|
- this.setTaskProgress();
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (gData.safeDepositBoxData.isStartBankTask > 0) {
|
|
|
+ // let response = await mk.http.sendData('richbank/getRichBankInfo', {});
|
|
|
+ // mk.console.logSingle('getRichBankInfo ', response);
|
|
|
+ // if (response && response.errcode == 0) {
|
|
|
+ // if (response.data.richBankDailyVideoTimes >= 0) {
|
|
|
+ // gData.safeDepositBoxData.richBankDailyVideoTimes = response.data.richBankDailyVideoTimes;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (response.data.richbankLoginDays >= 0) {
|
|
|
+ // gData.safeDepositBoxData.richbankLoginDays = response.data.richbankLoginDays;
|
|
|
+ // if (gData.safeDepositBoxData.richbankLoginDays == 0) {
|
|
|
+ // gData.safeDepositBoxData.richbankLoginDays = 1;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // gData.safeDepositBoxData.richBankDailyTotelVideoTimes = response.data.richBankDailyTotelVideoTimes;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // this.setTaskProgress();
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
this.initView()
|
|
|
@@ -192,11 +196,12 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
if (money == null || undefined) {
|
|
|
money = 0
|
|
|
}
|
|
|
- this.startTixian = gData.safeDepositBoxData.currentRichBankCashTaskIndex
|
|
|
+ //this.startTixian = gData.safeDepositBoxData.currentRichBankCashTaskIndex
|
|
|
+ this.startTixian = gData.safeDepositBoxData.isStartBankTask
|
|
|
if (this.startTixian > 0) {
|
|
|
this.weitixianNode.active = false
|
|
|
this.tixianzhongNode.active = true
|
|
|
- let config = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
+ let config = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
this.tixianzhongMoneyLabel.string = (config.money * 0.01).toFixed(2) + "元"
|
|
|
this.readyTixianLabel.node.active = false
|
|
|
this.tixianzhongNode.getChildByName("tixianLabel").active = true
|
|
|
@@ -209,8 +214,8 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
if (showStep) {
|
|
|
this.showInfoByStep()
|
|
|
}
|
|
|
- this.noPacketTip.getChildByName("taskLabel").active = gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0
|
|
|
- this.noPacketTip.getChildByName("noTaskLabel").active = !(gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0)
|
|
|
+ this.noPacketTip.getChildByName("taskLabel").active = gData.safeDepositBoxData.isStartBankTask > 0
|
|
|
+ this.noPacketTip.getChildByName("noTaskLabel").active = !(gData.safeDepositBoxData.isStartBankTask > 0)
|
|
|
} else {
|
|
|
this.tixianzhongNode.active = false
|
|
|
this.weitixianNode.active = true
|
|
|
@@ -244,7 +249,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
this.noPacketTip.position = cc.v3(324, -10)
|
|
|
|
|
|
let count = 0
|
|
|
- let startTixian = gData.safeDepositBoxData.currentRichBankCashTaskIndex;
|
|
|
+ let startTixian = gData.safeDepositBoxData.isStartBankTask;
|
|
|
let showFinger: boolean = startTixian > 0
|
|
|
this.itemP = await mk.loader.load('module/safeDepositBox/prefabs/MoneySaveItem', cc.Prefab);
|
|
|
for (let entry of data) {
|
|
|
@@ -269,7 +274,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
//将提现金额放入保险箱
|
|
|
async clickItemEvent(data, node) {
|
|
|
mk.audio.playEffect('button');
|
|
|
- if (gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0) {
|
|
|
+ if (gData.safeDepositBoxData.isStartBankTask > 0) {
|
|
|
mk.tip.pop("提现后可存入")
|
|
|
return
|
|
|
}
|
|
|
@@ -278,7 +283,8 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
gData.safeDepositBoxData.richBankCashAmount = gData.safeDepositBoxData.richBankCashAmount + data.amount;
|
|
|
this.saveMoneySuccess(gData.safeDepositBoxData.richBankCashAmount);
|
|
|
} else {
|
|
|
- let response = await mk.http.sendData('richbank/updateCashRecord', { "partnerTradeNo": data.partnerTradeNo })
|
|
|
+ //let response = await mk.http.sendData('richbank/updateCashRecord', { "partnerTradeNo": data.partnerTradeNo })
|
|
|
+ let response = await mk.http.sendData('newrichbank/updateCashRecord', { "partnerTradeNo": data.partnerTradeNo })
|
|
|
if (response && response.errcode == 0) {
|
|
|
gData.safeDepositBoxData.richBankCashAmount = response.data.RichBankCashAmount;
|
|
|
this.saveMoneySuccess(gData.safeDepositBoxData.richBankCashAmount);
|
|
|
@@ -314,7 +320,8 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
if (this.test) {
|
|
|
this.updateScrollView(this.packet)
|
|
|
} else {
|
|
|
- let response = await mk.http.sendData('richbank/getCashRecord', {});
|
|
|
+ //let response = await mk.http.sendData('richbank/getCashRecord', {});
|
|
|
+ let response = await mk.http.sendData('newrichbank/getCashRecord', {});
|
|
|
if (response && response.errcode == 0) {
|
|
|
this.updateScrollView(response.data);
|
|
|
}
|
|
|
@@ -327,11 +334,11 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
mk.audio.playEffect('button');
|
|
|
|
|
|
let minConfig = null;
|
|
|
- if (gData.safeDepositBoxData.currentRichBankCashTaskIndex == 0) {
|
|
|
- minConfig = gData.safeDepositBoxData.getBankTaskIndex(true);
|
|
|
+ if (gData.safeDepositBoxData.isStartBankTask == 0) {
|
|
|
+ minConfig = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
}
|
|
|
else {
|
|
|
- minConfig = gData.safeDepositBoxData.getBankTaskIndex();
|
|
|
+ minConfig = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
}
|
|
|
|
|
|
let richBankCashAmount = gData.safeDepositBoxData.richBankCashAmount
|
|
|
@@ -345,7 +352,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- let totaldays = minConfig.loginTimes
|
|
|
+ let totaldays = gData.safeDepositBoxData.richBankTotelLoginDays
|
|
|
// let totalVideoTimes = minConfig.videotimes
|
|
|
this.tipLogin.string = "1、连续登陆" + totaldays + "天"
|
|
|
this.tipPlayVideo.string = "2、每天观看指定数量的视频"
|
|
|
@@ -367,34 +374,42 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
//点开始任务
|
|
|
async confirmStartTixian() {
|
|
|
mk.audio.playEffect('button');
|
|
|
- let config = gData.safeDepositBoxData.getBankTaskIndex(true);
|
|
|
- if (!config) {
|
|
|
- mk.console.logSingle("SafeDepositBox", "can not confirmStartTixian")
|
|
|
- return
|
|
|
- }
|
|
|
+ // let config = gData.safeDepositBoxData.getBankTaskIndex(true);
|
|
|
+ // if (!config) {
|
|
|
+ // mk.console.logSingle("SafeDepositBox", "can not confirmStartTixian")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
this.confirmTixianNode.active = false
|
|
|
this.boxNode.stopAllActions()
|
|
|
this.boxNode.x = 161
|
|
|
this.boxNode.y = 0
|
|
|
this.content.active = true
|
|
|
if (this.test) {
|
|
|
+ gData.safeDepositBoxData.isStartBankTask = 1;
|
|
|
this.updateBankTask(1);
|
|
|
} else {
|
|
|
- let response = await mk.http.sendData('richbank/openCashTask', { "index": config.index });
|
|
|
+ //let response = await mk.http.sendData('richbank/openCashTask', { "index": config.index });
|
|
|
+ //let response = await mk.http.sendData('richbank/openCashTask', {});
|
|
|
+ let response = await mk.http.sendData('newrichbank/openCashTask', {});
|
|
|
mk.console.logSingle('openCashTask ', response);
|
|
|
if (response && response.errcode == 0) {
|
|
|
gData.safeDepositBoxData.richBankDailyTotelVideoTimes = response.data.richBankDailyTotelVideoTimes;
|
|
|
- this.updateBankTask(config.index);
|
|
|
+ gData.safeDepositBoxData.isStartBankTask = response.data.isStartRichBankTask;
|
|
|
+ gData.safeDepositBoxData.richBankTotelLoginDays = response.data.richBankTotelLoginDays;
|
|
|
+ console.log(`openCashTask=====${response.data.richBankDailyTotelVideoTimes}=======${response.data.isStartBankTask}`);
|
|
|
+ console.log(`openCashTask=====${gData.safeDepositBoxData.richBankTotelLoginDays}`);
|
|
|
+ this.updateBankTask(1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
updateBankTask(index) {
|
|
|
- gData.safeDepositBoxData.currentRichBankCashTaskIndex = index;
|
|
|
- gData.safeDepositBoxData.addRichBankFinishIndex = gData.safeDepositBoxData.currentRichBankCashTaskIndex;
|
|
|
+ // gData.safeDepositBoxData.currentRichBankCashTaskIndex = index;
|
|
|
+ // gData.safeDepositBoxData.addRichBankFinishIndex = gData.safeDepositBoxData.currentRichBankCashTaskIndex;
|
|
|
gData.safeDepositBoxData.richbankLoginDays = 1
|
|
|
- gData.safeDepositBoxData.richBankDailyVideoTimes = 0
|
|
|
+ // gData.safeDepositBoxData.richBankDailyVideoTimes = 0
|
|
|
mk.storage.setStorage("bankTaskStartTime", Date.now())
|
|
|
+ mk.storage.setStorage(StorageKey.richBankAddLoginDays, gData.safeDepositBoxData.richBankTotelLoginDays);
|
|
|
this.initView(true)
|
|
|
mk.data.sendDataEvent("Bank", "开始任务")
|
|
|
|
|
|
@@ -455,11 +470,11 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
console.log("checkCurrentCanStartTask money:" + money)
|
|
|
|
|
|
let minConfig = null;
|
|
|
- if (gData.safeDepositBoxData.currentRichBankCashTaskIndex == 0) {
|
|
|
- minConfig = gData.safeDepositBoxData.getBankTaskIndex(true);
|
|
|
+ if (gData.safeDepositBoxData.isStartBankTask == 0) {
|
|
|
+ minConfig = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
}
|
|
|
else {
|
|
|
- minConfig = gData.safeDepositBoxData.getBankTaskIndex();
|
|
|
+ minConfig = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
}
|
|
|
|
|
|
console.log("checkCurrentCanStartTask minConfig.index:" + minConfig.index)
|
|
|
@@ -478,8 +493,8 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
this.readyTixianBtn.interactable = true
|
|
|
outLine.color = cc.color(181, 140, 59)
|
|
|
showMoney = Math.floor(minConfig.money / 100) > 0 ? (minConfig.money / 100) + "" : (minConfig.money / 100).toFixed(2)
|
|
|
-
|
|
|
- mk.guide.open(5);
|
|
|
+ console.log("=================checkCurrentCanStartTask");
|
|
|
+ //mk.guide.open(13);
|
|
|
} else {
|
|
|
console.log("checkCurrentCanStartTask minConfig.index: money < minMoney")
|
|
|
this.readyTixianBtn.node.getComponent(cc.Sprite).spriteFrame = this.spriteFrameList[1]
|
|
|
@@ -490,32 +505,33 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
|
|
|
async clickLingqu() {
|
|
|
mk.audio.playEffect('button');
|
|
|
- let config = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
+ let config = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
this.labMoeny.string = "¥" + (config.money * 0.01).toFixed(2)
|
|
|
if (this.test) {
|
|
|
this.updateBankCash(null)
|
|
|
} else {
|
|
|
this.loadPart.active = true
|
|
|
this.spot1.play('load', 0);
|
|
|
- let response = await mk.http.sendData('richbank/richbankcash', {
|
|
|
- "index": config.index,
|
|
|
- 'appVersion': gData.appData.appVersion
|
|
|
- });
|
|
|
-
|
|
|
+ //let response = await mk.http.sendData('richbank/richbankcash', {});
|
|
|
+ let response = await mk.http.sendData('newrichbank/richbankcash', {});
|
|
|
if (response) {
|
|
|
if (response.errcode == 0) {
|
|
|
this.updateBankCash(response.data);
|
|
|
}
|
|
|
else {
|
|
|
this.loadPart.active = false;
|
|
|
- if (response.data.count) {
|
|
|
- gData.lineUpUIData.popType = 1;
|
|
|
- gData.lineUpUIData.personCount = response.data.count;
|
|
|
- mk.ui.openPanel("module/newNotice/lineUpUI");
|
|
|
- }
|
|
|
- else {
|
|
|
- mk.tip.pop('提现排队中,多看视频优先提现');
|
|
|
+ if (response.errcode == 405) {
|
|
|
+ mk.tip.pop("今日提现额度已到上限,请明天再提现");
|
|
|
+ mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
|
|
|
}
|
|
|
+ // if (response.data.count) {
|
|
|
+ // gData.lineUpUIData.popType = 1;
|
|
|
+ // gData.lineUpUIData.personCount = response.data.count;
|
|
|
+ // mk.ui.openPanel("module/newNotice/lineUpUI");
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // mk.tip.pop('提现排队中,多看视频优先提现');
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -533,35 +549,47 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- gData.safeDepositBoxData.currentRichBankCashTaskIndex = 0
|
|
|
+ let config = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
+
|
|
|
+ gData.safeDepositBoxData.currentRichBankCashTaskIndex = data.currentRichBankCashTaskIndex;
|
|
|
+ console.log(`currentRichBankCashTaskIndex 222======== ${data.currentRichBankCashTaskIndex}`);
|
|
|
gData.safeDepositBoxData.richbankLoginDays = 1
|
|
|
gData.safeDepositBoxData.richBankDailyVideoTimes = 0
|
|
|
+ gData.safeDepositBoxData.isStartBankTask = 0;
|
|
|
//计算提现后,银行内剩余的
|
|
|
- let currentConfig = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
- gData.safeDepositBoxData.richBankCashAmount = gData.safeDepositBoxData.richBankCashAmount - currentConfig.money
|
|
|
+ //let currentConfig = gData.safeDepositBoxData.getBankTaskIndexExtra(true);
|
|
|
+ gData.safeDepositBoxData.richBankCashAmount = gData.safeDepositBoxData.richBankCashAmount - config.money
|
|
|
if (gData.safeDepositBoxData.richBankCashAmount < 0) {
|
|
|
gData.safeDepositBoxData.richBankCashAmount = 0
|
|
|
}
|
|
|
|
|
|
mk.data.sendDataEvent("Bank", "银行-任务全部完成")
|
|
|
this.tixianSuccess(true);
|
|
|
+ gData.receiptNotice.receip_rmb = config.money;
|
|
|
+ mk.ui.openPanel('module/newNotice/newNotice');
|
|
|
+
|
|
|
+ cc.sys.localStorage.removeItem(StorageKey.richBankAddLoginDays);
|
|
|
|
|
|
gData.safeDepositBoxData.updateQipao();
|
|
|
+ gData.cashNormal.getRecord();
|
|
|
//累计成功提现次数
|
|
|
mk.data.setTAEventUser(1, 'cash_time', 1);
|
|
|
//累计提现金额
|
|
|
mk.data.setTAEventUser(1, 'cash_total', cashMoney);
|
|
|
|
|
|
+ mk.data.sendDataEvent(DataEventId.Sundry, "富翁银行提现");
|
|
|
// if (data.CashMode == 2) {
|
|
|
// gData.redCodeData.openRedCode(cashMoney, data.withdrawalCode);
|
|
|
// mk.data.sendDataEvent('Bank', '公众号提现-富翁银行')
|
|
|
// }
|
|
|
+
|
|
|
+ JsbSystem.deleteTags("富翁银行完成当天的任务");
|
|
|
}
|
|
|
|
|
|
tixianSuccess(showPro) {
|
|
|
this.loadPart.active = false
|
|
|
if (showPro) {
|
|
|
- this.cashPro.active = true
|
|
|
+ //this.cashPro.active = true
|
|
|
gData.adData.checkShowFullInter(1);
|
|
|
}
|
|
|
|
|
|
@@ -570,32 +598,32 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
|
|
|
tixianFail() {
|
|
|
this.loadPart.active = false
|
|
|
- mk.ui.hideUI(this.cashPro);
|
|
|
+ //mk.ui.hideUI(this.cashPro);
|
|
|
}
|
|
|
|
|
|
hideTixianNode() {
|
|
|
mk.audio.playEffect('button');
|
|
|
- mk.ui.hideUI(this.cashPro);
|
|
|
+ //mk.ui.hideUI(this.cashPro);
|
|
|
}
|
|
|
|
|
|
closeTixianNode() {
|
|
|
mk.audio.playEffect('button');
|
|
|
- mk.ui.hideUI(this.cashPro);
|
|
|
+ //mk.ui.hideUI(this.cashPro);
|
|
|
}
|
|
|
|
|
|
setTaskProgress() {
|
|
|
let richBankDailyVideoTimes = gData.safeDepositBoxData.richBankDailyVideoTimes
|
|
|
let richbankLoginDays = gData.safeDepositBoxData.richbankLoginDays
|
|
|
|
|
|
- let currentConfig = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
- if (currentConfig == null || currentConfig == undefined) {
|
|
|
- return
|
|
|
- }
|
|
|
+ // let currentConfig = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
+ // if (currentConfig == null || currentConfig == undefined) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
- let totaldays = currentConfig.loginTimes
|
|
|
+ let totaldays = gData.safeDepositBoxData.richBankTotelLoginDays;//currentConfig.loginTimes
|
|
|
let progress = "(" + richbankLoginDays + "/" + totaldays + ")"
|
|
|
this.labDes.string = `连续完成${totaldays}日的每日任务即可提现\n任意一日未完成将重置提现进度`;
|
|
|
- this.loginProgress.string = "<color=#a87921>1.登陆游戏</>"
|
|
|
+ this.loginProgress.string = "<color=#a87921>1.连续登陆" + progress + "</>";
|
|
|
if (richbankLoginDays < totaldays) {
|
|
|
this.logDaysNode.getChildByName("labelNode").active = true
|
|
|
this.logDaysNode.getChildByName("gou").active = false
|
|
|
@@ -643,7 +671,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
let lastDateStr = mk.storage.getStorage("showBankTaskSuccess")
|
|
|
if (lastDateStr != null && lastDateStr != undefined) {
|
|
|
let lastDate = new Number(lastDateStr).valueOf()
|
|
|
- if (!this.checkSameDay(lastDate)) {
|
|
|
+ if (!gData.safeDepositBoxData.checkSameDay(lastDate)) {
|
|
|
this.scheduleOnce(() => {
|
|
|
this.showCompleteNode()
|
|
|
}, 0.3)
|
|
|
@@ -656,18 +684,31 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
}
|
|
|
}
|
|
|
//提示任务中断
|
|
|
- if (richbankLoginDays <= 1) {
|
|
|
+ if (richbankLoginDays <= 1 && richBankDailyVideoTimes == 0) {
|
|
|
//任务中断的情况
|
|
|
let showBankTaskRestart = mk.storage.getStorage("showBankTaskRestart")
|
|
|
- let same = this.checkSameDay(new Number(showBankTaskRestart).valueOf())
|
|
|
-
|
|
|
+ console.log(`1=======${showBankTaskRestart}`);
|
|
|
+ let same = gData.safeDepositBoxData.checkSameDay(new Number(showBankTaskRestart).valueOf())
|
|
|
+ console.log(`2=======${same}`);
|
|
|
let bankTaskStartTime = mk.storage.getStorage("bankTaskStartTime")
|
|
|
- let startTimeSame = this.checkSameDay(new Number(bankTaskStartTime).valueOf())
|
|
|
+ console.log(`3=======${bankTaskStartTime}`);
|
|
|
+ let startTimeSame = gData.safeDepositBoxData.checkSameDay(new Number(bankTaskStartTime).valueOf())
|
|
|
+ console.log(`4=======${startTimeSame}`);
|
|
|
if (!same && !startTimeSame) {
|
|
|
this.scheduleOnce(() => {
|
|
|
this.showRestartTaskNode()
|
|
|
}, 0.3)
|
|
|
-
|
|
|
+ }
|
|
|
+ }else if(richbankLoginDays > 1)
|
|
|
+ {
|
|
|
+ let lastNeedLogindays = mk.storage.getStorage(StorageKey.richBankAddLoginDays);
|
|
|
+ if(lastNeedLogindays){
|
|
|
+ let day = parseInt(lastNeedLogindays);
|
|
|
+ if(day < gData.safeDepositBoxData.richBankTotelLoginDays){
|
|
|
+ gData.gameData.richBankAddLoginDays = gData.safeDepositBoxData.richBankTotelLoginDays- day;
|
|
|
+ mk.ui.openPanel('module/newNotice/richBankWarmPrompt');
|
|
|
+ }
|
|
|
+ mk.storage.setStorage(StorageKey.richBankAddLoginDays, gData.safeDepositBoxData.richBankTotelLoginDays);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -678,7 +719,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
// return
|
|
|
// }
|
|
|
this.ruleNode.active = true
|
|
|
- let config = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
+ let config = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
let money = config.money
|
|
|
let showMoney = Math.floor(money / 100) > 0 ? (money / 100) + "" : (money / 100).toFixed(2)
|
|
|
this.rulelabel.string = "2、存入金额达到" + showMoney + "元可开启提现"
|
|
|
@@ -689,19 +730,7 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
mk.audio.playEffect('button');
|
|
|
this.ruleNode.active = false
|
|
|
}
|
|
|
- /**
|
|
|
- * 当前时间和目标时间是否是同一天
|
|
|
- * @param targetTime 记录的时间戳
|
|
|
- */
|
|
|
- checkSameDay(targetTime: number): boolean {
|
|
|
- let currentDay = new Date().getDate()
|
|
|
- let lastData = new Date(targetTime).getDate()
|
|
|
- if (currentDay == lastData) {
|
|
|
- return true
|
|
|
- }
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
showInfoByStep() {
|
|
|
let count = 0
|
|
|
for (let entry of this.taskStartNodeList) {
|
|
|
@@ -729,24 +758,42 @@ export default class SafeDepositBox extends cc.Component {
|
|
|
|
|
|
clickBoxShowTip() {
|
|
|
mk.audio.playEffect('button');
|
|
|
- let config = gData.safeDepositBoxData.getBankTaskIndex()
|
|
|
+ let config = gData.safeDepositBoxData.getBankTaskIndexExtra();
|
|
|
let money = config.money
|
|
|
let showMoney = Math.floor(money / 100) > 0 ? (money / 100) + "" : (money / 100).toFixed(2)
|
|
|
|
|
|
let str = "存款达到" + showMoney + "元可提现哦"
|
|
|
- if (gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0) {
|
|
|
+ if (gData.safeDepositBoxData.isStartBankTask > 0) {
|
|
|
str = "完成任务可提现,加油哦!"
|
|
|
}
|
|
|
mk.tip.pop(str)
|
|
|
}
|
|
|
|
|
|
showNoPacket() {
|
|
|
- this.noPacketTip.getChildByName("taskLabel").active = gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0
|
|
|
- this.noPacketTip.getChildByName("noTaskLabel").active = !(gData.safeDepositBoxData.currentRichBankCashTaskIndex > 0)
|
|
|
+ this.noPacketTip.getChildByName("taskLabel").active = gData.safeDepositBoxData.isStartBankTask > 0
|
|
|
+ this.noPacketTip.getChildByName("noTaskLabel").active = !(gData.safeDepositBoxData.isStartBankTask > 0)
|
|
|
this.noPacketTip.active = true
|
|
|
let moveNode = this.noPacketTip
|
|
|
let x = moveNode.x
|
|
|
let y = moveNode.y
|
|
|
moveNode.runAction(cc.repeatForever(cc.sequence(cc.moveTo(1.5, cc.v2(x, y - 5)), cc.moveTo(1.5, cc.v2(x - 5, y - 5)), cc.moveTo(1.2, cc.v2(x, y + 5)))))
|
|
|
}
|
|
|
+
|
|
|
+ clickCloseBtn(){
|
|
|
+ if(gData.safeDepositBoxData.isTeach){
|
|
|
+ gData.safeDepositBoxData.isTeach = false;
|
|
|
+
|
|
|
+ if(gData.gameData.funOpenData[14] == "0"){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let isPop = mk.storage.getStorage(StorageKey.isPopSet);
|
|
|
+ if(!isPop || isPop == "0"){
|
|
|
+ let is = JsbSystem.getNotificationEnabled();
|
|
|
+ if(!is){
|
|
|
+ mk.ui.openPanel("module/newNotice/permissionWarmPrompt");
|
|
|
+ mk.storage.setStorage(StorageKey.isPopSet, "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|