龙虎榜
This commit is contained in:
parent
1e724360fd
commit
816b16ee90
@ -1037,7 +1037,7 @@
|
||||
"__id__": 378
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 387
|
||||
@ -22172,7 +22172,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -369,
|
||||
"x": -320,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -22353,7 +22353,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -190,
|
||||
"x": -140,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -22534,7 +22534,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 15,
|
||||
"x": 50,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -22715,7 +22715,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 205,
|
||||
"x": 220,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -23575,7 +23575,7 @@
|
||||
"__id__": 1106
|
||||
}
|
||||
],
|
||||
"_active": false,
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 1115
|
||||
@ -24034,7 +24034,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -369,
|
||||
"x": -320,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -24215,7 +24215,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -190,
|
||||
"x": -140,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -24396,7 +24396,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 15,
|
||||
"x": 50,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@ -24577,7 +24577,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 205,
|
||||
"x": 220,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
|
||||
@ -80,7 +80,7 @@ export class RankHistoryList extends Component {
|
||||
this.historyIndex = 1;
|
||||
|
||||
this.updateHistoryArrows();
|
||||
|
||||
this.refreshSelfRankingInfo(null);
|
||||
await this.loadHistoryData(this.currentHistoryType, this.historyIndex);
|
||||
}
|
||||
|
||||
@ -114,11 +114,10 @@ export class RankHistoryList extends Component {
|
||||
// ==================== 历史记录逻辑 ====================
|
||||
async loadHistoryData(type: string, index: number) {
|
||||
this.setRankHistoryRadioBtn(type);
|
||||
|
||||
this.refreshSelfRankingInfo(null);
|
||||
if (!this.isTypeAvailable(type)) {
|
||||
console.log(`${type} 历史榜单活动未开启`);
|
||||
this.rankHistoryLoadingNode.active = false;
|
||||
this.refreshSelfRankingInfo(null);
|
||||
this.showActivityNotOpenTip();
|
||||
return;
|
||||
}
|
||||
@ -163,7 +162,7 @@ export class RankHistoryList extends Component {
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_1').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_2').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_3').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = true;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').getComponent(Label).string = '-';
|
||||
this.selfInfo.getChildByName('Uid').getComponent(Label).string = '-';
|
||||
this.selfInfo.getChildByName('Shop').getComponent(Label).string = '-';
|
||||
|
||||
@ -77,7 +77,7 @@ export class RankList extends Component {
|
||||
this.rankList.active = true;
|
||||
this.currentRankType = '';
|
||||
this.updateRankButtonsAvailability();
|
||||
|
||||
this.refreshSelfRankingInfo(null);
|
||||
await this.switchRankTab(defaultType);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ export class RankList extends Component {
|
||||
this.currentRankType = type;
|
||||
|
||||
this.setRankRadioBtn(type);
|
||||
|
||||
this.refreshSelfRankingInfo(null);
|
||||
if (!this.isTypeAvailable(type)) {
|
||||
console.log(`${type} 榜单活动未开启`);
|
||||
this.rankLoadingNode.active = false;
|
||||
@ -132,7 +132,6 @@ export class RankList extends Component {
|
||||
}
|
||||
this.marqueeTexts = [];
|
||||
this.currentMarqueeIndex = 0;
|
||||
this.refreshSelfRankingInfo(null);
|
||||
this.showActivityNotOpenTip();
|
||||
if (this.countdownTimer) {
|
||||
clearInterval(this.countdownTimer);
|
||||
@ -183,7 +182,19 @@ export class RankList extends Component {
|
||||
console.error('获取排行榜数据失败:', error);
|
||||
this.showActivityNotOpenTip();
|
||||
Tween.stopAllByTarget(this.rankLoadingNode);
|
||||
if (this.countdownTimer) {
|
||||
clearInterval(this.countdownTimer);
|
||||
this.countdownTimer = null;
|
||||
}
|
||||
this.rankingEndTime.getComponent(Label).string = "--:--:--";
|
||||
this.rankLoadingNode.active = false;
|
||||
// 停止跑马灯
|
||||
if (this.msg_1 && this.msg_1.isValid) {
|
||||
Tween.stopAllByTarget(this.msg_1);
|
||||
this.msg_1.active = false;
|
||||
}
|
||||
this.marqueeTexts = [];
|
||||
this.currentMarqueeIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,6 +275,9 @@ export class RankList extends Component {
|
||||
this.rankingListVScroll.setTotalCount(rankInfos.List.length);
|
||||
this.rankingListVScroll.renderItemFn = (node: Node, idx: number) => {
|
||||
let itemData = rankInfos.List[idx];
|
||||
if (!itemData) {
|
||||
return;
|
||||
}
|
||||
node.getChildByName('bg').active = idx % 2 === 0;
|
||||
node.getChildByName('bg2').active = idx % 2 !== 0;
|
||||
node.getChildByName('Rank').getChildByName('sp_1').active = idx === 0;
|
||||
@ -285,7 +299,7 @@ export class RankList extends Component {
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_1').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_2').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('sp_3').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = false;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = true;
|
||||
this.selfInfo.getChildByName('Rank').getChildByName('rankLab').getComponent(Label).string = '-';
|
||||
this.selfInfo.getChildByName('Uid').getComponent(Label).string = '-';
|
||||
this.selfInfo.getChildByName('Shop').getComponent(Label).string = '-';
|
||||
|
||||
@ -67,9 +67,10 @@ export class SlotRanking extends Component {
|
||||
this.initComponents();
|
||||
|
||||
this.rankingBtn.setPosition(this.startPos);
|
||||
this.rankingBtn.active = SlotRankingDataManager.instance.getRankListStatus() === 0 || SlotRankingDataManager.instance.getRankListStatus() === 1;
|
||||
this.rankingBtn.getChildByName('icon').getComponent(sp.Skeleton).color = SlotRankingDataManager.instance.getRankListStatus() === 0 ? Color.WHITE : Color.GRAY;
|
||||
this.rankingBtn.active = SlotRankingDataManager.instance.getRankListStatus() === 0 || SlotRankingDataManager.instance.getRankListStatus() === 1 || SlotRankingDataManager.instance.getRankMaxCloseTimeIsBiggerThanCurTime();
|
||||
|
||||
this.rankingBtn.getComponent(Button).interactable = SlotRankingDataManager.instance.getRankListStatus() === 0;
|
||||
this.rankingBtn.getChildByName('icon').getComponent(sp.Skeleton).color = SlotRankingDataManager.instance.getRankListStatus() === 0 ? Color.WHITE : Color.GRAY;
|
||||
|
||||
this.rankingBtn.on(Node.EventType.TOUCH_START, this.onTouchStart, this);
|
||||
this.rankingBtn.on(Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
|
||||
@ -147,6 +148,14 @@ export class SlotRanking extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.slotScene.hasEliminate) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.rankingBtn.getComponent(Button).interactable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -13,6 +13,76 @@ export class SlotRankingDataManager {
|
||||
set rankList(list: any) { this._rankList = list; }
|
||||
get rankList(): any { return this._rankList; }
|
||||
|
||||
/**
|
||||
*
|
||||
* {
|
||||
"List": [
|
||||
{
|
||||
"Id": "20251225_day_faketrans-VND",
|
||||
"Name": "",
|
||||
"Type": "day",
|
||||
"StartTime": 1766592000,
|
||||
"EndTime": 1766689200,
|
||||
"CloseTime": 1766775600,
|
||||
"Status": 0,
|
||||
"Rewards": [
|
||||
10,
|
||||
8,
|
||||
5,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3
|
||||
],
|
||||
"SpinLimit": 10,
|
||||
"BetLimit": 1000000
|
||||
},
|
||||
{
|
||||
"Id": "20251222_week_faketrans-VND",
|
||||
"Name": "",
|
||||
"Type": "week",
|
||||
"StartTime": 1766592000,
|
||||
"EndTime": 1766678400,
|
||||
"CloseTime": 1766764800,
|
||||
"Status": 0,
|
||||
"Rewards": [
|
||||
10,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5
|
||||
],
|
||||
"SpinLimit": 10,
|
||||
"BetLimit": 5000000
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
getRankMaxCloseTimeIsBiggerThanCurTime(): boolean {
|
||||
if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) {
|
||||
// 代表当前没有活动开启,则说明关闭入口按钮
|
||||
return false;
|
||||
}
|
||||
|
||||
let maxCloseTime = 0;
|
||||
for (let item of this._rankList.List) {
|
||||
if (item.CloseTime > maxCloseTime) {
|
||||
maxCloseTime = item.CloseTime;
|
||||
}
|
||||
}
|
||||
|
||||
return Date.now() <= (maxCloseTime * 1000);
|
||||
}
|
||||
|
||||
getRankListStatus(): number {
|
||||
if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) {
|
||||
return 2;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user