maozai
maozai
  • 发布:2020-04-16 09:47
  • 更新:2020-04-16 09:47
  • 阅读:1533

uni-app转微信小程序中,.wxs文件中不支持跨端编译~因为微信小程序里不支持new Date

分类:HBuilderX

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 关注 分享

要回复文章请先登录注册