This commit is contained in:
@jyuhsin
2025-05-30 11:06:16 +08:00
parent 5346297c7d
commit 3180d0cb95
13 changed files with 387 additions and 396 deletions
@@ -263,9 +263,9 @@ layout("/mobile/platform.html"){
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
{{baseData.lotName}}
</van-tag>
<!--<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
{{baseData.regionalNature}}
</van-tag>-->
{{baseData.baseName}}
</div>
<div style="margin-top: 10px">
@@ -279,13 +279,13 @@ layout("/mobile/platform.html"){
</div>
<div>
<span>报名时间:</span>
{{moment(baseData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(baseData.signUpEndTime).format('YYYY-MM-DD HH:mm')}}
{{moment(configData.fragmentStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(configData.fragmentEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
<div>
<span>活动时间:</span>
{{moment(baseData.activityStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(baseData.activityEndTime).format('YYYY-MM-DD HH:mm')}}
{{moment(configData.fragmentPlayStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
moment(configData.fragmentPlayEndTime).format('YYYY-MM-DD HH:mm')}}
</div>
</div>
</div>
@@ -307,17 +307,13 @@ layout("/mobile/platform.html"){
</van-button>
</div>
<div class="footer" v-else>
<template v-if="baseData.isNormal==0&&baseData.isNormalFalse>0">
<template v-if="baseData.isNormal == 0 && baseData.isNormalFalse > 0">
<van-button @click="join" class="join">我要报名</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">我要报名
</van-button>
<!--<van-button
v-if="moment().unix() <= moment(baseData.signUpEndTime).unix() && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
@click="helpJoin" class="join">替他人报名
</van-button>-->
<van-button v-if="moment().unix() > moment(baseData.signUpEndTime).unix()" class="join">报名结束</van-button>
<van-button v-if="moment().unix() >= moment(configData.fragmentStartTime).unix() && moment().unix() <= moment(configData.fragmentEndTime).unix()"
@click="join" class="join">我要报名</van-button>
<van-button v-if="moment().unix() > moment(configData.fragmentEndTime).unix()" class="join">报名结束</van-button>
</template>
</div>
@@ -334,13 +330,7 @@ layout("/mobile/platform.html"){
</div>
<div class="van-card-body">
<van-field v-if="isHelpJoin" label="姓名" readonly v-model="formData.userName"></van-field>
<van-field v-else="!isHelpJoin" label="姓名"
:rules="[{ required: true }]"
placeholder="请输入工号或姓名进行查询" required
@click="show = true"
v-model="formData.userName"></van-field>
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="工号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证号" name="idCard" :rules="[{ required: true }]"
@@ -349,7 +339,10 @@ layout("/mobile/platform.html"){
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="报名酒店" readonly v-model="formData.baseName"></van-field>
<van-field label="活动时间" readonly @click="if(fromUrlByMy != 'find')timeVisible = true"
<van-field label="出行天数" readonly @click="if(fromUrlByMy != 'find')playDayVisible = true"
:rules="[{ required: true }]" placeholder="请选择出行天数" required
is-link v-model="formData.playDay" name="playDay"></van-field>
<van-field label="活动时间" readonly @click="specificTimeClick"
:rules="[{ required: true }]" placeholder="请选择活动时间" required
is-link v-model="formData.specificTime" name="specificTime"></van-field>
</div>
@@ -464,6 +457,15 @@ layout("/mobile/platform.html"){
</div>
</van-popup>
<van-popup position="bottom" round v-model="playDayVisible">
<van-picker
title="出行天数" show-toolbar
:columns="playDayColumns"
@confirm="playDayConfirm"
@cancel="playDayVisible = false">
</van-picker>
</van-popup>
<!--房间类型弹出框-->
<van-popup position="bottom" round v-model="roomVisible">
<van-picker
@@ -495,16 +497,6 @@ layout("/mobile/platform.html"){
</van-picker>
</van-popup>
<!--时间弹出框-->
<!--<van-popup position="bottom" round v-model="timeVisible">
<van-picker
title="具体时间" show-toolbar
:columns="timeArray"
@confirm="(value, index) => {formData.specificTime = value; timeVisible = false}"
@cancel="timeVisible = false">
</van-picker>
</van-popup>-->
<van-calendar type="range" v-model="timeVisible"
ref="cal" @confirm="calConfirm"
:min-date="minDate" :max-date="maxDate"
@@ -512,24 +504,6 @@ layout("/mobile/platform.html"){
@select="daySelect"
:max-range="lotValue" :style="{ height: '660px' }"></van-calendar>
<van-popup position="bottom" round v-model="show" :style="{ height: '60%' }" closeable>
<van-search v-model="result" show-action style="padding: 10px;margin-top: 45px" placeholder="请输入工号或姓名搜索"
@input="delaySearch">
</van-search>
<van-cell-group>
<div>
<van-checkbox-group style="text-align: center">
<van-cell-group>
<van-cell v-for="(item, index) in userList" :key="item.index" clickable
:title="item.name"
@click="toResult(item.loginname)">
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</van-cell-group>
</van-popup>
</div>
<script>
function getQueryString(name) {
@@ -555,7 +529,6 @@ layout("/mobile/platform.html"){
tarBarActive: 0,
roomColumns: ['大床房', '标准间'],
bedColumns: ['1', '2'],
//companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女'],
bedVisible: false,
roomVisible: false,
@@ -584,13 +557,9 @@ layout("/mobile/platform.html"){
enrollId: '',
timeArray: [],
defaultIndex: 0,
isHelpJoin: false,
userList: [],
show: false,
result: '',
helpUser: 1,
weekList: {
0: '周日',
1: '周一',
@@ -601,14 +570,32 @@ layout("/mobile/platform.html"){
6: '周六',
},
chooseDate: [],
configData: {},
playDayVisible: false,
playDayColumns: [],
}
},
methods: {
playDayConfirm(val) {
this.formData.playDay = val.value
this.lotValue = val.value === 2.5 ? 3 : val.value
this.playDayVisible = false
},
specificTimeClick() {
if(!this.formData.playDay) {
this.$toast('请先选择出行天数')
return
}
if(this.fromUrlByMy !== 'find') this.timeVisible = true
},
pageBack() {
if(this.fromUrlByMy !== 'find') {
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
} else {
window.removeEventListener('scroll', this.scrollToTop)
document.removeEventListener('click', this.handleClick)
if(['find', 'editDo'].includes(this.fromUrlByMy)) {
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation')
} else {
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
}
},
calConfirm(date) {
@@ -693,15 +680,12 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
let toast = null
if (!this.enrollId) {
toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
}
let toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
@@ -711,37 +695,16 @@ layout("/mobile/platform.html"){
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
enroll: JSON.stringify(cloneData),
})
if (this.enrollId) {
if (resp.code === 0) {
vant.Dialog.alert({
title: '温馨提示',
message: '修改成功,请务必联系并告知旅行社',
}).then(() => {
if (this.helpUser === 1) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
})
} else {
vant.Toast(resp.msg)
}
toast.close()
if (resp.code === 0) {
vant.Dialog.alert({
title: '温馨提示',
message: this.enrollId ? '修改成功,请务必联系并告知旅行社' : resp.msg,
}).then(() => {
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
})
} else {
setTimeout(() => {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0 && this.helpUser === 1) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
} else {
this.helpJoin();
}
}, 1000)
vant.Toast(resp.msg)
}
},
addCompanion() {
@@ -750,26 +713,7 @@ layout("/mobile/platform.html"){
delCompanion() {
this.formData.companionList.splice(this.active, 1)
},
async helpJoin() {
this.formData = {
userName: "",
loginName: "",
unionName: "",
idCard: "",
mobile: "",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
}
this.helpUser = 0;
if(this.index == 3) {
await this.getTimeArray()
}
this.joinPopup = true
},
async join() {
this.helpUser = 1
if (this.fromUrlByMy !== 'find') {
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
@@ -834,12 +778,15 @@ layout("/mobile/platform.html"){
this.formData.baseName = this.baseData.baseName
this.skeLoading = false
//如果是四晚五天,就获取周一到周五
/*if (this.baseData.lotName === '四晚五天') {
this.timeArray = this.getTimeByLot1()
} else if (this.baseData.lotName === '两晚三天') {
this.timeArray = this.getTimeByLot2()
}*/
if(this.baseData.allowDay) {
this.playDayColumns = []
const list = JSON.parse(this.baseData.allowDay)
list.forEach(item => {
this.playDayColumns.push({
text: item + '天', value: item
})
})
}
}
},
async getTimeArray() {
@@ -848,51 +795,10 @@ layout("/mobile/platform.html"){
})
this.timeArray = res.data.days
this.holidays = res.data.holidays
this.lotValue = Number(res.data.lotValue)
//this.lotValue = Number(res.data.lotValue)
this.minDate = new Date(res.data.minDate)
this.maxDate = new Date(res.data.maxDate)
},
getTimeByLot1() {
let timeArray = []
let now_date = moment()//当前时间
let start_date = moment(this.baseData.activityStartTime) // 时间区间开始日期
let end_date = moment(this.baseData.activityEndTime) // 时间区间结束日期
while (start_date <= end_date) {
if (start_date.day() === 1) {
const week_start = start_date.format('MM月DD日')
const week_end = start_date.clone().add(4, 'day')
if (week_end <= end_date && now_date < start_date) {
timeArray.push(week_start + '-' + week_end.format('MM月DD日'))
}
start_date.add(7, 'day')
} else {
start_date.add(1, 'day')
}
}
return timeArray
},
getTimeByLot2() {
let timeArray = []
let now_date = moment()//当前时间
let start_date = moment(this.baseData.activityStartTime) // 时间区间开始日期
let end_date = moment(this.baseData.activityEndTime) // 时间区间结束日期
while (start_date <= end_date) {
if (start_date.day() === 5) {
const week_start = start_date.format('MM月DD日')
const week_end = start_date.clone().add(2, 'day')
if (week_end <= end_date && now_date < start_date) {
timeArray.push(week_start + '-' + week_end.format('MM月DD日'))
}
start_date.add(7, 'day')
} else {
start_date.add(1, 'day')
}
}
timeArray = timeArray.filter(v => {
return v !== '09月29日-10月01日' && v !== '10月06日-10月08日' && v !== '09月15日-09月17日'
})
return timeArray
},
// 点击图片回到顶部方法,加计时器是为了过渡顺滑
backTop() {
const that = this
@@ -953,6 +859,10 @@ layout("/mobile/platform.html"){
this.userList = data
}
},
async getConfigData() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
async toResult(loginname) {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
@@ -1022,6 +932,7 @@ layout("/mobile/platform.html"){
},
},
async created() {
await this.getConfigData()
this.id = getQueryString('id') ? getQueryString('id') : ''
this.enrollId = getQueryString('enrollId') ? getQueryString('enrollId') : ''
this.index = getQueryString('index') ? getQueryString('index') : ''
@@ -1044,7 +955,7 @@ layout("/mobile/platform.html"){
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', (event) => this.handleClick(event))
//document.addEventListener('click', (event) => this.handleClick(event))
}
this.$nextTick(() => {
@@ -1055,8 +966,7 @@ layout("/mobile/platform.html"){
window.addEventListener('scroll', this.scrollToTop)
},
destroyed() {
window.removeEventListener('scroll', this.scrollToTop)
document.removeEventListener('click', (event) => this.handleClick(event))
},
})
</script>