Browse Source

活动详情按钮权限

feature
mk 1 year ago
parent
commit
bcf79b7601
  1. 34
      src/views/activity/detail.vue

34
src/views/activity/detail.vue

@ -46,7 +46,7 @@
<template #icon>
<img src="@/assets/images/icons/share.png" alt="" class="img_20">
</template> 转发</van-button>
<van-button type="info" size="small" :disabled="new Date(this.info.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || this.info.currentParticipants >= this.info.participants" round @click="save" v-if="info.online === 1">立即报名</van-button>
<van-button type="info" size="small" :disabled="disabledRecord(info)" round @click="save" v-if="info.online === 1">立即报名</van-button>
</div>
</div>
<Share :show="showShare" @closeShare="showShare = false" />
@ -113,29 +113,35 @@ export default {
this.isPast = specifiedTimestamp < currentTimestamp;
},
async detail(id, delId) {
if (delId) {
this.signUp = this.signUp.filter(item => item.id != delId)
} else {
let res = await detail(id)
const handleResponse = (res) => {
if (res.code === 0) {
this.info = res.data;
if (res.data.recordList.length != 0) {
this.signUp = res.data.recordList
this.info.participants = res.data.participants;
this.info.currentParticipants = res.data.currentParticipants;
if (res.data.recordList && res.data.recordList.length > 0) {
this.signUp = res.data.recordList;
}
if (res.data.cutOffTime) {
this.checkIfPast()
this.checkIfPast();
}
}
};
if (delId) {
this.signUp = this.signUp.filter(item => item.id != delId);
}
let res = await detail(id);
handleResponse(res);
},
handelAddResi() {
this.signUp.push({ name: "", mobile: "", remark: "", })
},
handelDelResi(item, index) {
if (item.id) {
let than = this
communityActivityApplicationRecordDelete([item.id]).then(res => {
if (res.code === 0) {
this.detail(this.$route.query.id, item.id);
than.detail(this.$route.query.id, item.id);
}
}).catch(err => {
console.log(err);
@ -175,7 +181,15 @@ export default {
},
},
components: { Share, registerDialog },
computed: {},
computed: {
disabledRecord() {
return (item) => {
if (!item.cutOffTime || item.online != 1) return true
let flag = new Date(item.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || item.currentParticipants >= item.participants || item.currentParticipants >= item.participants;
return flag || false
}
},
},
watch: {},
}
</script>

Loading…
Cancel
Save