mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
9
JisolGameCocos/assets/script/ui/Mode/OnHook.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode/OnHook.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "3e290ee9-c2f6-45f0-9d24-52f03fc8de30",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { ModeOnHookRankingOV } from '../../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { TD } from '../../../App';
|
||||
import GOnHookData from '../../../data/GOnHookData';
|
||||
import { TbGEntity } from '../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('OnHookRinkingItem')
|
||||
export class OnHookRinkingItem extends JNScrollViewItem<ModeOnHookRankingOV> {
|
||||
|
||||
//排名
|
||||
@property(Label)
|
||||
rinking:Label;
|
||||
|
||||
//玩家名称
|
||||
@property(Label)
|
||||
playerName:Label;
|
||||
|
||||
//关卡名称
|
||||
@property(Label)
|
||||
levelName:Label;
|
||||
|
||||
onInit(myData:ModeOnHookRankingOV){
|
||||
this.data = myData;
|
||||
|
||||
this.rinking.string = `${this.data.rank}`;
|
||||
this.playerName.string = `${this.data.playerName}`;
|
||||
|
||||
let table:{data:TbGEntity.TOnHookLevel} = TD[TD.TbGOnHookMaps.get(this.data.mapId)?.sign].get(this.data.levelId);
|
||||
if(table)
|
||||
this.levelName.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1cbc57bf-4f5e-4a96-a054-97af1394b599",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
import { API } from '../../../consts/API';
|
||||
import { TD } from '../../../App';
|
||||
import JNScrollView from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
import { OnHookRinkingItem } from './OnHookRinkingItem';
|
||||
import PlayerData from '../../../data/PlayerData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
* OnHook 排行榜
|
||||
*/
|
||||
@ccclass('OnHookRinkingView')
|
||||
export class OnHookRinkingView extends JNGLayerBase {
|
||||
|
||||
mapId:number;
|
||||
|
||||
@property(JNScrollView)
|
||||
rankings:JNScrollView;
|
||||
|
||||
@property(OnHookRinkingItem)
|
||||
myItem:OnHookRinkingItem;
|
||||
|
||||
onJNLoad(mapId?: number): void {
|
||||
|
||||
this.mapId = mapId || TD.TbGOnHookMaps.getDataList()[0].id;
|
||||
super.onJNLoad(mapId);
|
||||
|
||||
this.onInit();
|
||||
|
||||
}
|
||||
|
||||
async onInit(){
|
||||
|
||||
let ranks = await API.GOnHookRankings(this.mapId);
|
||||
|
||||
this.rankings.refreshData(ranks.filter(item => item.rank <= 10));
|
||||
let myData = ranks.filter(item => item.playerId == PlayerData.getIns().data.playerId)[0]
|
||||
if(myData)
|
||||
this.myItem.onInit(myData);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "7eb7c0ae-51dd-437d-a37f-80dfcfcfc7d2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user