...
|
...
|
@@ -39,7 +39,7 @@ App({ |
|
|
return new Promise(function (resolve, reject) {
|
|
|
wx.getUserInfo({
|
|
|
success: function (user) {
|
|
|
console.log('获取用户信息',user);// gender:性别 0:未知、1:男、2:女
|
|
|
console.log('获取用户信息', user);// gender:性别 0:未知、1:男、2:女
|
|
|
// 登录
|
|
|
let url = '/portal/Login/getToken';
|
|
|
wx.login({
|
...
|
...
|
@@ -182,22 +182,20 @@ App({ |
|
|
return H;
|
|
|
},
|
|
|
//获取截止时间的前几个小时
|
|
|
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))
|
|
|
preTime(over_time, n) {
|
|
|
console.log('over_time', over_time);
|
|
|
var time = new Date(new Date(over_time).getTime() - n * 60 * 60 * 1000);
|
|
|
console.log('time', time);
|
|
|
var y = time.getFullYear(),
|
|
|
m = time.getMonth() + 1,
|
|
|
d = time.getDate(),
|
|
|
h = time.getHours(),
|
|
|
mi = time.getMinutes();
|
|
|
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;
|
|
|
console.log('截止时间', time, m, d, h, mi);
|
|
|
return y + '-' + m + '-' + d + ' ' + h + ':' + mi;
|
|
|
},
|
|
|
timeFormat(param) { //小于10的格式化函数
|
...
|
...
|
|