解决经验值为0时无法显示进度条的问题。

This commit is contained in:
weinan2087
2022-09-30 17:16:55 +08:00
parent e131816d91
commit b8ad2e71f1

View File

@@ -277,6 +277,7 @@ export function experienceValue(total) {
data.start = 'LV1';
data.end = 'LV2';
data.endValue = 600;
if(total == 0){total = 1;}
data.percentage = parseFloat((total / 600) * 100);
} else if(total > 300 || total == 300 || total < 600){
data.start = 'LV2';
@@ -324,6 +325,8 @@ export function experienceValue(total) {
data.endValue = 30000;
data.percentage = parseFloat((total / 30000) * 100);
}
console.log("&&&&&&&&&&&&&&&&&&&&&&&");
console.log(data);
return data;
}
export function translate(field) {