From e988948770d6f4a7f07ac58230f5a6a763cf271f Mon Sep 17 00:00:00 2001 From: yysforget <1121504223@qq.com> Date: Fri, 12 Jul 2024 16:09:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:gacha=E6=8A=BD=E5=8D=A1=E6=95=B0=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gacha.js | 25 +++++++++++++++++++++++-- resources/gachalog/index.html | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/gacha.js b/lib/gacha.js index 04f1556..6a1a952 100644 --- a/lib/gacha.js +++ b/lib/gacha.js @@ -185,6 +185,13 @@ const NORMAL_LIST = [ '啜泣摇篮', ]; +const FLOORS_MAP = { + '邦布频段': [50, 70], + '音擎频段': [50, 70], + '独家频段': [60, 80], + '常驻频段': [60, 80], +}; + function getLevelFromList(ast, lst) { if (ast === 0) { return 2; @@ -241,17 +248,28 @@ export async function anaylizeGachaLog(uid) { } if (list.length > 0) { list[list.length - 1]['totalCount'] = i - preIndex; + if (i - preIndex <= FLOORS_MAP[name][0]) { + list[list.length - 1]['color'] = 'rgb(63, 255, 0)'; + } else if (i - preIndex >= FLOORS_MAP[name][1]) { + list[list.length - 1]['color'] = 'rgb(255, 20, 20)'; + } } list.push({ ...item, rank_type_label: RANK_MAP[item.rank_type], isUp: isUp, totalCount: '-', + color: 'white', }); preIndex = i; } if (i === data.length - 1 && list.length > 0) { list[list.length - 1]['totalCount'] = i - preIndex + 1; + if (i - preIndex + 1 <= FLOORS_MAP[name][0]) { + list[list.length - 1]['color'] = 'rgb(63, 255, 0)'; + } else if (i - preIndex + 1 >= FLOORS_MAP[name][1]) { + list[list.length - 1]['color'] = 'rgb(255, 20, 20)'; + } } i++; } @@ -279,8 +297,11 @@ export async function anaylizeGachaLog(uid) { level = getLevelFromList(avgUp, [51, 55, 61, 68, 70]); } else if ('独家频段' === name) { level = getLevelFromList(avgUp, [74, 87, 99, 105, 120]); - } else if ('常驻频段' === name) { - level = getLevelFromList(avgUp, [53, 60, 68, 73, 75]); + } + } + if (avgFive !== '-') { + if ('常驻频段' === name) { + level = getLevelFromList(avgFive, [53, 60, 68, 73, 75]); } } const tag = HOMO_TAG[level]; diff --git a/resources/gachalog/index.html b/resources/gachalog/index.html index 566c26d..cbec8e3 100644 --- a/resources/gachalog/index.html +++ b/resources/gachalog/index.html @@ -45,7 +45,7 @@
-
{{inv?.totalCount}}抽
+
{{inv?.totalCount}}抽
{{/each}}