// 提醒发送
remindSend() {
// firstClickTime最好是后端返回的参数
// 苹果手机不兼容 new Data() 所以要先获取手机型号
uni.getSystemInfo({
success: (res)=>{
if(res.platform == "ios") {
this.firstClickTime = new Date(this.detail.remindTime.replace(/-/g,
"/")).getTime() || 0
} else {
this.firstClickTime = new Date(this.detail.remindTime).getTime() || 0
}
}
});
this.currentClickTime = +new Date();
let time = this.currentClickTime - this.firstClickTime;
if (time >= 60 * 60 * 1000) {
this.$http
.post("/app/appmasssendingtask/remindSend", null, {
params: {
id: this.id,
},
})
.then((res) => {
if (res?.code == 0) {
this.$u.toast("已提醒成员发送");
}
})
.catch(() => {
});
} else {
time = 60 * 60 * 1000 - time;
const min = Math.floor(time / 1000 / 60); // 分钟
const second = Math.floor(time / 1000);
second %= 60;
let msg = ``;
if (min > 0 && second > 0) {
msg = `${min}分钟${second}秒后可以再次点击`;
} else if (min > 0 && second <= 0) {
msg = `${min}分钟后可以再次点击`;
} else if (min <= 0 && second > 0) {
msg = `${second}秒后可以再次点击`;
}
this.$u.toast(msg);
}
},