小程序源码

This commit is contained in:
mindskip
2020-09-02 08:44:41 +08:00
parent 30b54a23ff
commit 593017f562
277 changed files with 5497 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
module.exports = {
appKey: '9abd2dfe51',
hasPlugin: false,
getLocation: false
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,41 @@
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
const formatSeconds = theTime => {
let theTime1 = 0
let theTime2 = 0
if (theTime > 60) {
theTime1 = parseInt(theTime / 60)
theTime = parseInt(theTime % 60)
if (theTime1 > 60) {
theTime2 = parseInt(theTime1 / 60)
theTime1 = parseInt(theTime1 % 60)
}
}
let result = '' + parseInt(theTime) + '秒'
if (theTime1 > 0) {
result = '' + parseInt(theTime1) + '分' + result
}
if (theTime2 > 0) {
result = '' + parseInt(theTime2) + '小时' + result
}
return result
}
module.exports = {
formatSeconds: formatSeconds,
formatTime: formatTime
}