提交修改

This commit is contained in:
daihh
2022-11-13 18:16:03 +08:00
parent df9605a584
commit e8db5b31a2
2 changed files with 252 additions and 79 deletions

View File

@@ -32,7 +32,7 @@ export function getCourseType(type) {
21: '直播课',
20: '录播课',
30: '面授课',
40: '混合式',
40: '学习项目',
};
return maps[type];
}
@@ -238,3 +238,29 @@ export function getHMS(time) {
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
return hour + ':' + min + ':' + sec
}
/**格式化人数的文档 ,学习人数,关注人数等*/
export function formatUserNumber(num) {
let rsNum =0;
if(num<5){return 0;}
if(num>=5 && num<= 10){return 10 +"+";}
if(num<=94){
rsNum=Math.round((num)/10)*10;
return rsNum+'+';
}
if(num>94 && num <= 1000){
rsNum=Math.round((num)/100)*100;
return rsNum+'+';
}
if(num>1000 && num <= 10000){
rsNum=Math.round((num)/1000)*1000;
return rsNum+'+';
}
if(num>10000){
// rsNum=Math.round((num)/10000)*10000;
// return rsNum+'+';
rsNum=Math.round((num)/10000);
return rsNum+'W+';
}
return num;
}