当前位置:网站首页>按钮倒计时提醒
按钮倒计时提醒
2022-08-10 01:11:00 【一周七喜h】
// 提醒发送
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);
}
},
边栏推荐
- [转] Typora_Markdown_图片标题(题注)
- 为什么字符串一旦创建就不可以改变?
- 【kali-密码攻击】(5.2.1)密码分析:Hash Identifier(哈希识别)
- [Turn] Typora_Markdown_ picture title (caption)
- 夏克-哈特曼波前传感器
- 高并发+海量数据下如何实现系统解耦?【下】
- 解决sed替换文本,里面含有“/“、“#”等特殊字符的问题
- ITK编译remote库
- 分析 20 个 veToken 生态系统协议 这种代币模型为何受欢迎?
- Unity reports Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe’ code” in Pla
猜你喜欢
随机推荐
【内存管理概述 Objective-C语言】
Sikuli 基于图形识别的自动化测试技术
The shell specifies the parameter name to pass the parameter
跳房子游戏
【wpf】拖拽的简单实现
【论文粗读】(NeurIPS 2020) SwAV:对比聚类结果的无监督视觉特征学习
odoo公用变量或数组的使用
Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
阿里云OSS文件上传
信息化和数字化的核心差异
Moonbeam网络维护模式(Maintenance Mode)解读
3511. 倒水问题
浏览器中的history详解
unity编辑器扩展界面使用 List
22.括号生成
Entity FrameWork Core教程,从基础应用到原理实战
In the 2022 gold, nine, silver and ten work tide, how can I successfully change jobs and get a high salary?
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
什么是 PWA
Unity vertex animation