649 lines
25 KiB
HTML
649 lines
25 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
<style>
|
|
|
|
.container img {
|
|
background-size: contain;
|
|
width: 100%;
|
|
height: auto;
|
|
margin: 5px auto;
|
|
display: block;
|
|
}
|
|
|
|
.header {
|
|
padding: 20px;
|
|
}
|
|
|
|
.content {
|
|
line-height: 26px;
|
|
padding: 0px 20px 56px 20px;
|
|
}
|
|
|
|
.title {
|
|
font-weight: bold;
|
|
font-size: 19px;
|
|
color: #505050;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.van-divider {
|
|
border-color: grey;
|
|
margin: 0;
|
|
}
|
|
|
|
.van-skeleton {
|
|
padding: 20px;
|
|
}
|
|
|
|
.van-skeleton__content {
|
|
height: 600px;
|
|
padding-top: 60px;
|
|
}
|
|
|
|
.van-skeleton__row, .van-skeleton__title {
|
|
height: 30px;
|
|
}
|
|
|
|
.footer {
|
|
background-color: white;
|
|
position: fixed;
|
|
bottom: 0;
|
|
width: 100%;
|
|
height: 60px;
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;
|
|
left: 0;
|
|
}
|
|
|
|
.footer .van-button {
|
|
height: 34px;
|
|
border-radius: 6px;
|
|
width: 90% !important;
|
|
}
|
|
|
|
.family_join {
|
|
background-color: #ff976a;
|
|
color: white;
|
|
}
|
|
|
|
.join {
|
|
background-color: #0e78c5;
|
|
color: white;
|
|
}
|
|
|
|
.joinPopup {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: #f6f7f9;
|
|
}
|
|
|
|
.join_content {
|
|
padding: 20px;
|
|
height: calc(100% - 40px - 46px - 60px);
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.join_submit {
|
|
width: 90% !important;
|
|
}
|
|
|
|
.van-doc-card {
|
|
background-color: #fff;
|
|
border-radius: 6px;
|
|
box-shadow: 0 8px 12px #ebedf0;
|
|
line-height: 20px;
|
|
position: relative;
|
|
}
|
|
|
|
.van-card-header {
|
|
padding: 14px 20px;
|
|
border-bottom: 1px solid #ebeef5;
|
|
box-sizing: border-box;
|
|
color: #0e78c5;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.van-card-body {
|
|
padding: 0px 10px 0px 10px
|
|
}
|
|
|
|
.van-doc-card > div:first-child {
|
|
border: 2px #0e78c5 solid;
|
|
width: 26px;
|
|
border-radius: 6px;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 20px;
|
|
}
|
|
|
|
.van-cell {
|
|
padding: 8px 16px;
|
|
}
|
|
|
|
.van-tabs__wrap {
|
|
margin: 6px;
|
|
}
|
|
|
|
.van-tabs__nav--card {
|
|
border: none;
|
|
}
|
|
|
|
.van-tabs__nav--card .van-tab.van-tab--active {
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.van-tabs__nav--card .van-tab {
|
|
border-right: 0 !important;
|
|
}
|
|
|
|
.top_icon {
|
|
position: fixed;
|
|
bottom: 80px;
|
|
right: 20px;
|
|
}
|
|
|
|
.van-field__control {
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.list-card {
|
|
width: auto;
|
|
}
|
|
|
|
.companionList_empty_text {
|
|
text-align: center;
|
|
padding: 10px 0px;
|
|
font-size: 14px;
|
|
color: grey;
|
|
}
|
|
|
|
.header div span {
|
|
color: grey;
|
|
}
|
|
|
|
.header :last-child {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.van-empty {
|
|
position: relative;
|
|
transform: none;
|
|
top: 0;
|
|
left: 0;
|
|
background-color: transparent;
|
|
height: calc(100vh - 46px - 153px - 60px);
|
|
}
|
|
|
|
.submitButton {
|
|
background-color: white !important;
|
|
width: 100%;
|
|
height: 60px;
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;
|
|
}
|
|
|
|
.submitButton .van-button {
|
|
height: 34px;
|
|
border-radius: 6px;
|
|
width: 90% !important;
|
|
}
|
|
|
|
.van-image-preview img {
|
|
background-color: white;
|
|
}
|
|
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<van-sticky>
|
|
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="职工疗休养-酒店介绍"></van-nav-bar>
|
|
</van-sticky>
|
|
|
|
<!--线路详情-->
|
|
<van-skeleton title :loading="skeLoading" :row="12">
|
|
<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>
|
|
{{baseData.baseName}}
|
|
</div>
|
|
<div style="margin-top: 10px">
|
|
<div>
|
|
<span class="line_label">区  域:</span>
|
|
{{baseData.regionalNature}}
|
|
</div>
|
|
<div>
|
|
<span>创建模式:</span>
|
|
{{baseData.createMode === 1 ? '校工会' : '分工会'}}
|
|
</div>
|
|
<div>
|
|
<span>报名时间:</span>
|
|
{{moment(baseData.signUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
|
moment(baseData.signUpEndTime).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')}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<van-divider></van-divider>
|
|
<div v-if="baseData.content" v-html="baseData.content" class="content"></div>
|
|
<div v-else v-html="configData.notice" class="content"></div>
|
|
<!--<van-empty
|
|
v-else class="custom-image"
|
|
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
|
|
description="暂无详细信息"
|
|
></van-empty>-->
|
|
|
|
</div>
|
|
</van-skeleton>
|
|
|
|
<!--置顶图标-->
|
|
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
|
|
class="top_icon"></image>
|
|
|
|
<!--底部报名按钮-->
|
|
<div class="footer" v-if="fromUrlByMy != 'edit'">
|
|
<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()" class="join">报名结束</van-button>
|
|
</template>
|
|
</div>
|
|
|
|
<!--报名弹出框-->
|
|
<van-popup v-model:show="joinPopup" position="right" class="joinPopup">
|
|
<van-nav-bar @click-left="joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
|
|
<div class="join_content">
|
|
|
|
<van-form @submit="joinSubmit">
|
|
|
|
<!--基础信息-->
|
|
<div class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
基础信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<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 }]"
|
|
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
|
|
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
|
|
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>
|
|
</div>
|
|
</div>
|
|
|
|
<!--床位信息-->
|
|
<div class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
床位信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
|
|
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
|
|
readonly is-link label="床位"
|
|
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<van-field v-if="formData.bedInfo.bedType == '标准间'" :rules="[{ validator, message: '请选择是否拼房' }]"
|
|
label="是否拼房" name="validator">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal" v-model="formData.bedInfo.isSleepTogether">
|
|
<van-radio :name="true" shape="square">是</van-radio>
|
|
<van-radio :name="false" shape="square">否</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
|
|
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
|
|
v-model="formData.bedInfo.otherSleepUser"
|
|
:rules="[{ required: true }]"></van-field>
|
|
</div>
|
|
</div>
|
|
|
|
<!--随行人信息-->
|
|
<div class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header"
|
|
style="display: flex; justify-content: space-between; align-items: center">
|
|
<span style="float:left;">随行人信息</span>
|
|
<div>
|
|
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人</van-tag>
|
|
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
|
|
</div>
|
|
</div>
|
|
<div v-if="formData.companionList.length > 0" class="van-card-body">
|
|
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
|
|
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
|
|
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
|
|
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
|
|
type="digit" :rules="[{ required: true }]"></van-field>
|
|
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal" v-model="item.sex">
|
|
<van-radio name="男" shape="square">男</van-radio>
|
|
<van-radio name="女" shape="square">女</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号"
|
|
:rules="[{ required: true }]" type="digit"
|
|
v-model="item.idCard"></van-field>
|
|
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
|
|
:rules="[{ required: true }]" type="digit"
|
|
v-model="item.mobile"></van-field>
|
|
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
|
|
name="relation"
|
|
placeholder="随行人与本人关系" v-model="item.relation"
|
|
:rules="[{ required: true }]"></van-field>
|
|
|
|
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
|
|
name="bedType" placeholder="请选择房间"
|
|
v-model="item.bedInfo.bedType"></van-field>
|
|
<div style="font-size: 8px; color:orangered; padding-left: 16px; padding-bottom: 4px">
|
|
提醒:如果跟报名人员同一房间,无须选择!
|
|
</div>
|
|
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
|
|
readonly is-link label="床位"
|
|
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
|
|
<van-field v-if="item.bedInfo.bedType == '标准间'"
|
|
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal" v-model="item.bedInfo.isSleepTogether">
|
|
<van-radio :name="true" shape="square">是</van-radio>
|
|
<van-radio :name="false" shape="square">否</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
|
|
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
|
|
v-model="item.bedInfo.otherSleepUser"></van-field>
|
|
</van-tab>
|
|
</van-tabs>
|
|
</div>
|
|
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
|
|
<span>
|
|
如有随行人出行,请添加随行人
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="submitButton">
|
|
<van-button class="join join_submit">提交报名</van-button>
|
|
</div>
|
|
|
|
</van-form>
|
|
|
|
</div>
|
|
|
|
</van-popup>
|
|
|
|
<!--房间类型弹出框-->
|
|
<van-popup position="bottom" round v-model="roomVisible">
|
|
<van-picker
|
|
title="入住房间" show-toolbar
|
|
:columns="roomColumns"
|
|
@confirm="roomConfirm"
|
|
@cancel="roomCancel">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
<!--床位弹出框-->
|
|
<van-popup position="bottom" round v-model="bedVisible">
|
|
<van-picker
|
|
title="床位" show-toolbar
|
|
:columns="bedColumns"
|
|
@confirm="bedConfirm"
|
|
@cancel="bedVisible = false">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
<!--随行人关系弹出框-->
|
|
<van-popup position="bottom" round v-model="companionVisible">
|
|
<van-picker
|
|
title="与本人关系" show-toolbar
|
|
:columns="companionColumns"
|
|
@confirm="(value, index) => {formData.companionList[active].relation = value; companionVisible = false}"
|
|
@cancel="companionVisible = false">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
</div>
|
|
<script>
|
|
function getQueryString(name) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (r != null) return decodeURI(r[2]);
|
|
return null;
|
|
}
|
|
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
active: 0,
|
|
roomColumns: ['大床房', '标准间'],
|
|
bedColumns: ['1', '2'],
|
|
companionColumns: ['亲属', '朋友'],
|
|
bedVisible: false,
|
|
roomVisible: false,
|
|
companionVisible: false,
|
|
joinPopup: false,
|
|
skeLoading: true,
|
|
id: '',
|
|
baseData: {},
|
|
formData: {
|
|
userName: "${@shiro.getPrincipalProperty('username')}",
|
|
loginName: "${@shiro.getPrincipalProperty('loginname')}",
|
|
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
|
idCard: "",
|
|
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
|
lineName: '',
|
|
takePartInLineId: '',
|
|
takePartInUnionId: '',
|
|
companionList: [],
|
|
bedInfo: {},
|
|
},
|
|
self: true,
|
|
btnFlag: false,
|
|
index: 0,
|
|
scrollTop: 0,
|
|
fromUrlByMy: '',
|
|
enrollId: '',
|
|
configData: {},
|
|
}
|
|
},
|
|
methods: {
|
|
roomCancel() {
|
|
if (!this.self) {
|
|
this.formData.companionList[this.active].bedInfo.bedType = ''
|
|
}
|
|
this.roomVisible = false
|
|
},
|
|
roomConfirm(value, index) {
|
|
if (this.self) {
|
|
this.formData.bedInfo.bedType = value
|
|
} else {
|
|
this.formData.companionList[this.active].bedInfo.bedType = value
|
|
}
|
|
this.roomVisible = false
|
|
},
|
|
bedConfirm(value, index) {
|
|
if (this.self) {
|
|
this.formData.bedInfo.bedNum = value
|
|
} else {
|
|
this.formData.companionList[this.active].bedInfo.bedNum = value
|
|
}
|
|
this.bedVisible = false
|
|
},
|
|
validator(value) {
|
|
return value != null
|
|
},
|
|
async joinSubmit() {
|
|
const toast = vant.Toast.loading({
|
|
duration: 0,
|
|
forbidClick: true,
|
|
overlay: true,
|
|
message: '努力提交中',
|
|
})
|
|
const cloneData = clone(this.formData)
|
|
cloneData.companionList.forEach((item, index) => {
|
|
if (item.userName === '') {
|
|
cloneData.companionList.splice(index, 1)
|
|
}
|
|
})
|
|
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
|
|
enroll: JSON.stringify(cloneData),
|
|
})
|
|
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) {
|
|
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
|
|
}
|
|
}, 1000)
|
|
},
|
|
addCompanion() {
|
|
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
|
|
},
|
|
delCompanion() {
|
|
this.formData.companionList.splice(this.active, 1)
|
|
},
|
|
async join() {
|
|
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
|
|
enroll: JSON.stringify({
|
|
takePartInBaseManagementId: this.baseData.id,
|
|
isNormal: this.baseData.isNormal,
|
|
id: this.enrollId
|
|
}),
|
|
})
|
|
if (re.code !== 0) {
|
|
vant.Toast(re.msg)
|
|
return
|
|
}
|
|
if (this.fromUrlByMy !== 'editDo') {
|
|
this.formData = {
|
|
userName: "${@shiro.getPrincipalProperty('username')}",
|
|
loginName: "${@shiro.getPrincipalProperty('loginname')}",
|
|
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
|
idCard: "${@shiro.getPrincipalProperty('idcard')}",
|
|
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
|
baseName: this.baseData.baseName,
|
|
takePartInBaseManagementId: this.baseData.id,
|
|
companionList: [],
|
|
bedInfo: {},
|
|
}
|
|
this.$set(this.formData.bedInfo, 'bedType', '大床房')
|
|
}
|
|
this.joinPopup = true
|
|
},
|
|
async getData() {
|
|
const res = await $.get('/platform/theRapyRecuperation/baseManagement/selectBaseAllInfo', {
|
|
id: this.id
|
|
})
|
|
if (res.code === 0) {
|
|
this.baseData = res.data
|
|
this.formData.baseName = this.baseData.baseName
|
|
this.skeLoading = false
|
|
}
|
|
},
|
|
// 点击图片回到顶部方法,加计时器是为了过渡顺滑
|
|
backTop() {
|
|
const that = this
|
|
let timer = setInterval(() => {
|
|
let speed = Math.floor(-that.scrollTop / 5)
|
|
document.documentElement.scrollTop = document.body.scrollTop = that.scrollTop + speed
|
|
if (that.scrollTop === 0) {
|
|
clearInterval(timer)
|
|
}
|
|
}, 16)
|
|
},
|
|
// 为了计算距离顶部的高度,当高度大于100显示回顶部图标,小于100则隐藏
|
|
scrollToTop() {
|
|
const that = this
|
|
that.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
|
|
that.btnFlag = that.scrollTop > 100;
|
|
},
|
|
//修改时查询报名信息,进行回显
|
|
async findSignUpInfoById() {
|
|
const res = await $.post('/platform/theRapyRecuperation/line/enroll/findSignUpInfoById/' + this.enrollId)
|
|
if (res.code === 0) {
|
|
this.formData = res.data
|
|
if (this.formData.bedInfo === null) {
|
|
this.formData.bedInfo = {}
|
|
}
|
|
if (this.formData.companionList) {
|
|
this.formData.companionList.forEach(item => {
|
|
if (item.bedInfo === null) {
|
|
item.bedInfo = {}
|
|
}
|
|
})
|
|
}
|
|
this.$forceUpdate()
|
|
}
|
|
},
|
|
async getConfigData() {
|
|
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
|
|
this.configData = resp.data
|
|
},
|
|
},
|
|
async created() {
|
|
this.id = getQueryString('id') ? getQueryString('id') : ''
|
|
this.enrollId = getQueryString('enrollId') ? getQueryString('enrollId') : ''
|
|
this.index = getQueryString('index') ? getQueryString('index') : ''
|
|
await this.getConfigData()
|
|
//编辑传出来的参数
|
|
this.fromUrlByMy = getQueryString('fromUrlByMy') ? getQueryString('fromUrlByMy') : ''
|
|
if (this.enrollId) {
|
|
await this.findSignUpInfoById()
|
|
}
|
|
this.getData()
|
|
},
|
|
mounted() {
|
|
window.addEventListener('scroll', this.scrollToTop)
|
|
document.addEventListener('click', function (event) {
|
|
// 打印被点击的元素标签名和 class
|
|
if (event.target.tagName === 'IMG') {
|
|
vant.ImagePreview([event.target.src])
|
|
}
|
|
})
|
|
},
|
|
destroyed() {
|
|
window.removeEventListener('scroll', this.scrollToTop)
|
|
},
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|