Commit 70c58532 authored by 王杰's avatar 王杰

feat: 排行榜

parent e6df2de8
......@@ -158,8 +158,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -300,
"y": 47,
"x": -305.38,
"y": 63.13999999999993,
"z": 0
},
"_lrot": {
......@@ -199,7 +199,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 57.59999084472656,
"width": 0,
"height": 126
},
"_anchorPoint": {
......@@ -235,11 +235,11 @@
"b": 0,
"a": 255
},
"_string": "0",
"_string": "",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 100,
"_fontSize": 100,
"_actualFontSize": 60,
"_fontSize": 60,
"_fontFamily": "Arial",
"_lineHeight": 100,
"_overflow": 0,
......@@ -298,9 +298,9 @@
},
"_alignFlags": 9,
"_target": null,
"_left": 45,
"_left": 39.620000000000005,
"_right": 0,
"_top": 120,
"_top": 103.86000000000007,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -532,7 +532,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": -300,
"y": -24.53000000000003,
"y": -8.390000000000043,
"z": 0
},
"_lrot": {
......@@ -673,7 +673,7 @@
"_target": null,
"_left": 45,
"_right": 0,
"_top": 241.93000000000004,
"_top": 225.79000000000005,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......
......@@ -25,7 +25,7 @@ export default class RankPosterPanel extends Panel {
console.log("RankPosterPanel", this.data);
this.rankIndex.string = `${this.data.rankIndex > 200 ? "200+" : this.data.rankIndex ? this.data.rankIndex : 0}`;
this.rankIndex.string = this.data.rankIndex
this.rankName.string = `${this.data.rankName}`;
this.qrcode.spriteFrame = shareStore.inviteInfo.qrCode;
this.scheduleOnce(this.copyRenderTex, 0.5);
......
......@@ -94,9 +94,18 @@ export class RankScence extends Scene {
currentTime = 0;
isCountingDown = true;
shengMyRank = 0;
singleMyRank = 0;
friendMyRank = 0;
shengMyRank = {
index: 0,
score: 0
};
singleMyRank = {
index: 0,
score: 0
};
friendMyRank = {
index: 0,
score: 0
};
onLoad() {
this.tab = TAB.SINGLE;
......@@ -174,8 +183,34 @@ export class RankScence extends Scene {
const rankLog = (this.tab == TAB.SHENG) ? 13 : (this.tab == TAB.SINGLE) ? 14 : 15;
sendLog(LOG_TYPE.CLICK, rankLog)
const rankIndex = (this.tab == TAB.SHENG) ? this.shengMyRank : (this.tab == TAB.SINGLE) ? this.singleMyRank : this.friendMyRank;
const rankName = (this.tab == TAB.SHENG) ? "省份榜" : (this.tab == TAB.SINGLE) ? "个人榜" : "好友榜";
let rankIndex
let rankName
if (this.tab == TAB.SHENG) {
rankName = "省份榜"
if (this.shengMyRank?.index) {
rankIndex = this.shengMyRank.index > 200 ? "200+" : this.shengMyRank.index
} else {
rankIndex = "暂无排名"
}
}
if (this.tab == TAB.SINGLE) {
rankName = "个人榜"
if (this.singleMyRank?.index) {
rankIndex = this.singleMyRank.index > 200 ? "200+" : this.singleMyRank.index
} else {
rankIndex = "暂无排名"
}
}
if (this.tab == TAB.FRIEND) {
rankName = "好友榜"
if (this.friendMyRank?.index) {
console.log("我看看这里的index呢?");
rankIndex = this.friendMyRank.index > 1000 ? "1000+" : this.friendMyRank.index
} else {
rankIndex = "暂无排名"
}
}
showPanel(RankPosterPanel, { rankName: rankName, rankIndex: rankIndex })
});
......@@ -201,12 +236,11 @@ export class RankScence extends Scene {
if (!success) return;
this.shengDate = data.rankInfos;
console.log(data.provinceEntryScore);
this.Sheng_title.string = `超过${data.provinceEntryScore}长度的玩家数`;
this.Sheng_List.reloadData();
this.onMyCellDisplay(this.Sheng_MY, data.myRankInfo);
this.shengMyRank = data.myRankInfo?.index;
this.onMyCellDisplay(this.Sheng_MY, data.myRankInfo, "SHENG");
this.shengMyRank = data.myRankInfo
this.Sheng_List.node.active = this.shengDate.length > 0;
this.Sheng_List_None.active = this.shengDate.length <= 0; // 如果没有数据隐藏
......@@ -221,8 +255,8 @@ export class RankScence extends Scene {
this.Single_List.reloadData();
this.PrizeDate = data.awardConfigs;
this.Prize_List.reloadData();
this.onMyCellDisplay(this.Single_MY, data.myRankInfo);
this.singleMyRank = data.myRankInfo?.index;
this.onMyCellDisplay(this.Single_MY, data.myRankInfo, "SINGLE");
this.singleMyRank = data.myRankInfo
this.Single_List.node.active = this.singleDate.length > 0;
this.Single_List_None.active = this.singleDate.length <= 0; // 如果没有数据隐藏
......@@ -237,8 +271,8 @@ export class RankScence extends Scene {
this.friendDate = data.rankInfos;
this.Friend_List.reloadData();
this.onMyCellDisplay(this.Friend_MY, data.myRankInfo);
this.friendMyRank = data.myRankInfo?.index;
this.onMyCellDisplay(this.Friend_MY, data.myRankInfo, "FRIEND");
this.friendMyRank = data.myRankInfo
this.Friend_List.node.active = this.friendDate.length > 0;
this.Friend_List_None.active = this.friendDate.length <= 0;
......@@ -270,40 +304,43 @@ export class RankScence extends Scene {
let rankTxt = index;
if (!score && (!index || index == -1)) {
if (score && (!index || index == -1)) {
rankTxt = "-";
}
if ((score && (!index || index == -1)) || index > 200) {
if (this.tab != TAB.FRIEND && index > 200) {
rankTxt = "200+";
}
if (this.tab == TAB.FRIEND && index > 1000) {
rankTxt = "1000+";
}
cell.getChildByName(`rank`).getComponent(Label).string = rankTxt;
cell.getChildByName(`sheng`).getComponent(Label).string = province || strFormat(`${nickname || "鸣鸣很忙用户"}`, 12);
cell.getChildByName(`length`).getComponent(Label).string = (score > 99999999 ? "99999999+" : score) || "0";
}
onMyCellDisplay = (cell: Node, data) => {
onMyCellDisplay = (cell: Node, data, tab) => {
if (!data) return
let { index = 0, province = "", score = 0, nickname = "" } = data;
let rankTxt = index;
if (!score && (!index || index == -1)) {
if (score && (!index || index == -1)) {
rankTxt = "-";
}
if ((score && (!index || index == -1)) || index > 200) {
if (tab != TAB.FRIEND && index > 200) {
rankTxt = "200+";
}
if (tab == TAB.FRIEND && index > 1000) {
rankTxt = "1000+";
}
cell.getChildByName(`rank`).getComponent(Label).string = rankTxt;
cell.getChildByName(`sheng`).getComponent(Label).string = province || strFormat(`${nickname || "鸣鸣很忙用户"}`, 12) + "(我)";
cell.getChildByName(`length`).getComponent(Label).string = (score > 99999999 ? "99999999+" : score) || "0";
}
onPrizeCellDisplay = (cell: Node, data) => {
if (!data) return
......
......@@ -98,14 +98,14 @@
</style>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/assets/plugin/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/assets/plugin/declare-process.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/assets/plugin/SVGA.Lite.v2.1.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/assets/plugin/jszip.min.v3.10.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/assets/plugin/rem.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/assets/plugin/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/assets/plugin/declare-process.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/assets/plugin/SVGA.Lite.v2.1.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/assets/plugin/jszip.min.v3.10.1.js"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/assets/plugin/rem.min.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/style.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/custom.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/style.css" />-->
<!-- <link rel="stylesheet" type="text/css" href="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/custom.css" />-->
<!-- <script src="//yun-duiba-credits-test.duibatest.com.cn/TNGD_GAMES/libs/eruda.min.js"></script>-->
<!-- <script>eruda.init()</script>-->
......@@ -118,20 +118,20 @@
</div>
<!-- Polyfills bundle. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/polyfills.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/polyfills.bundle.js" charset="utf-8"></script>
<!-- SystemJS support. -->
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/system.bundle.js" charset="utf-8"></script>
<script src="//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/system.bundle.js" charset="utf-8"></script>
<!-- Import map -->
<!--<script src="https://yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>-->
<!--<script src="https://yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/src/import-map.json" type="systemjs-importmap" charset="utf-8"></script>-->
<script type="systemjs-importmap" charset="utf-8">
{"imports":{"cc":"//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/cocos-js/cc.js"}}
{"imports":{"cc":"//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/cocos-js/cc.js"}}
</script>
<script>
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1734156027335/index.js').catch(function (err) {
System.import('//yun.duiba.com.cn/db_games/ccc_game/template3d/1734158262639/index.js').catch(function (err) {
console.error(err);
})
</script>
......
......@@ -48,6 +48,7 @@
"prizeImage":"//yun.dui88.com/images/201907/tua0um9jjp.jpg"
}
],
"rankPopList": [],
"signPopFlag": false
},
"message": null,
......
......@@ -2,12 +2,11 @@
"code": "ullamco deserunt dolor consectetur proident",
"data": {
"myRankInfo": {
"index": 279,
"index": 1879,
"score": 948,
"nickname": "好友的我的",
"nickname": "",
"avatar": "sint dolore ipsum"
},
"myRankInfo": null,
"rankInfos": [
{
"index": -1,
......
......@@ -7,7 +7,6 @@
"nickname": "个人的我看看",
"avatar": "do"
},
"myRankInfo": null,
"rankInfos": [
{
"index": 505466,
......@@ -107,7 +106,6 @@
"sendCount": 16180576.760792673
}
],
"rankInfos": [],
"currentTime": 70912012.27585727,
"endTime": 1733896500000
},
......
......@@ -13,7 +13,6 @@
"score": 58265,
"province": "省我的"
},
"myRankInfo":null,
"rankInfos": [
{
"index": 8,
......@@ -76,7 +75,6 @@
"meFlag": false
}
],
"rankInfos":[],
"todayAwardConfig": {
"prizeName": "sint esse",
"prizeImage": "voluptate amet qui Duis ut",
......
......@@ -45,8 +45,8 @@
"progress": 1,
"state": "success",
"stage": "build",
"message": "2024-12-14 14:01:32 build success in 1 min 4 s!",
"detailMessage": "%c兑吧发布插件 >> 版本号:1734156027335\rcolor: green\r",
"message": "2024-12-14 14:39:42 build success in 2 min!",
"detailMessage": "Asset DB is resume!\r",
"options": {
"name": "cocos-template-3d",
"server": "",
......@@ -109,7 +109,7 @@
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/web-mobile2024-11-6 15-39.log"
},
"time": "2024-12-14 14:00:27",
"time": "2024-12-14 14:37:42",
"dirty": false
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment