|
|
|
@ -13,13 +13,13 @@ |
|
|
|
|
<view class="label">状态:</view> |
|
|
|
|
<view class="val">{{ statusList[comStatus] }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"> |
|
|
|
|
<view v-if="form.whetherToShowApplicants === '1'" class="line"> |
|
|
|
|
<view class="label">人数限制:</view> |
|
|
|
|
<view class="val">{{ form.quantityLimit }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line items-start"> |
|
|
|
|
<view class="label">举办时间:</view> |
|
|
|
|
<view class="val">{{ form.playStartTime + ' ~ ' + form.playEndTime }}</view> |
|
|
|
|
<view class="val">{{ form.startTime + ' ~ ' + form.endTime }}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"> |
|
|
|
|
<view class="label">活动地点:</view> |
|
|
|
@ -55,7 +55,7 @@ |
|
|
|
|
|
|
|
|
|
<view class="btns"> |
|
|
|
|
<button class="share" open-type="share">分享</button> |
|
|
|
|
<view :class="['btn sign', {signed, disabled: comStatus !== 1}]" @click="presign">{{ comStatus === 1 ? (signed ? '取消报名' : '立刻报名') : statusList[comStatus] }}</view> |
|
|
|
|
<view :class="['btn sign', {signed, disabled: comStatus !== 1}]" @click="presign">{{ stopSign ? '已截止报名' : comStatus === 1 ? (signed ? '取消报名' : '立刻报名') : statusList[comStatus] }}</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<uni-popup ref="popup" type="dialog"> |
|
|
|
@ -73,9 +73,10 @@ |
|
|
|
|
return { |
|
|
|
|
Common, |
|
|
|
|
id: '', |
|
|
|
|
statusList: ['未开始', '进行中', '已截止报名', '已结束'], |
|
|
|
|
statusList: ['待开始', '进行中', '已截止报名', '已结束'], |
|
|
|
|
comStatus: 0, |
|
|
|
|
signed: 0, |
|
|
|
|
stopSign: 0, |
|
|
|
|
curTab: 0, |
|
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
|
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore |
|
|
|
@ -84,6 +85,8 @@ |
|
|
|
|
pageSize: 5, |
|
|
|
|
total: 0, |
|
|
|
|
form: { |
|
|
|
|
startTime: '', |
|
|
|
|
endTime: '', |
|
|
|
|
quantityLimit: '', |
|
|
|
|
playStartTime: '', |
|
|
|
|
playEndTime: '', |
|
|
|
@ -120,6 +123,7 @@ |
|
|
|
|
onShow() { |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
|
this.stopSign = 0 |
|
|
|
|
this.id = options.id |
|
|
|
|
this.getInfo() |
|
|
|
|
}, |
|
|
|
@ -131,6 +135,9 @@ |
|
|
|
|
}) |
|
|
|
|
getCompetition(this.id).then(async (res) => { |
|
|
|
|
const data = res.competition |
|
|
|
|
data.startTime = data.playStartTime.substr(5, 11).split('-').join('/') |
|
|
|
|
data.endTime = data.playEndTime.substr(5, 11).split('-').join('/') |
|
|
|
|
|
|
|
|
|
this.form = data |
|
|
|
|
|
|
|
|
|
this.now = await Util.getNow() |
|
|
|
@ -163,14 +170,18 @@ |
|
|
|
|
const { now } = this |
|
|
|
|
// 报名中(whetherToSignUp 是否已报名 1已报名,0未报名) |
|
|
|
|
if (now < signUpStartTime) { |
|
|
|
|
// 待开始 |
|
|
|
|
status = 0 |
|
|
|
|
} else if (now > signUpStartTime && now < signUpEndTime) { |
|
|
|
|
// 报名中 |
|
|
|
|
status = 1 |
|
|
|
|
if (data.competitionRegistration) signed = 1 |
|
|
|
|
} else if (now > signUpEndTime && now < playEndTime) { |
|
|
|
|
status = 2 |
|
|
|
|
// 已截止报名 |
|
|
|
|
this.stopSign = 1 |
|
|
|
|
} else if (now > playEndTime) { |
|
|
|
|
status = 3 |
|
|
|
|
// 已结束 |
|
|
|
|
status = 2 |
|
|
|
|
} |
|
|
|
|
this.comStatus = status |
|
|
|
|
this.signed = signed |
|
|
|
@ -184,6 +195,7 @@ |
|
|
|
|
competitionId: this.id, |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
querySource: 1, |
|
|
|
|
}).then(async ({ data }) => { |
|
|
|
|
this.list = this.reachBottom > 0 ? [...this.list, ...data.records] : data.records |
|
|
|
|
this.page++ // 每次获取了数据后page+1 |
|
|
|
|