| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- /** 富翁银行数据类 */
- import JsbSystem from "../../../mk/system/JsbSystem";
- import { StorageKey } from "../StorageData";
- const { ccclass } = cc._decorator;
- @ccclass
- export default class SafeDepositBoxData {
- /** 保险箱配置信息 */
- richBankConfig = null
- /** 银行存入金额 */
- richBankCashAmount = 0
- /** 当前任务的id,也就是index字段 */
- currentRichBankCashTaskIndex = 0
- /** 开始银行任务后 每日观看的视频数 */
- richBankDailyVideoTimes = 0
- /** 开始银行任务后 连续登录数 */
- richbankLoginDays = 0
- /** 开始银行任务后 今日需要视频总次数 */
- richBankDailyTotelVideoTimes = 0
- /** 开始银行任务后 今日需要登陆总次数 */
- richBankTotelLoginDays = 0;
- //富翁银行正在进行过的档位
- addRichBankFinishIndex = 0;
- //是否开启任务
- isStartBankTask = 0;
- qipaoType = -1;
- freshQipao = false;
- cashRecordData = null;
- cashRecordDataLength = 0;
- isTeach = false;
- /** 现金进入富翁银行动画 */
- 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
- }
- }
- }
- getBankTaskIndexExtra(isMinusOne = false){
- let configInfo = gData.safeDepositBoxData.richBankConfig
- if (configInfo == null || configInfo == undefined) {
- return
- }
- let curIndex = gData.safeDepositBoxData.currentRichBankCashTaskIndex;
- if(isMinusOne)
- {
- 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', {});
- let response = await mk.http.sendData('newrichbank/getCashRecord', {});
- if (response && response.errcode == 0) {
- this.cashRecordData = response.data;
- this.freshQipao = true;
- }
- //福利银行教学
- if(gData.gameData.richBankTeachTag){
- gData.gameData.richBankTeachTag = false;
- if(this.cashRecordData.length > this.cashRecordDataLength){
- this.cashRecordDataLength = this.cashRecordData.length;
- this.isTeach = mk.guide.open(13);
- }
- }
- }
- setCashRecordDataLength(){
- if(this.cashRecordData){
- this.cashRecordDataLength = this.cashRecordData.length;
- }else{
- this.cashRecordDataLength = 0;
- }
- }
- }
|