uni-app转微信小程序中,.wxs文件中不支持跨端编译~因为微信小程序里不支持new Date,
var lessTime = function(time,num = 0,show_firstDay = true) {
if(num > 0 || !show_firstDay) {
return true;
}
if(!time) {
return false;
}
//#ifdef APP-PLUS
var date = new Date();
//#endif
//#ifdef MP-WEIXIN
var date = getDate();
//#endif
var hour = parseFloat(time.split(':')[0]);
var minute = parseFloat(time.split(':')[1]);
if(hour > date.getHours() || (hour == date.getHours() && minute - date.getMinutes() >= 20)) {
return true
}
return false;
}
0 个评论
要回复文章请先登录或注册