forked from macrozheng/mall-admin-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhh
committed
Oct 15, 2018
1 parent
621d682
commit ca80a10
Showing
3 changed files
with
300 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import request from '@/utils/request' | ||
export function fetchList(params) { | ||
return request({ | ||
url:'/order/list', | ||
method:'get', | ||
params:params | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// date.js | ||
export function formatDate (date, fmt) { | ||
if (/(y+)/.test(fmt)) { | ||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); | ||
} | ||
let o = { | ||
'M+': date.getMonth() + 1, | ||
'd+': date.getDate(), | ||
'h+': date.getHours(), | ||
'm+': date.getMinutes(), | ||
's+': date.getSeconds() | ||
}; | ||
for (let k in o) { | ||
if (new RegExp(`(${k})`).test(fmt)) { | ||
let str = o[k] + ''; | ||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); | ||
} | ||
} | ||
return fmt; | ||
} | ||
|
||
function padLeftZero (str) { | ||
return ('00' + str).substr(str.length); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters