当前位置:网站首页>按钮倒计时提醒
按钮倒计时提醒
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);
}
},
边栏推荐
- 即时通讯开发如何撸一个WebSocket服务器
- 你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
- 20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
- 小程序实现搜索功能续
- Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
- unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
- mstsc/Mstsc (Microsoft terminal services client)远程桌面连接
- Premint工具,作为普通人我们需要了解哪些内容?
- XSS详解及复现gallerycms字符长度限制短域名绕过
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
猜你喜欢

即时通讯开发如何撸一个WebSocket服务器

odoo公用变量或数组的使用

Research on Ethernet PHY Chip LAN8720A Chip

OptiFDTD应用:纳米盘型谐振腔等离子体波导滤波器

小程序开发的报价为什么有差别?需要多少钱?

卷积神经网络识别验证码

Shader Graph学习各种特效案例

夏克-哈特曼波前传感器

以太网PHY芯片LAN8720A芯片研究

Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
随机推荐
卷积神经网络识别验证码
Premint工具,作为普通人我们需要了解哪些内容?
MySQL最大连接数限制如何修改
Entity FrameWork Core教程,从基础应用到原理实战
egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
【UNR #6 B】机器人表演(DP)
Unity vertex animation
多线程之自定义线程池
Moonbeam网络维护模式(Maintenance Mode)解读
手把手教你编写性能测试用例
y92.第六章 微服务、服务网格及Envoy实战 -- Envoy基础(三)
微透镜阵列的高级模拟
【kali-密码攻击】(5.2.1)密码分析:Hash Identifier(哈希识别)
C# rounding MidpointRounding.AwayFromZero
已备案域名用国外服务器会不会掉备案?
改变社交与工作状态的即时通讯是什么呢?
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
小程序开发的报价为什么有差别?需要多少钱?
什么是 PWA
【LeetCode】求根节点到叶节点数字之和