modify:gacha

This commit is contained in:
yysforget 2024-07-11 13:47:25 +08:00
parent dcbd1722d1
commit adc590dcff
2 changed files with 33 additions and 3 deletions

View file

@ -151,6 +151,21 @@ const NORMAL_LIST = [
'啜泣摇篮',
];
function getLevelFromList(ast, lst) {
if (ast === 0) {
return 2;
}
let level = 0;
for (let numIndex = 0; numIndex < lst.length; numIndex++) {
if (ast <= lst[numIndex]) {
level = 4 - numIndex;
break;
}
}
return level;
}
export async function anaylizeGachaLog(uid) {
const savedData = getGachaLog(uid);
if (!savedData) {
@ -213,6 +228,7 @@ export async function anaylizeGachaLog(uid) {
let timeRange = '还没有抽卡';
let avgFive = '-';
let avgUp = '-';
let level = 2;
if (data.length > 0) {
timeRange = `${latest.time} ${earliest.time}`;
if (fiveStars > 0)
@ -223,6 +239,18 @@ export async function anaylizeGachaLog(uid) {
if (totalCount > 0) lastFive = totalCount;
else lastFive = '-';
}
if (avgUp !== "-") {
if ("音擎频段" === name) {
level = getLevelFromList(avgUp, [62, 75, 88, 99, 111]);
} else if ("邦布频段" === name) {
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]);
}
}
let tag = HOMO_TAG[level];
result.push({
name,
timeRange,
@ -233,6 +261,8 @@ export async function anaylizeGachaLog(uid) {
totalCount,
avgFive,
avgUp,
level,
tag,
});
}
return result;

View file

@ -30,10 +30,10 @@
</div>
</div>
</div>
<!-- <div class="comment e1">
<div class="comment e1">
<div class="icon"></div>
<div class="label">平稳保底</div>
</div> -->
<div class="label">{{item.tag}}</div>
</div>
</div>
<div class="list">
{{each item.list inv j}}