当前位置:网站首页>Button countdown reminder
Button countdown reminder
2022-08-10 02:31:00 【seven joys a week】
// Reminder to send
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("Remind member to send");
}
.catch(() => {
});
} else {
time = 60 * 60 * 1000 - time;
const min = Math.floor(time / 1000 / 60); // minutes
const second = Math.floor(time / 1000);
second %= 60;
let msg = ``;
if (min > 0 && second > 0) {
msg = `${min}minutes${second}seconds and click again`;
} else if (min > 0 && second <= 0) {
msg = `${min} minutes later you can click again`;
} else if (min <= 0 && second> 0) {
msg = `${second} seconds later, you can click again`;
}
this.$u.toast(msg);
}
},
边栏推荐
猜你喜欢
防勒索病毒现状分析
微透镜阵列后光传播的研究
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
type-C 边充电边听歌(OTG) PD芯片方案,LDR6028 PD充电加OTG方案
unity编辑器扩展界面使用 List
惊掉你下巴,程序员编码竟然可以被 996 指数化
unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla
Initial attempt at UI traversal
初步认识对象
y92.第六章 微服务、服务网格及Envoy实战 -- Envoy基础(三)
随机推荐
芯片资讯|半导体收入增长预计将放缓至 7%,蓝牙芯片需求依然稳步增长
数据建模已死,真的吗?
使用 GoogleTest 框架对 C 代码进行单元测试
Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
微透镜阵列的高级模拟
使用IDEA的PUSH常见问题
惊掉你下巴,程序员编码竟然可以被 996 指数化
微信账户体系科普:什么是UnionId、OpenId与wxopenid?
组件的使用
DHCP——动态主机配置协议
对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告
Pyscript,创建一个能执行crud操作的网页应用
Initial attempt at UI traversal
高并发+海量数据下如何实现系统解耦?【下】
万字总结:分布式系统的38个知识点
UI遍历的初步尝试
3511. 倒水问题
罗彻斯特大学 | 现在是什么序列?蛋白质序列的贝叶斯优化的预训练集成
Summary of Web Performance Testing Models