commit
This commit is contained in:
@@ -9,68 +9,103 @@ layout("/mobile/platform.html"){
|
||||
/*height: 200px;*/
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.remark-content{
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: calc(100vh - 46px - 44px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.remark-content *{
|
||||
max-width: 100%!important;
|
||||
}
|
||||
|
||||
.joinPopup {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f6f7f9;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="个人报名" left-arrow placeholder fixed
|
||||
@click-left="history.back()"></van-nav-bar>
|
||||
<van-nav-bar @click-left="location.replace('/mobile/activity/unionActivity')" fixed left-arrow
|
||||
placeholder
|
||||
title="个人报名"></van-nav-bar>
|
||||
|
||||
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px"
|
||||
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
|
||||
<van-button v-if="!isRegister && !isRegisterFull" @click="doSave()"
|
||||
style="border-radius: 10px" block
|
||||
<van-button :color="themeColor" @click="doSave()"
|
||||
block style="border-radius: 10px"
|
||||
type="info"
|
||||
:color="themeColor">
|
||||
v-if="!isRegister && !isRegisterFull">
|
||||
立即报名
|
||||
</van-button>
|
||||
<van-button v-else-if="!isRegister && isRegisterFull" @click="doSave()"
|
||||
style="border-radius: 10px" block
|
||||
disabled
|
||||
<van-button :color="themeColor" @click="doSave()"
|
||||
block disabled
|
||||
style="border-radius: 10px"
|
||||
type="info"
|
||||
:color="themeColor">
|
||||
v-else-if="!isRegister && isRegisterFull">
|
||||
名额已满
|
||||
</van-button>
|
||||
<van-button v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()"
|
||||
@click="doCancel"
|
||||
style="border-radius: 10px" block type="info"
|
||||
color="red">
|
||||
<van-button @click="doCancel"
|
||||
block
|
||||
color="red" style="border-radius: 10px" type="info"
|
||||
v-else-if="isRegister && moment().valueOf() < moment(o.applyEndTime).valueOf()">
|
||||
取消报名
|
||||
</van-button>
|
||||
</div>
|
||||
|
||||
<div style="margin: 20px 20px 10px 20px"
|
||||
<!--<div style="margin: 20px 20px 10px 20px"
|
||||
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()">
|
||||
<van-button
|
||||
:color="themeColor"
|
||||
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
|
||||
@click="doSign()" style="border-radius: 10px" block type="info"
|
||||
:color="themeColor">
|
||||
@click="doSign()" block style="border-radius: 10px"
|
||||
type="info">
|
||||
{{isSign?'签到成功':'立即签到'}}
|
||||
</van-button>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
|
||||
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
|
||||
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
|
||||
</van-popup>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, self_mixin],
|
||||
mixins: [mobileMixins, self_mixin_h5],
|
||||
data() {
|
||||
return {
|
||||
activityId: '',
|
||||
o: {},
|
||||
tagCloseable: true,
|
||||
isRegister: false,
|
||||
isSign: false
|
||||
isSign: false,
|
||||
|
||||
activityContent: '',
|
||||
showActivityInfoPopup: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
remarkClick(event){
|
||||
//如果点击的是图片
|
||||
if(event.target.tagName === 'IMG'){
|
||||
vant.ImagePreview([event.target.src])
|
||||
}
|
||||
},
|
||||
showActivityInfo(activityContent){
|
||||
console.log(activityContent)
|
||||
this.activityContent = ''
|
||||
this.activityContent = activityContent
|
||||
this.showActivityInfoPopup = true
|
||||
},
|
||||
async isRegisterForMe() {
|
||||
const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId})
|
||||
if (resp.code === 0) {
|
||||
@@ -97,13 +132,19 @@ layout("/mobile/platform.html"){
|
||||
const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 1000)
|
||||
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: '您已报名成功,请按时参加活动哦',
|
||||
}).then(() => {
|
||||
window.location.reload()
|
||||
}).catch(() => {
|
||||
window.location.reload()
|
||||
})
|
||||
} else {
|
||||
this.$toast.fail(resp.msg)
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -112,22 +153,31 @@ layout("/mobile/platform.html"){
|
||||
title: '提示',
|
||||
message: '您确认要取消报名吗?',
|
||||
})
|
||||
const loading = this.$toast.loading({
|
||||
message: '取消中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const loading = this.$toast.loading({
|
||||
message: '取消中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.history.back()
|
||||
}, 1000)
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
}).then(() => {
|
||||
window.location.reload()
|
||||
}).catch(() => {})
|
||||
// setTimeout(() => {
|
||||
// this.$toast.success(resp.msg)
|
||||
// pjaxReplace('/mobile/activity/unionActivity')
|
||||
// }, 1000)
|
||||
} else {
|
||||
this.$toast.fail(resp.msg)
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -168,4 +218,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
Reference in New Issue
Block a user