Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb
This commit is contained in:
commit
753d4c6a9a
|
@ -815,6 +815,9 @@ export default class GameManager extends cc.Component {
|
||||||
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
||||||
cc.fx.GameConfig.GM_INFO.doubleCoin = 1;
|
cc.fx.GameConfig.GM_INFO.doubleCoin = 1;
|
||||||
}
|
}
|
||||||
|
//本地储存当前服务器时间
|
||||||
|
let dateStr = new Date(data.data.monthCardTime);
|
||||||
|
cc.fx.StorageMessage.setStorage("mCardDate", dateStr);
|
||||||
//console.log(cc.fx.GameConfig.GM_INFO.hp_Max, "00000000000");
|
//console.log(cc.fx.GameConfig.GM_INFO.hp_Max, "00000000000");
|
||||||
}
|
}
|
||||||
//复活购买次数初始化
|
//复活购买次数初始化
|
||||||
|
|
|
@ -265,20 +265,13 @@ export default class JiaZai extends cc.Component {
|
||||||
console.log("________________1");
|
console.log("________________1");
|
||||||
this.getMonthlyCardValidityDays();
|
this.getMonthlyCardValidityDays();
|
||||||
this.rewarded();
|
this.rewarded();
|
||||||
console.log('月卡剩余天数 (零点刷新):', cc.fx.GameConfig.GM_INFO.monthTime);
|
this.checkExpiration();
|
||||||
Utils.getMonthlyCard((data) => {
|
|
||||||
if (data.code == 1) {
|
|
||||||
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
|
|
||||||
cc.fx.GameConfig.GM_INFO.doubleCoin = 2;
|
|
||||||
} else {
|
|
||||||
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
|
||||||
cc.fx.GameConfig.GM_INFO.doubleCoin = 1;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (cc.fx.GameConfig.GM_INFO.level >= 16 && JiaZai.cachedMonthlyCardPrefab) {
|
if (cc.fx.GameConfig.GM_INFO.level >= 16 && JiaZai.cachedMonthlyCardPrefab) {
|
||||||
this.monthH();
|
this.monthH();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 打开heath弹窗,创建预制体并启动自己的倒计时
|
// 打开heath弹窗,创建预制体并启动自己的倒计时
|
||||||
openHeath() {
|
openHeath() {
|
||||||
let health = cc.instantiate(this.health);
|
let health = cc.instantiate(this.health);
|
||||||
|
@ -1093,6 +1086,25 @@ export default class JiaZai extends cc.Component {
|
||||||
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
|
cc.fx.GameTool.shushu_Track("resource_get", dataTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断过期
|
||||||
|
checkExpiration() {
|
||||||
|
let dateStr = cc.fx.StorageMessage.getStorage("mCardDate");
|
||||||
|
if (dateStr) {
|
||||||
|
//将字符串转换为时间戳
|
||||||
|
let dateTime = new Date(dateStr).getTime();
|
||||||
|
//当前时间转换为时间戳
|
||||||
|
let currentTime = new Date().getTime();
|
||||||
|
if (dateTime > currentTime) {
|
||||||
|
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
|
||||||
|
cc.fx.GameConfig.GM_INFO.doubleCoin = 2;
|
||||||
|
} else {
|
||||||
|
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
|
||||||
|
cc.fx.GameConfig.GM_INFO.doubleCoin = 1;
|
||||||
|
}
|
||||||
|
console.log("月卡过期时间", dateTime, "当前时间", currentTime,);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//检测当日是否有分享行为,用不用主动获取分享关卡信息
|
//检测当日是否有分享行为,用不用主动获取分享关卡信息
|
||||||
checkShare() {
|
checkShare() {
|
||||||
const otherInfo = cc.fx.StorageMessage.getStorage("otherLevel");
|
const otherInfo = cc.fx.StorageMessage.getStorage("otherLevel");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user