代码提交

This commit is contained in:
黄少君
2023-11-17 20:55:32 +08:00
parent 35b43ffd97
commit c3e62f8922
73 changed files with 1808 additions and 781 deletions

View File

@ -1,4 +1,5 @@
// 缓存key
export const CacheKey = {
PAY_INFO: 'pay_info', // 支付信息
TOP_TOUCH_KEY:'top_touch_key'
}

View File

@ -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
}

View File

@ -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