function getUrlPar(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null) return unescape(r[2]);
|
return null;
|
}
|
|
|
function formatDate(time, fmt) {
|
let date = new Date(time);
|
const o = {
|
'M+': date.getMonth() + 1, //月份
|
'd+': date.getDate(), //日期
|
'h+': date.getHours(), //小时
|
'm+': date.getMinutes(), //分
|
's+': date.getSeconds(), //秒
|
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
|
'S': date.getMilliseconds() //毫秒
|
};
|
if (/(y+)/.test(fmt)) {
|
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substring(4 - RegExp.$1.length));
|
}
|
for (let k in o) {
|
if (new RegExp('(' + k + ')').test(fmt)) {
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substring(('' + o[k])
|
.length)));
|
}
|
}
|
return fmt;
|
}
|
|
function getSmsStatus(status) {
|
switch (status) {
|
case 0:
|
return '审核中';
|
case 1:
|
return '审核成功';
|
case 2:
|
return '审核失败';
|
case 3:
|
return '等待发送';
|
case 4:
|
return '发送中';
|
case 5:
|
return '接收中';
|
case 6:
|
return '接收成功';
|
case 7:
|
return '接收失败';
|
default:
|
return '接收失败';
|
}
|
}
|
|
module.exports = {
|
getUrlPar,
|
formatDate,
|
getSmsStatus
|
}
|