...
|
...
|
@@ -9,7 +9,7 @@ App({ |
|
|
if (res.authSetting['scope.userInfo']) {
|
|
|
console.log('授权过到首页');
|
|
|
self.globalData.isLogin = true;
|
|
|
wx.setStorageSync('isLogin',true)
|
|
|
wx.setStorageSync('isLogin', true)
|
|
|
// wx.redirectTo({
|
|
|
// url: '/pages/index/index', //跳转到授权页面
|
|
|
// });
|
...
|
...
|
@@ -136,7 +136,7 @@ App({ |
|
|
content: res.data.message,
|
|
|
showCancel: false,
|
|
|
});
|
|
|
resolve(res.data.data);
|
|
|
resolve(res.data);
|
|
|
reject(res.data)
|
|
|
}
|
|
|
setTimeout(function () {
|
...
|
...
|
@@ -168,30 +168,47 @@ App({ |
|
|
// let new_time = time.join(' ');
|
|
|
return time;
|
|
|
},
|
|
|
//获取当前时间(时分)
|
|
|
nowTime() {
|
|
|
let date = new Date();
|
|
|
let hours = date.getHours();
|
|
|
let minutes = date.getMinutes();
|
|
|
let H = (hours > 9 ? hours : ('0' + hours)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
|
|
|
// let time = [];
|
|
|
// time.push(H);
|
|
|
console.log('time', H);
|
|
|
// let new_time = time.join(' ');
|
|
|
return H;
|
|
|
},
|
|
|
//获取截止时间的前几个小时
|
|
|
nextTime(over_time, hour_num) {
|
|
|
let over = new Date(over_time); //转成标准时间
|
|
|
let month = over.getMonth() + 1;
|
|
|
let day = over.getDate();
|
|
|
let hours = over.getHours();//获取截止时间的小时
|
|
|
let minutes = over.getMinutes();
|
|
|
let Y = over.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day));
|
|
|
let H = (hours > 9 ? hours - hour_num : ('0' + hours - hour_num)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
|
|
|
let time = [];
|
|
|
// console.log('Y,H,month', Y, H,month);
|
|
|
time.push(Y, H);
|
|
|
let new_time = time.join(' ');
|
|
|
return new_time;
|
|
|
preTime(over_time,n) {
|
|
|
var nowDate = new Date(over_time),
|
|
|
nowDate = nowDate.setHours(nowDate.getHours() - n),
|
|
|
nowDate = new Date(nowDate),
|
|
|
y = nowDate.getFullYear(),
|
|
|
m = nowDate.getMonth() + 1,
|
|
|
d = nowDate.getDate(),
|
|
|
h = nowDate.getHours(),
|
|
|
mi = nowDate.getMinutes();
|
|
|
console.log('nowDate',nowDate,new Date(over_time))
|
|
|
m = m < 10 ? '0' + m : m;
|
|
|
d = d < 10 ? '0' + d : d;
|
|
|
h = h < 10 ? '0' + h : h;
|
|
|
mi = mi < 10 ? '0' + mi : mi;
|
|
|
console.log('截止时间',y,over_time, m, d, h,mi);
|
|
|
// return y + over_time + m + over_time + d + ' ' + h + ':' + mi;
|
|
|
return y + '-' + m + '-' + d + ' ' + h + ':' + mi;
|
|
|
},
|
|
|
timeFormat(param) { //小于10的格式化函数
|
|
|
return param < 10 ? '0' + param : param;
|
|
|
},
|
|
|
//秒数转成时分秒
|
|
|
//秒数转成天时分秒
|
|
|
initTime(value) {
|
|
|
let secondTime = value;// 秒
|
|
|
let minuteTime = 0;// 分
|
|
|
let hourTime = 0;// 小时
|
|
|
if (secondTime > 60) {//如果秒数大于60,将秒数转换成整数
|
|
|
let dayTime = 0;// 天
|
|
|
if (secondTime > 60) { //如果秒数大于60,将秒数转换成整数
|
|
|
//获取分钟,除以60取整数,得到整数分钟
|
|
|
minuteTime = parseInt(secondTime / 60);
|
|
|
//获取秒数,秒数取佘,得到整数秒数
|
...
|
...
|
@@ -202,11 +219,17 @@ App({ |
|
|
hourTime = parseInt(minuteTime / 60);
|
|
|
//获取小时后取佘的分,获取分钟除以60取佘的分
|
|
|
minuteTime = parseInt(minuteTime % 60);
|
|
|
//如果小时大于24,将小时转换成天
|
|
|
if (hourTime > 24) {
|
|
|
dayTime = parseInt(hourTime / 24);
|
|
|
hourTime = parseInt(hourTime % 24); //算出有多分钟
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
let result = [];
|
|
|
let obj = null;
|
|
|
obj = {
|
|
|
day: this.timeFormat(dayTime),
|
|
|
hou: this.timeFormat(hourTime),
|
|
|
min: this.timeFormat(minuteTime),
|
|
|
sec: this.timeFormat(secondTime)
|
...
|
...
|
|