mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 02:16:43 +08:00
计算数字
This commit is contained in:
@@ -264,7 +264,7 @@ export function getUType(type) {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
/**此方法的意义,需要一起讨论*/
|
||||
export function experienceValue(total) {
|
||||
let data = {
|
||||
start:'',
|
||||
@@ -324,8 +324,8 @@ export function experienceValue(total) {
|
||||
data.endValue = 30000;
|
||||
data.percentage = parseFloat((total / 30000) * 100);
|
||||
}
|
||||
console.log("&&&&&&&&&&&&&&&&&&&&&&&");
|
||||
console.log(data);
|
||||
//console.log("&&&&&&&&&&&&&&&&&&&&&&&");
|
||||
//console.log(data);
|
||||
return data;
|
||||
}
|
||||
export function translate(field) {
|
||||
@@ -340,3 +340,20 @@ export function translate(field) {
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
/**格式化人数的文档 ,学习人数,关注人数等*/
|
||||
export function formatUserNumber(num) {
|
||||
let rsNum =0;
|
||||
if(num<5){
|
||||
return 0;
|
||||
}
|
||||
if(num<95){
|
||||
rsNum=Math.round((num+5)/10)*10;
|
||||
return rsNum+'+';
|
||||
}
|
||||
if(num>94){
|
||||
rsNum=Math.round((num+50)/100)*100;
|
||||
return rsNum+'+';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -100,8 +100,7 @@
|
||||
<div class="course-author">
|
||||
<div class="course-author-left">
|
||||
{{ course.authorInfo.name }}
|
||||
<span class="study-num" v-if="course.studiesFormat == 0">{{course.studiesFormat}}人学习</span>
|
||||
<span class="study-num" v-if="course.studiesFormat != 0">{{course.studiesFormat}}+人学习</span>
|
||||
<span class="study-num" >{{formatNum(course.studys)}}人学习</span>
|
||||
</div>
|
||||
<div style="display: flex;">
|
||||
<div style="width:30px;">
|
||||
@@ -409,11 +408,12 @@
|
||||
import GuideBox from '@/components/Portal/guideBox.vue'
|
||||
import {
|
||||
toScore,
|
||||
cutFullName
|
||||
cutFullName,
|
||||
formatUserNumber
|
||||
} from '@/utils/tools.js';
|
||||
import {
|
||||
swiper,
|
||||
swiperSlide
|
||||
swiperSlide,
|
||||
} from 'vue-awesome-swiper';
|
||||
import apiPlace from "@/api/phase2/place.js"
|
||||
import authorImg from '@/components/Portal/authorImg.vue';
|
||||
@@ -447,7 +447,8 @@
|
||||
uvalue:0,
|
||||
totalStudyHour:0
|
||||
},
|
||||
userInfo: {},
|
||||
formatNum:formatUserNumber,
|
||||
//userInfo: {},
|
||||
ankingList: [],
|
||||
answersList: [],
|
||||
Popularity: [],
|
||||
@@ -506,7 +507,7 @@
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = this.$store.getters.userInfo;
|
||||
//this.userInfo = this.$store.getters.userInfo;
|
||||
// console.log(this.this.userInfo)
|
||||
this.getCourseData(1);
|
||||
this.getCaseData();
|
||||
|
||||
Reference in New Issue
Block a user