From 75f8c90c4ee950ec7862ef34bf5ae3866c429a6c Mon Sep 17 00:00:00 2001 From: 222000134 <3118406833@qq.com> Date: Wed, 31 May 2023 20:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=B0=8F=E9=98=9F=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E8=BF=9E=E6=8E=A5=E4=BA=91=E5=87=BD=E6=95=B0=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=A3=E7=A0=81=E4=B8=8D=E5=B0=8F=E5=BF=83=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=8E=89=E4=BA=86=EF=BC=8C=E5=88=9B=E5=BB=BA=E5=B0=8F?= =?UTF-8?q?=E9=98=9F=E9=BB=98=E8=AE=A4=E5=A4=B4=E5=83=8F=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- teamwork/pages/team/activity-detail.vue | 23 +++++++++- teamwork/pages/team/add-team-activity.vue | 56 +++++++++++------------ teamwork/pages/team/add-team.vue | 2 +- teamwork/pages/team/main.vue | 1 + 4 files changed, 52 insertions(+), 30 deletions(-) diff --git a/teamwork/pages/team/activity-detail.vue b/teamwork/pages/team/activity-detail.vue index 6a6b726..893f156 100644 --- a/teamwork/pages/team/activity-detail.vue +++ b/teamwork/pages/team/activity-detail.vue @@ -58,7 +58,7 @@ export default { data() { return { - signStatus: '报名', + signStatus: '', userId: '', icon: '', activityId: '', @@ -73,6 +73,22 @@ } }, methods: { + happenTimeFun(){//时间戳数据处理 + let date = new Date(); + //时间戳为10位需*1000,时间戳为13位的话不需乘1000 + let y = date.getFullYear(); + let MM = date.getMonth() + 1; + MM = MM < 10 ? ('0' + MM) : MM;//月补0 + let d = date.getDate(); + d = d < 10 ? ('0' + d) : d;//天补0 + let h = date.getHours(); + h = h < 10 ? ('0' + h) : h;//小时补0 + let m = date.getMinutes(); + m = m < 10 ? ('0' + m) : m;//分钟补0 + let s = date.getSeconds(); + s = s < 10 ? ('0' + s) : s;//秒补0 + return y + '-' + MM + '-' + d + ' ' + h + ':' + m+ ':' + s; + }, goBack() { uni.navigateBack({ delta: 1, //返回层数,2则上上页 @@ -199,6 +215,11 @@ }).catch((err => { console.log(err) })) + if(this.happenTimeFun()>this.startDate){ + console.log(this.happenTimeFun(),'this.happenTimeFun()') + console.log(this.startDate,'this.startDate') + this.signStatus="报名时间截止" + } } } diff --git a/teamwork/pages/team/add-team-activity.vue b/teamwork/pages/team/add-team-activity.vue index 487cdc7..88f01d1 100644 --- a/teamwork/pages/team/add-team-activity.vue +++ b/teamwork/pages/team/add-team-activity.vue @@ -120,35 +120,35 @@ return; } - // uniCloud.callFunction({ - // name: 'fe-team-createActivity', - // data: { - // title: this.name, - // content: this.content, - // startDate: this.start_date, - // endDate: this.end_date, - // userId: this.userId, - // place: this.place, - // participants: this.object, - // contact: this.contact, - // } - // }) - // .then(res => { - // console.log(res) - // if (res.result.code == 200) { - // uni.showToast({ - // title: '提交成功', - // icon: 'success' - // }); - // this.goBack() - // } else { - // uni.showToast({ - // title: '提交失败', - // icon: 'error' - // }); - // } + uniCloud.callFunction({ + name: 'fe-team-createActivity', + data: { + title: this.name, + content: this.content, + startDate: this.start_date, + endDate: this.end_date, + userId: this.userId, + place: this.place, + participants: this.object, + contact: this.contact, + } + }) + .then(res => { + console.log(res) + if (res.result.code == 200) { + uni.showToast({ + title: '提交成功', + icon: 'success' + }); + this.goBack() + } else { + uni.showToast({ + title: '提交失败', + icon: 'error' + }); + } - // }) + }) }, handleDateChange1(event) { this.start_date = event.detail.value diff --git a/teamwork/pages/team/add-team.vue b/teamwork/pages/team/add-team.vue index 86ec142..f172faa 100644 --- a/teamwork/pages/team/add-team.vue +++ b/teamwork/pages/team/add-team.vue @@ -75,7 +75,7 @@ } if (this.avatar == '') { this.avatar = - 'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/7d3feb79-8efe-4686-b745-3b7dc5d5df36.png' + 'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/433d3cc6-4b8f-475c-83e1-35acc747cab2.jpg' } await uniCloud.callFunction({ name: 'fe-team-createTeam', diff --git a/teamwork/pages/team/main.vue b/teamwork/pages/team/main.vue index 19738e3..9ec5575 100644 --- a/teamwork/pages/team/main.vue +++ b/teamwork/pages/team/main.vue @@ -95,6 +95,7 @@ }; }, methods: { + tabChange(index) { this.current = index.index; if (index.index == 1) { -- GitLab