Browse Source

删除报名人员

dev
mk 1 year ago
parent
commit
0816eacba1
  1. 25
      src/views/activity/detail.vue

25
src/views/activity/detail.vue

@ -4,7 +4,8 @@
<img :src="info.coverPic" alt="" style="width: 100%;">
<div class="m-top15 p0">
<h2 style="margin: 0; font-size: 21px;">{{ info.activityName }}</h2>
<van-cell class="m-top15" :border="false" :title-style="{ 'max-width': '100px' }" :value-style="{ 'max-width':'250px' }" title="活动时间:"
<van-cell class="m-top15" :border="false" :title-style="{ 'max-width': '100px' }"
:value-style="{ 'max-width': '250px' }" title="活动时间:"
:value="`${info.startTime} 至 ${info.endTime}`"></van-cell>
<van-cell :border="false" :title-style="{ 'max-width': '140px' }" title="报名开始时间:"
:value="info.startTime"></van-cell>
@ -30,7 +31,7 @@
v-if="index + 1 === signUp.length"> <img src="@/assets/images/icons/add.png" alt=""
class="img_20 m-right7">添加</div>
<div class="flex flex-center2 flex-center1 flex1" v-show="signUp.length > 1"
@click="handelDelResi(item)">
@click="handelDelResi(item, index)">
<img src="@/assets/images/icons/del.png" alt="" class="img_20 m-right7">删除
</div>
</div>
@ -45,8 +46,7 @@
<template #icon>
<img src="@/assets/images/icons/share.png" alt="" class="img_20">
</template> 转发</van-button>
<van-button type="info" size="small" round @click="save" v-if="info.online === 1"
:disabled="new Date(this.info.cutOffTime.replace(/-/g, '/')).getTime() < Date.now() || this.info.currentParticipants >= this.info.participants">立即报名</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>
</div>
</div>
<Share :show="showShare" @closeShare="showShare = false" />
@ -87,30 +87,37 @@ export default {
const specifiedTimestamp = new Date(this.info.cutOffTime.replace(/-/g, '/')).getTime();
this.isPast = specifiedTimestamp < currentTimestamp;
},
async detail(id) {
async detail(id, delId) {
if (delId) {
this.signUp = this.signUp.filter(item => item.id != delId)
} else {
let res = await detail(id)
if (res.code === 0) {
this.info = res.data;
if (res.data.recordList.length != 0) {
this.signUp = res.recordList;
this.signUp = res.data.recordList
}
if (res.data.cutOffTime) {
this.checkIfPast()
}
}
}
},
handelAddResi() {
this.signUp.push({ name: "", mobile: "", remark: "", })
},
handelDelResi(item) {
handelDelResi(item, index) {
if (item.id) {
communityActivityApplicationRecordDelete([item.id]).then(res => {
if (res.code === 0) {
this.detail(this.$route.query.id);
this.signUp = this.signUp.filter(item=>item.id)
this.detail(this.$route.query.id, item.id);
}
}).catch(err => {
console.log(err);
})
} else {
this.signUp.splice(index, 1)
}
},
async save() {
if (this.$store.state.app.userInfo.mobile) {

Loading…
Cancel
Save