mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
解决经验值为0时无法显示进度条的问题。
This commit is contained in:
@@ -277,6 +277,7 @@ export function experienceValue(total) {
|
|||||||
data.start = 'LV1';
|
data.start = 'LV1';
|
||||||
data.end = 'LV2';
|
data.end = 'LV2';
|
||||||
data.endValue = 600;
|
data.endValue = 600;
|
||||||
|
if(total == 0){total = 1;}
|
||||||
data.percentage = parseFloat((total / 600) * 100);
|
data.percentage = parseFloat((total / 600) * 100);
|
||||||
} else if(total > 300 || total == 300 || total < 600){
|
} else if(total > 300 || total == 300 || total < 600){
|
||||||
data.start = 'LV2';
|
data.start = 'LV2';
|
||||||
@@ -324,6 +325,8 @@ export function experienceValue(total) {
|
|||||||
data.endValue = 30000;
|
data.endValue = 30000;
|
||||||
data.percentage = parseFloat((total / 30000) * 100);
|
data.percentage = parseFloat((total / 30000) * 100);
|
||||||
}
|
}
|
||||||
|
console.log("&&&&&&&&&&&&&&&&&&&&&&&");
|
||||||
|
console.log(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
export function translate(field) {
|
export function translate(field) {
|
||||||
|
|||||||
Reference in New Issue
Block a user