代码提交
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
// 缓存key
|
||||
export const CacheKey = {
|
||||
PAY_INFO: 'pay_info', // 支付信息
|
||||
TOP_TOUCH_KEY:'top_touch_key'
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export const WechatProvider = 'wxpay'
|
||||
|
||||
// 支付类型(后端用)
|
||||
export const ServiceFrom = {
|
||||
'h5': 'weixin_h5', // H5(微信内h5、微信外H5)
|
||||
'h5': 'h5', // H5(微信内h5、微信外H5)
|
||||
'weixin': 'weixin_applet', // 微信小程序
|
||||
'app': 'weixin_app' // 微信APP
|
||||
}
|
||||
|
@ -15,6 +15,22 @@ export function formatDate(date, format) {
|
||||
.replace(/ss/g, seconds);
|
||||
}
|
||||
|
||||
export function formatRemainTime(time) {
|
||||
let remainTimeStr=''
|
||||
const seconds = Math.floor(time / 1000)
|
||||
const days = Math.floor(seconds / (3600 * 24))
|
||||
const hours = Math.floor((seconds % (3600 * 24)) / 3600)
|
||||
// const minutes = Math.floor((seconds % 3600) / 60)
|
||||
// const remainingSeconds = seconds % 60
|
||||
if(days>0){
|
||||
remainTimeStr += `${days}天`
|
||||
}
|
||||
if(hours>0){
|
||||
remainTimeStr += `${hours}小时`
|
||||
}
|
||||
return `还剩${remainTimeStr}自动确认`
|
||||
}
|
||||
|
||||
/**
|
||||
* 正则检测大陆手机号
|
||||
* @param phone
|
||||
|
Reference in New Issue
Block a user