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