27 changed files with 282 additions and 53 deletions
Unified View
Diff Options
-
2api/moment.js
-
2colorui/main.wxss
-
4pages/agent/factory/index.json
-
21pages/agent/factory/index.wxml
-
22pages/agent/factory/index.wxss
-
4pages/agent/fragment/index.js
-
4pages/agent/fragment/index.wxml
-
3pages/article/detail/index.json
-
16pages/article/detail/index.wxml
-
20pages/article/detail/index.wxss
-
3pages/index/index.js
-
7pages/index/index.wxml
-
3pages/mall/fragment/index.js
-
18pages/mall/fragment/index.wxml
-
10pages/mall/search-list/index.js
-
7pages/moment/fragment/index.js
-
6pages/moment/fragment/index.wxml
-
33pages/moment/index.wxs
-
3pages/moment/info-item/index.js
-
6pages/moment/info-item/index.wxml
-
44pages/moment/information/index.js
-
13pages/moment/information/index.wxml
-
35pages/moment/moment-item/index.wxml
-
8pages/moment/moment-item/index.wxss
-
34pages/moment/theall/index.js
-
3pages/ztbvip/index.js
-
4pages/ztbvip/index.wxml
@ -0,0 +1,33 @@ |
|||||
|
function isEmpty(val) { |
||||
|
return typeof val === 'undefined' || val === '' || val === null |
||||
|
} |
||||
|
|
||||
|
function formateDate(datetime) { |
||||
|
if (isEmpty(datetime)) { |
||||
|
return '' |
||||
|
} |
||||
|
var date = getDate(datetime.trim()) |
||||
|
var today = getDate() |
||||
|
var week = '' |
||||
|
if (date.toString().substring(0, 15) === today.toString().substring(0, 15)) { |
||||
|
week = '(今天)' |
||||
|
} else if (date.getTime() > today.getTime()) { |
||||
|
week = '(明天)' |
||||
|
} |
||||
|
return week + datetime |
||||
|
} |
||||
|
|
||||
|
function formateText(text, length) { |
||||
|
if (!text) { |
||||
|
return '' |
||||
|
} |
||||
|
if (text.length <= length) { |
||||
|
return text |
||||
|
} |
||||
|
return text.substring(0, length) |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
formateDate: formateDate, |
||||
|
formateText: formateText |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save