//获取当前时间 只能是星期二才能进行提现
//获取当前时间戳
var timestamp = Date.parse(new Date());
timestamp = timestamp / 1000;
console.log(“当前时间戳为:” + timestamp);
//获取当前时间
var n = timestamp * 1000;
var date = new Date(n);
//年
var Y = date.getFullYear();
//月
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
//日
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
//时
var h = date.getHours();
//分
var m = date.getMinutes();
//秒
var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
let timer = Y + "-" + M + "-" + D
let t = JSON.stringify(timer)
let week = "周"+"天一二三四五六".charAt(new Date(t).getDay())
console.log(week)
this.setData({
week: week
})
if(week=='周二'){
var date = {
isDuringDate: function (beginDateStr, endDateStr) {
var curDate = new Date(),
beginDate = new Date(beginDateStr),
endDate = new Date(endDateStr);
console.log(curDate)
console.log(beginDate)
console.log(endDate)
if (curDate >= beginDate && curDate <= endDate) {
return true;
}
return false;
}
}
let d = new Date();
let yy1 = d.getFullYear(); //endData
let mm1 = d.getMonth() + 1; //因为getMonth()返回值是 0(一月) 到 11(十二月) 之间的一个整数。所以要给其加1
let dd1 = d.getDate();
if (mm1 < 10 ) {
mm1 = '0' + mm1;
}
if (dd1 < 10) {
dd1 = '0' + dd1;
}
// console.log(yy1 + '-' + mm1 + '-' + dd1);
let stateDate = yy1 + '-' + mm1 + '-' + dd1 + ' ' + '09:00:00'
let endDate = yy1 + '-' + mm1 + '-' + dd1 + ' ' + '15:00:00'
console.log(stateDate)
console.log(endDate)
let isDateState = date.isDuringDate(stateDate, endDate);
console.log(isDateState) //获取是否是银行提现的某个时段
}