dayjs一个轻量的处理日期的库
var expiryDate = dayjs(item.EXPIRY_DATE).format('YYYY-MM-DD'); var today = new Date(); var today_time = dayjs(today).format('YYYY-MM-DD'); if (today_time > expiryDate) { uni.showModal({ content: this.l('Membership No. had expired,continue or not?'), success: function(res) { if (res.confirm) { uni.$emit('selectVip', item); uni.navigateBack({}); } } }); } else { uni.$emit('selectVip', item); uni.navigateBack({}); }