|
@@ -62,9 +62,31 @@ function numFilter(num) {
|
|
|
function twoDecimal(num) {
|
|
|
return (num / 100).toFixed(2)
|
|
|
}
|
|
|
+
|
|
|
+// 切换旗帜图片
|
|
|
+function showPennant(count, num) {
|
|
|
+ if (count >= num) {
|
|
|
+ if (num <= 2) {
|
|
|
+ return '/static/2q.png'
|
|
|
+ } else if (num <= 5) {
|
|
|
+ return '/static/5q.png'
|
|
|
+ } else if (num <= 10) {
|
|
|
+ return '/static/10q.png'
|
|
|
+ } else if (num <= 15) {
|
|
|
+ return '/static/15q.png'
|
|
|
+ } else if (num <= 30) {
|
|
|
+ return '/static/30q.png'
|
|
|
+ } else if (num <= 60) {
|
|
|
+ return '/static/60q.png'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return '/static/pennant.png'
|
|
|
+ }
|
|
|
+}
|
|
|
module.exports = {
|
|
|
formatDate: formatDate,
|
|
|
gradeFilter: gradeFilter,
|
|
|
numFilter: numFilter,
|
|
|
- twoDecimal: twoDecimal
|
|
|
+ twoDecimal: twoDecimal,
|
|
|
+ showPennant: showPennant
|
|
|
}
|