This commit is contained in:
Paidax
2024-11-29 09:03:59 +08:00
commit 2ffadd89a7
3480 changed files with 879405 additions and 0 deletions
@@ -0,0 +1,373 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-doc-card {
background-color: #fff;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
position: relative;
}
.van-doc-card > div:first-child {
border: 2px #0e78c5 solid;
width: 26px;
border-radius: 6px;
position: absolute;
top: 0;
left: 20px;
}
.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
}
.join_content {
padding: 10px;
overflow-y: auto;
height: calc(100vh - 46px - 20px - 60px);
}
.basic .van-cell {
flex-direction: row-reverse;
}
.van-cell__label {
color: #323233;
font-size: 14px;
line-height: 24px;
margin-top: 0;
}
.empty_text {
text-align: center;
padding: 10px 0px;
font-size: 14px;
color: grey;
}
.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;
}
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
z-index: 99;
}
.footer .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
}
.join {
background-color: #0e78c5;
color: white;
}
.join_submit {
width: 90% !important;
}
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after {
border: none;
}
.pre_text {
white-space: break-spaces;
padding-left: 7px;
/*margin-top: 30px;*/
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="体检套餐选择" left-arrow
@click-left="history.go(-1)"></van-nav-bar>
</van-sticky>
<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-radio-group v-model="formData.subjectId" class="basic">
<van-cell-group>
<van-cell title="" :key="item.id" v-for="item in project.healthCheckupProjectSubjects">
<template #label>
<div style="display: flex; justify-content: space-between; margin-left: 8px">
<div>{{ item.optionName }}</div>
<div @click="viewDesc(item)" style="color: #0e78c5">查看说明</div>
</div>
</template>
<template #right-icon>
<van-radio :name="item.id"></van-radio>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</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="campusVisible = true" readonly is-link label="院区" name="campus"
placeholder="请选择体检院区" v-model="formData.campusName"
:rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择家属是否体检' }]" label="家属体检" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.isFamily">
<van-radio name="是" shape="square"></van-radio>
<van-radio name="否" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
</div>
</div>
<div class="van-doc-card" style="margin-bottom: 16px" v-if="formData.isFamily === '是'">
<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 :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 :rules="[{ required: true, message: '请选择婚否' }]" label="婚否" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.marry">
<van-radio name="未婚" shape="square">未婚</van-radio>
<van-radio name="已婚" shape="square">已婚</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="年龄" name="age" placeholder="请填写年龄" type="digit"
:rules="[{ required: true }]" v-model="item.age"></van-field>
<van-field label="身份证号" name="idCard" placeholder="请填写身份证号" type="digit"
:rules="[{ required: true }]" v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号" type="digit"
:rules="[{ required: true }]" v-model="item.mobile"></van-field>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.companionList.length == 0" class="empty_text">
<span>
如有家属,请添加家属
</span>
</div>
</div>
<div class="footer">
<van-button class="join join_submit">提交选择</van-button>
</div>
</van-form>
</div>
<!--体检院区弹出框-->
<van-popup position="bottom" round v-model="campusVisible">
<van-picker
title="院区" show-toolbar
:columns="campusList" value-key="campusName"
@confirm="(value, index) => {formData.campusName = value.campusName; formData.campus = value.id; campusVisible = false}"
@cancel="campusVisible = false">
</van-picker>
</van-popup>
<!--查看说明-->
<van-popup position="bottom" round v-model="descVisible" :style="{ height: '60%' }">
<div v-html="desc" class="pre_text"></div>
</van-popup>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
id: '',
selectId: '',
active: 0,
project: {},
formData: {
companionList: [],
isFamily: '否',
},
campusList: [],
campusVisible: false,
descVisible: false,
desc: '',
}
},
methods: {
viewDesc(o) {
if(o.description) {
this.desc = o.description
this.descVisible = true
} else {
vant.Toast('暂无详细说明')
}
},
async joinSubmit() {
if(!this.formData.subjectId) {
vant.Toast('请选择体检套餐')
return
}
const p = this.project.healthCheckupProjectSubjects.find(o => o.id === this.formData.subjectId)
const res = await $.post('/mobile/healthCheckup/validCondition', {
cndId: p.conditionStructureId,
})
if(res.code !== 0) {
vant.Dialog.alert({
title: '提示',
message: res.msg,
confirmButtonColor: '#1867b0'
})
return
}
vant.Dialog.confirm({
title: '温馨提醒',
message: '您确定要选择' + p.optionName + '吗?',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const cloneData = clone(this.formData)
if(cloneData.isFmaily === '否') {
cloneData.companionList = []
}
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
cloneData.projectId = this.id
const resp = await $.post('/mobile/healthCheckup/doSubmit', {
userSelection: 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 = '/mobile/healthCheckup/mine'
}
}, 1000)
}).catch(() => {})
},
addCompanion() {
this.formData.companionList.push({userName: '', sex: '', marry: '',})
},
delCompanion() {
this.formData.companionList.splice(this.active, 1)
},
//查询有哪些体检套餐
async findSubject() {
const resp = await $.post('/platform/healthCheckup/project/mange/findOne', {id: this.id})
this.project = resp.data
//const sex = "${@shiro.getPrincipalProperty('sex')}";
//this.project.healthCheckupProjectSubjects = this.project.healthCheckupProjectSubjects.filter(o => o.sex === sex || o.sex === '' || o.sex === null)
},
//获取院区
async getCampus() {
const resp = await $.post('/mobile/healthCheckup/getCampus')
this.campusList = resp.data
},
//获取报名信息
async getSelectInfo() {
const resp = await $.post('/mobile/healthCheckup/getSelectInfo', {id: this.selectId})
this.formData = resp.data
const o = this.campusList.find(o => o.id === this.formData.campus)
this.formData.campusName = o.campusName
},
},
async created() {
this.id = GetQueryString('projectId')
this.selectId = GetQueryString('selectId')
await this.getCampus()
if(GetQueryString('selectId')) {
await this.getSelectInfo()
}
await this.findSubject()
},
})
window.onload = () => {
window.addEventListener('pageshow', e => {
if (e.persisted) {
window.location.reload()
}
})
}
</script>
<!--#
}
#-->
@@ -0,0 +1,215 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.list-card {
position: relative;
margin: 10px;
background-color: #fff;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
width: auto;
}
.list-card > .content {
padding: 16px 10px;
display: flex;
max-height: 100px;
}
.content-right {
width: calc(100% - 150px);
max-width: calc(100% - 150px);
padding-left: 15px;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.cr-title {
/*max-height: 40px;*/
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: bold;
}
.concat, .mobile, .union {
font-size: 13px;
line-height: 18px;
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.operateDiv {
text-align: right;
padding-right: 10px;
padding-bottom: 6px;
}
.operateDiv .van-button {
height: 28px;
border-radius: 8px;
margin-left: 4px;
}
.desc_info div {
font-size: 12px;
}
.tag {
position: absolute;
display: inline-block;
background-color: #1867b0;
color: #fff;
font-size: 14px;
top: 0px;
border-radius: 6px;
right: -3px;
padding: 0px 6px;
transform: rotate(16deg);
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="体检套餐列表" left-arrow
@click-left="history.go(-1)"></van-nav-bar>
</van-sticky>
<van-sticky>
<van-tabs v-model="pageForm.tabName" @change="tabChange">
<van-tab title="进行中" name="ing"></van-tab>
<van-tab title="已结束" name="end"></van-tab>
</van-tabs>
</van-sticky>
<template v-if="vLoading && !vLoading.value">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
v-if="tableData && tableData.length>0"
v-model="loading"
@load="pageData">
<div class="list-card" v-for="o in tableData">
<div @click="toCheckUp(o)" class="content">
<van-image
height="76"
radius="8"
:src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+o.cover"
width="100">
</van-image>
<div class="content-right">
<div v-if="o.selectCount <= 0" class="tag">未选择</div>
<div v-else class="tag" style="background-color: green">已选择</div>
<div class="cr-title">
<span>{{o.name}}</span>
</div>
<div class="desc_info">
<div class="concat">
<span>开始时间:</span>
{{moment(o.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
</div>
<div class="mobile">
<span>结束时间:</span>
{{moment(o.choiceTimeEnd).format('YYYY/MM/DD HH:mm')}}
</div>
</div>
</div>
</div>
</div>
</van-list>
<van-empty v-else description="暂无数据"></van-empty>
</template>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/healthCheckup/list">套餐选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/healthCheckup/mine">我的套餐</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
tarBarActive: 0,
tabName: 'ing',
}
},
methods: {
toCheckUp(o) {
if(o.selectCount > 0) {
vant.Dialog.alert({
title: '温馨提示',
message: '此项活动您已选择',
})
return
}
//当前时间
const nowDate = moment().unix()
//结束时间
const endDate = moment(o.choiceTimeEnd).unix()
if(nowDate > endDate) {
vant.Dialog.alert({
title: '温馨提示',
message: '选择时间已过',
})
} else {
location.href = '/mobile/healthCheckup/checkUp?projectId=' + o.id
}
},
tabChange(val) {
this.tabName = val
this.startLoading()
this.tableData = []
this.pageForm.pageNumber = 1
this.pageData()
this.closeLoading()
},
async pageData() {
this.mLoading = true
const resp = await $.post('/mobile/healthCheckup/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = this.tableData.concat(resp.data.list)
if (this.tableData.length === resp.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
this.mLoading = false
},
init() {
this.startLoading()
this.pageForm.tabName = 'ing'
this.pageData()
this.closeLoading()
}
},
created() {
this.init()
},
})
window.onload = () => {
window.addEventListener('pageshow', e => {
if (e.persisted) {
window.location.reload()
}
})
}
</script>
<!--#
}
#-->
@@ -0,0 +1,214 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.list-card {
position: relative;
margin: 10px;
background-color: #fff;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
width: auto;
}
.list-card > .content {
padding: 16px 10px;
display: flex;
max-height: 100px;
}
.content-right {
width: calc(100% - 150px);
max-width: calc(100% - 150px);
padding-left: 15px;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.cr-title {
/*max-height: 40px;*/
line-height: 20px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: bold;
}
.concat, .mobile, .union {
font-size: 13px;
line-height: 18px;
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.operateDiv {
text-align: right;
padding-right: 10px;
padding-bottom: 6px;
}
.operateDiv .van-button {
height: 28px;
border-radius: 8px;
margin-left: 4px;
}
.desc_info div {
font-size: 12px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="我选择的体检套餐" left-arrow
@click-left="location.href='/mobile/index'"></van-nav-bar>
</van-sticky>
<van-sticky>
<van-tabs v-model="pageForm.tabName" @change="tabChange">
<van-tab title="进行中" name="ing"></van-tab>
<van-tab title="已结束" name="end"></van-tab>
</van-tabs>
</van-sticky>
<template v-if="vLoading && !vLoading.value">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
v-if="tableData && tableData.length>0"
v-model="loading"
@load="pageData">
<div class="list-card" v-for="o in tableData">
<div class="content">
<van-image
height="76"
radius="8"
:src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+o.cover"
width="100">
</van-image>
<div class="content-right">
<div class="cr-title">
<span>{{o.name}}</span>
</div>
<div class="desc_info">
<div class="concat">
<span>开始时间:</span>
{{moment(o.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
</div>
<div class="mobile">
<span>结束时间:</span>
{{moment(o.choiceTimeEnd).format('YYYY/MM/DD HH:mm')}}
</div>
</div>
</div>
</div>
<div class="operateDiv">
<van-button @click="edit(o)" v-if="moment().unix() < moment(o.choiceTimeEnd).unix()"
type="info" size="small" color="#1867b0">
&ensp;
</van-button>
<van-button @click="cancel(o)" v-if="moment().unix() < moment(o.choiceTimeEnd).unix()"
type="info" size="small" color="#1867b0">
&ensp;
</van-button>
</div>
</div>
</van-list>
<van-empty v-else description="暂无数据"></van-empty>
</template>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/healthCheckup/list">套餐选择</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/healthCheckup/mine">我的套餐</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
tarBarActive: 1,
}
},
methods: {
edit(o) {
location.href = '/mobile/healthCheckup/checkUp?projectId=' + o.projectId +
'&selectId=' + o.id
},
async cancel(o) {
vant.Dialog.confirm({
title: '温馨提醒',
message: '您确定要取消此选择吗?',
}).then(async () => {
const res = await $.post('/mobile/healthCheckup/cancel', {id: o.id, projectId: o.projectId})
if(res.code === 0) {
vant.Toast('取消成功')
this.getData()
}else {
vant.Toast(res.msg)
}
}).catch(() => {})
},
doSearch() {
this.loading = true
this.pageForm.pageNumber = 1
this.tableData = []
this.pageData()
},
tabChange(val) {
this.tabName = val
this.startLoading()
this.tableData = []
this.pageForm.pageNumber = 1
this.pageData()
this.closeLoading()
},
async pageData() {
this.mLoading = true
const resp = await $.post('/mobile/healthCheckup/mineData', this.pageForm)
if (resp.code === 0) {
this.tableData = this.tableData.concat(resp.data.list)
if (this.tableData.length === resp.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
this.mLoading = false
},
init() {
this.startLoading()
this.pageForm.tabName = 'ing'
this.pageData()
this.closeLoading()
}
},
created() {
this.init()
},
})
window.onload = () => {
window.addEventListener('pageshow', e => {
if (e.persisted) {
window.location.reload()
}
})
}
</script>
<!--#
}
#-->