cb/assets/career/script/Career.ts
COMPUTER\EDY 0abe2eaf68 更新
2025-11-07 19:57:59 +08:00

63 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Utils from "../../Script/module/Pay/Utils";
const { ccclass, property } = cc._decorator;
@ccclass
export default class Career extends cc.Component {
// 游戏当日闯关排行信息
private careerInfo: any = {};
// LIFE-CYCLE CALLBACKS:
// @property(cc.SpriteAtlas)
// UI: cc.SpriteAtlas = null;
private initialTouchOffset: cc.Vec2 = null;
private offsetTolerance = 100; // 偏移容忍度;
onLoad() {
}
start() {
console.log("根据服务器信息去拿当日前6以及省市第一信息");
let careerInfo = Utils.getDailyQuestInfo(() => {
this.careerInfo = careerInfo;
this.init();
});
}
init() {
console.log("根据服务器信息去拿当日前6以及省市第一信息", this.careerInfo);
var dailyQuestInfo = this.careerInfo.dailyQuestInfo;
if (dailyQuestInfo) {
let dailyQuestInfoList = dailyQuestInfo.dailyQuestInfoList;
if (dailyQuestInfoList) {
dailyQuestInfoList.forEach((item) => {
if (item.questId == 1) {
// 当日前6
console.log("当日前6", item);
let info = {
rank: item.rank,
score: item.score,
time: item.time,
}
cc.fx.StorageMessage.setStorage("dailyQuestInfoList", info);
// 省市第一
console.log("省市第一", item);
let rankOne = {
rank: item.rank,
score: item.score,
time: item.time,
}
cc.fx.StorageMessage.setStorage("provinceQuestInfoList", info);
}
});
}
}
}
}