diff --git a/src/project/saas/AppCooperationPropaganda/cooperationDetail.vue b/src/project/saas/AppCooperationPropaganda/cooperationDetail.vue index 843cb3da..53934f74 100644 --- a/src/project/saas/AppCooperationPropaganda/cooperationDetail.vue +++ b/src/project/saas/AppCooperationPropaganda/cooperationDetail.vue @@ -199,41 +199,44 @@ export default { // 提醒发送 remindSend() { uni.getSystemInfo({ - success: function (res) { - console.log(res) + 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.firstClickTime = new Date(this.detail.remindTime.replace(/-/g, "/")).getTime() || new Date(this.detail.remindTime).getTime() || 0 ; - // this.currentClickTime = +new Date(); - // let time = this.currentClickTime - this.firstClickTime; - // if (time >= 3600000) { - // this.$http.post("/app/appmasssendingtask/remindSend", null, { - // params: { - // id: this.id, - // }, - // }) - // .then((res) => { - // if (res?.code == 0) { - // this.$u.toast("已提醒成员发送"); - // this.getDetail() - // } - // }) - // .catch(() => {}); - // } else { - // time = 3600000 - time; - // const min = Math.floor(time / 60000); // 分钟 - // let 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); - // } + this.currentClickTime = +new Date(); + let time = this.currentClickTime - this.firstClickTime; + if (time >= 3600000) { + this.$http.post("/app/appmasssendingtask/remindSend", null, { + params: { + id: this.id, + }, + }) + .then((res) => { + if (res?.code == 0) { + this.$u.toast("已提醒成员发送"); + this.getDetail() + } + }) + .catch(() => {}); + } else { + time = 3600000 - time; + const min = Math.floor(time / 60000); // 分钟 + let 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); + } }, // 切换分段器 changeSub0(index) {