| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- /** 富翁银行数据类 */
- const { ccclass } = cc._decorator;
- @ccclass
- export default class SafeDepositBoxData {
- /** 保险箱配置信息 */
- richBankConfig = null
- /** 银行存入金额 */
- richBankCashAmount = 0
- /** 当前任务的id,也就是index字段 */
- currentRichBankCashTaskIndex = 0
- /** 开始银行任务后 每日观看的视频数 */
- richBankDailyVideoTimes = 0
- /** 开始银行任务后 连续登录数 */
- richbankLoginDays = 0
- /** 开始银行任务后 今日需要视频总次数 */
- richBankDailyTotelVideoTimes = 0
- //富翁银行正在进行过的档位
- addRichBankFinishIndex = 0;
- qipaoType = -1;
- freshQipao = false;
- cashRecordData = null;
- /** 现金进入富翁银行动画 */
- creatPacketAnim(type) {
- this.qipaoType = type;
- }
- /**
- * 检查在哪个段位
- */
- getBankTaskIndex(next = false): any {
- mk.console.logSingle("getBankTaskIndex addRichBankFinishIndex:", gData.safeDepositBoxData.addRichBankFinishIndex)
- let configInfo = gData.safeDepositBoxData.richBankConfig
- if (configInfo == null || configInfo == undefined) {
- return
- }
- let curIndex = gData.safeDepositBoxData.addRichBankFinishIndex
- if (next) {
- curIndex += 1;
- }
- if (curIndex < 1) {
- curIndex = 1;
- }
- if (curIndex > configInfo.length) {
- return configInfo[configInfo.length - 1]
- }
- for (let entry of configInfo) {
- if (entry.index == curIndex) {
- return entry
- }
- }
- }
- async updateQipao() {
- await mk.time.WaitForSeconds(1);
- let response = await mk.http.sendData('richbank/getCashRecord', {});
- if (response && response.errcode == 0) {
- this.cashRecordData = response.data;
- this.freshQipao = true;
- }
- }
- }
|