|
|
@ -25,26 +25,37 @@ |
|
|
|
<van-field v-model="signUp[index].mobile" required label="联系电话" placeholder="请输入您的电话号码" /> |
|
|
|
<van-field v-model="signUp[index].remark" label="备注" placeholder="请输入" rows="3" autosize |
|
|
|
type="textarea" /> |
|
|
|
</van-cell-group> |
|
|
|
<div class="flex flex-center1 m-top12"> |
|
|
|
<div class="flex flex-center2 flex-center1 flex1" @click="handelAddResi"> <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"> <img |
|
|
|
src="@/assets/images/icons/del.png" alt="" class="img_20 m-right7">删除</div> |
|
|
|
<div class="flex flex-center2 flex-center1 flex1" @click="handelAddResi" |
|
|
|
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)"> |
|
|
|
<img src="@/assets/images/icons/del.png" alt="" class="img_20 m-right7">删除 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</van-cell-group> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="bot_btn flex flex-center2" style="height: 50px;"> |
|
|
|
<div class="flex1 flex flex-center1 flex-center2">报名人数:<span class="orange font-size18">{{info.currentParticipants || 0}}</span> / {{info.participants}}人</div> |
|
|
|
<div class="flex1 flex flex-center1 flex-center2"> <van-button size="small" class="m-right7" round> |
|
|
|
<div class="flex1 flex flex-center1 flex-center2">报名人数:<span class="orange font-size18">{{ |
|
|
|
info.currentParticipants || 0 }}</span> / {{ info.participants }}人</div> |
|
|
|
<div class="flex1 flex flex-center1 flex-center2"> |
|
|
|
<van-button size="small" class="m-right7" round @click="showShare = true"> |
|
|
|
<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></div> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Share :show="showShare" @closeShare="showShare = false" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {addActivityRecord,detail} from "@/api/activity" |
|
|
|
import { addActivityRecord, detail, communityActivityApplicationRecordDelete } from "@/api/activity" |
|
|
|
import Share from "@/components/Share" |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -53,7 +64,8 @@ export default { |
|
|
|
{ name: "", mobile: "", remark: "" }, |
|
|
|
], |
|
|
|
info: {}, |
|
|
|
isPast:false |
|
|
|
isPast: false, |
|
|
|
showShare: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -65,6 +77,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
checkIfPast() { |
|
|
|
const currentTimestamp = Date.now(); |
|
|
|
const specifiedTimestamp = new Date(this.info.cutOffTime.replace(/-/g, '/')).getTime(); |
|
|
@ -74,6 +87,9 @@ export default { |
|
|
|
let res = await detail(id) |
|
|
|
if (res) { |
|
|
|
this.info = res; |
|
|
|
if (res.recordList) { |
|
|
|
this.signUp = res.recordList; |
|
|
|
} |
|
|
|
if (res.cutOffTime) { |
|
|
|
this.checkIfPast() |
|
|
|
} |
|
|
@ -82,8 +98,9 @@ export default { |
|
|
|
handelAddResi() { |
|
|
|
this.signUp.push({ name: "", mobile: "", remark: "", }) |
|
|
|
}, |
|
|
|
handelDelResi() { |
|
|
|
this.signUp.pop() |
|
|
|
async handelDelResi(item) { |
|
|
|
let res = await communityActivityApplicationRecordDelete([item.id]) |
|
|
|
this.detail(this.$route.query.id) |
|
|
|
}, |
|
|
|
async save() { |
|
|
|
this.signUp.forEach((item) => { |
|
|
@ -98,10 +115,11 @@ export default { |
|
|
|
if (res) { |
|
|
|
this.$toast.success(res) |
|
|
|
this.signUp = [{ name: "", mobile: "", remark: "" }] |
|
|
|
this.detail(this.$route.query.id) |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
components: { Share }, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
} |
|
|
@ -111,12 +129,15 @@ export default { |
|
|
|
:deep(.p0>.van-cell) { |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
|
|
|
|
:deep(.van-cell) { |
|
|
|
padding: 16px 8px; |
|
|
|
} |
|
|
|
|
|
|
|
:deep(.van-cell__title) { |
|
|
|
color: #666666; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
&>span { |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|