|
|
@ -11,7 +11,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="label">状态:</view> |
|
|
|
<view class="label">状态:</view> |
|
|
|
<view class="val">进行中</view> |
|
|
|
<view class="val">{{ statusList[comStatus] }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="label">人数限制:</view> |
|
|
|
<view class="label">人数限制:</view> |
|
|
@ -37,7 +37,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<ul class="tab"> |
|
|
|
<ul class="tab"> |
|
|
|
<li :class="{active: curTab === 0}" @click="tabChange(0)">活动详情</li> |
|
|
|
<li :class="{active: curTab === 0}" @click="tabChange(0)">活动详情</li> |
|
|
|
<li :class="{active: curTab === 1}" @click="tabChange(1)">活动通知</li> |
|
|
|
<!-- <li :class="{active: curTab === 1}" @click="tabChange(1)">活动通知</li> --> |
|
|
|
<li v-if="form.whetherToShowApplicants === '1'" :class="{active: curTab === 2}" @click="tabChange(2)">已报名人员({{ form.applicantNum }}/{{ form.quantityLimit }})</li> |
|
|
|
<li v-if="form.whetherToShowApplicants === '1'" :class="{active: curTab === 2}" @click="tabChange(2)">已报名人员({{ form.applicantNum }}/{{ form.quantityLimit }})</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<view class="btns"> |
|
|
|
<view class="btns"> |
|
|
|
<button class="share" open-type="share">分享</button> |
|
|
|
<button class="share" open-type="share">分享</button> |
|
|
|
<view :class="['btn sign', {signed: form.signed, disabled: !form.signing}]" @click="presign">{{ form.signed ? '取消报名' : '立刻报名' }}</view> |
|
|
|
<view :class="['btn sign', {signed, disabled: comStatus !== 1}]" @click="presign">{{ comStatus === 1 ? (signed ? '取消报名' : '立刻报名') : statusList[comStatus] }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<uni-popup ref="popup" type="dialog"> |
|
|
|
<uni-popup ref="popup" type="dialog"> |
|
|
@ -73,6 +73,9 @@ |
|
|
|
return { |
|
|
|
return { |
|
|
|
Common, |
|
|
|
Common, |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
|
|
|
|
statusList: ['未开始', '进行中', '已截止报名', '已结束'], |
|
|
|
|
|
|
|
comStatus: 0, |
|
|
|
|
|
|
|
signed: 0, |
|
|
|
curTab: 0, |
|
|
|
curTab: 0, |
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore |
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore |
|
|
@ -151,18 +154,26 @@ |
|
|
|
// 定时处理时间及状态 |
|
|
|
// 定时处理时间及状态 |
|
|
|
handleStatus () { |
|
|
|
handleStatus () { |
|
|
|
const data = this.form |
|
|
|
const data = this.form |
|
|
|
let signing = 0 // 当前处于报名时间内 |
|
|
|
let status = 0 |
|
|
|
let signed = 0 // 是否已经报了名 |
|
|
|
let signed = 0 // 是否已经报了名 |
|
|
|
const signUpStartTime = new Date(data.signUpStartTime) // 报名开始时间 |
|
|
|
const signUpStartTime = new Date(data.signUpStartTime) // 报名开始时间 |
|
|
|
const signUpEndTime = new Date(data.signUpEndTime) // 报名结束时间 |
|
|
|
const signUpEndTime = new Date(data.signUpEndTime) // 报名结束时间 |
|
|
|
|
|
|
|
const playStartTime = new Date(data.playStartTime) // 活动结束时间 |
|
|
|
|
|
|
|
const playEndTime = new Date(data.playEndTime) // 活动结束时间 |
|
|
|
const { now } = this |
|
|
|
const { now } = this |
|
|
|
// 报名中(whetherToSignUp 是否已报名 1已报名,0未报名) |
|
|
|
// 报名中(whetherToSignUp 是否已报名 1已报名,0未报名) |
|
|
|
if (now > signUpStartTime && now < signUpEndTime) { |
|
|
|
if (now < signUpStartTime) { |
|
|
|
signing = 1 |
|
|
|
status = 0 |
|
|
|
|
|
|
|
} else if (now > signUpStartTime && now < signUpEndTime) { |
|
|
|
|
|
|
|
status = 1 |
|
|
|
if (data.competitionRegistration) signed = 1 |
|
|
|
if (data.competitionRegistration) signed = 1 |
|
|
|
|
|
|
|
} else if (now > signUpEndTime && now < playEndTime) { |
|
|
|
|
|
|
|
status = 2 |
|
|
|
|
|
|
|
} else if (now > playEndTime) { |
|
|
|
|
|
|
|
status = 3 |
|
|
|
} |
|
|
|
} |
|
|
|
this.$set(this.form, 'signing', signing) |
|
|
|
this.comStatus = status |
|
|
|
this.$set(this.form, 'signed', signed) |
|
|
|
this.signed = signed |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 已报名人员 |
|
|
|
// 已报名人员 |
|
|
|
getRegList() { |
|
|
|
getRegList() { |
|
|
@ -196,7 +207,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 报名前的判断 |
|
|
|
// 报名前的判断 |
|
|
|
async presign() { |
|
|
|
async presign() { |
|
|
|
if (!this.form.signing) return this.$util.errMsg('现在不在报名时间!') |
|
|
|
if (this.comStatus !== 1) return false |
|
|
|
if (this.form.competitionRegistration) { // 取消报名 |
|
|
|
if (this.form.competitionRegistration) { // 取消报名 |
|
|
|
this.cancelSign() |
|
|
|
this.cancelSign() |
|
|
|
} else { // 报名 |
|
|
|
} else { // 报名 |
|
|
|