This commit is contained in:
花有清香月有阴
2021-12-24 19:16:20 +08:00
parent d4ca69f219
commit f8209a092a
3 changed files with 17 additions and 6 deletions

View File

@@ -80,7 +80,6 @@ export default {
contactPhone: '',
},
showStartTime: false,
showEndTime: false,
flag: false,

View File

@@ -78,10 +78,6 @@ export default {
this.$dict.load(['villageActivityStatus']).then(() => {
this.getList()
})
uni.$on('updateList', () => {
this.current = 1
this.getList()
})
},
onShow() {
document.title = '居民活动'

View File

@@ -102,7 +102,7 @@
<div class="fixedBtns" v-if="this.current == 0 && detail.status == 0 && this.createUserId == this.user.id" @click="toAdd">编辑活动</div>
</div>
<AiFixedBtn v-if="this.createUserId == this.user.id">
<AiFixedBtn v-if="this.createUserId == this.user.id && this.timeNow * 1 - this.timeEnd * 1 < 24 * 60 * 60 * 1000">
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="AddPosts()" />
</AiFixedBtn>
</div>
@@ -133,6 +133,8 @@ export default {
],
current: 0,
timeEndTime: '',
timeEnd: '',
timeNow: '',
}
},
onLoad(option) {
@@ -145,6 +147,10 @@ export default {
uni.$on('refresh', () => {
this.getListInit()
})
uni.$on('updateList', () => {
this.getDetail()
})
},
onShow() {
document.title = '活动报名'
@@ -154,6 +160,16 @@ export default {
this.$http.post(`/app/appvillageactivityinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.detail = res.data
console.log('结束时间', this.detail.endTime)
this.timeEnd = new Date(this.detail.endTime).getTime()
console.log('过去时间戳', this.timeEnd)
this.timeNow = new Date().getTime()
console.log('当前时间戳', this.timeNow)
console.log('过去时间戳加上24小时', this.timeEnd * 1 + 24 * 60 * 60 * 1000)
if (this.timeNow * 1 - this.timeEnd * 1 < 24 * 60 * 60 * 1000) {
console.log('可以添加')
}
if (this.detail) {
if (this.detail.url) {