first commit

This commit is contained in:
2026-09-20 15:46:34 +08:00
parent 72fb5eae10
commit e558339dcc
3340 changed files with 671310 additions and 251 deletions
@@ -0,0 +1,343 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.info {
position: relative;
width: 88%;
margin: 20px auto;
font-size: 14px;
box-shadow: 0 2px 10px rgb(125 126 128 / 16%);
padding: 12px;
border-radius: 10px;
background-color: white;
}
.avatar {
width: 34%;
margin-left: 50px;
}
.other_info {
font-size: 18px;
line-height: 34px;
}
.label {
border-left: 5px #1867b0 solid;
border-radius: 4px;
padding-left: 6px;
margin: 10px 0px;
}
.van-tabs__content {
background-color: white;
}
.van-tab__pane, .van-tab__pane-wrapper {
padding: 20px;
}
.label_text {
color: grey;
line-height: 22px;
}
.van-tabs__content {
height: 100%;
overflow-y: auto;
}
.yy-wrap .van-button {
height: 32px;
border-radius: 6px;
width: 90px;
}
.time_info {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.van-empty {
width: 100%;
}
.time_info:nth-of-type(1) {
margin-top: 10px;
}
.apply_pop {
width: 100%;
height: 100%;
background-color: #f6f7f9;
font-size: 14px;
}
.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;
}
img {
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<van-nav-bar
title="心理咨询预约"
left-arrow
placeholder
fixed
@click-left="window.history.back()">
</van-nav-bar>
<div class="info">
<div style="display: flex; align-items: center;">
<!--头像-->
<div class="avatar">
<van-image width="80" height="80"
:src="APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS+'?id='+doctorData.avatar"></van-image>
</div>
<!--其他信息-->
<div class="other_info">
<div>
{{doctorData.username}}
</div>
<div>
{{doctorData.jobTitle}}
</div>
</div>
</div>
</div>
<van-tabs v-model="active" :style="'height: ' + (window.screen.height - 46 - 40 - 84 - 24 - 44) + 'px'">
<van-tab title="预约时段">
<van-list
v-model="mLoading"
:finished="finished"
:finished-text="timeData.length > 0 ? '没有更多了' : ''"
@load="getDataByDoctorId">
<div v-if="timeData.length > 0" class="time_info" v-for="item in timeData">
<div style="color: #1867b0">{{getFormatTime(item)}}</div>
<div class="yy-wrap">
<van-button @click="apply(item)" :color="item.className">{{item.title}}</van-button>
</div>
</div>
</van-list>
<van-empty
v-if="mLoading === false && timeData.length === 0"
class="custom-image"
image="/none.svg"
description="抱歉,此咨询师暂时没有进行排班哦">
</van-empty>
</van-tab>
<van-tab title="咨询师简介">
<div class="label">咨询师擅长</div>
<div class="label_text">{{doctorData.specialty ? doctorData.specialty : '暂无数据,该资料待补充'}}</div>
<div class="label" style="margin-top: 20px">咨询师简介</div>
<div class="label_text">{{doctorData.introduce ? doctorData.introduce : '暂无数据,该资料待补充'}}</div>
</van-tab>
</van-tabs>
<van-popup v-model="show" class="apply_pop" position="right">
<van-nav-bar
title="预约信息"
left-arrow
placeholder
fixed
@click-left="show = false">
</van-nav-bar>
<van-form ref="addForm" :show-error-message="false" input-align="right">
<van-cell-group inset class="mt10">
<van-field readonly
:value="chooseData.startTime"
label="开始时间"></van-field>
<van-field readonly
:value="chooseData.endTime"
label="结束时间"></van-field>
</van-cell-group>
<van-cell-group inset class="mt10" v-if="chooseData.doctorUser">
<van-field readonly
:value="chooseData.username"
label="咨询师姓名"></van-field>
<van-field readonly
:value="chooseData.mobile"
label="咨询师电话"></van-field>
</van-cell-group>
<van-cell-group inset class="mt10">
<van-field readonly
value="${@shiro.getPrincipalProperty('username')}"
label="预约人姓名"></van-field>
<van-field readonly
value="${@shiro.getPrincipalProperty('loginname')}"
label="预约人工号"></van-field>
<van-field readonly
value="${@shiro.getPrincipalProperty('unit').getName()}"
label="预约人单位"></van-field>
<van-field readonly
value="${@shiro.getPrincipalProperty('mobile')}"
label="预约人电话"></van-field>
</van-cell-group>
<van-cell-group inset class="mt10">
<van-field
v-model="appointmentUserNote"
rows="3"
autosize
label="预约备注"
type="textarea"
placeholder="您可以输入预约备注"
></van-field>
</van-cell-group>
</van-form>
<div class="footer">
<van-button @click="doSubmit()" color="#1867b0">提交预约</van-button>
</div>
</van-popup>
</div>
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return '';
}
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
show: false,
doctorId: '',
doctorData: {},
active: 0,
timeData: [],
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
chooseData: {},
appointmentUserNote: '',
}
},
methods: {
async doSubmit() {
const valid = await vant.Dialog.confirm({
title: '提示',
message: '您确认提交吗?',
confirmButtonColor: '#1867b0'
})
if (valid) {
this.$toast.loading('提交中...')
const params = {
appointmentUserNote: this.appointmentUserNote,
id: this.chooseData.id
}
const resp = await $.post('/mobile/psychologyPro/doApply', params)
if (resp.code === 0) {
this.$toast.success('申请成功')
setTimeout(() => {
location.replace('/mobile/psychologyPro/myApplyList')
}, 1000)
} else if (resp.code === 1) {
this.$toast.error(resp.msg)
} else if (resp.code === 2) {
this.$toast(resp.msg)
}
}
},
apply(o) {
if (o.title !== '可预约') {
return
}
this.chooseData = o
this.show = true
},
getFormatTime(o) {
const simpleStartDate = moment(o.startTime).format('YYYY-MM-DD')
const simpleStartHour = moment(o.startTime).format('HH:mm')
const simpleEndHour = moment(o.endTime).format('HH:mm')
const dayNameOfWeek = this.dayNames[new Date(simpleStartDate).getDay()]
return simpleStartDate + ' ' + dayNameOfWeek + ' ' + simpleStartHour + '至' + simpleEndHour
},
async pageData() {
this.pageForm.doctorId = this.doctorId
const resp = await $.post('/mobile/psychologyPro/pageData', this.pageForm)
if (resp.code === 0) {
if (this.doctorId !== '') {
this.doctorData = resp.data[0]
} else {
this.tableData = resp.data
}
}
},
async getDataByDoctorId() {
this.mLoading = true
this.pageForm.id = this.doctorId
const resp = await $.post('/mobile/psychologyPro/getDataByDoctorId', this.pageForm)
if (resp.code === 0) {
const userId = "${@shiro.getPrincipalProperty('id')}";
resp.data.list.forEach(v => {
if (new Date().getTime() > v.startTimeTs) {
v.className = 'gray'
v.title = '不可预约'
} else {
if (!v.appointmentUser) {
v.className = '#1867b0'
v.title = '可预约'
} else if (v.appointmentUser === userId) {
v.className = 'gray'
v.title = '我已预约'
} else {
v.className = 'gray'
v.title = '不可预约'
}
}
})
this.timeData = this.timeData.concat(resp.data.list)
if (this.timeData.length === resp.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.mLoading = false
},
},
async created() {
this.doctorId = getQueryVariable('doctorId')
await this.pageData()
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,109 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.info {
position: relative;
width: 88%;
margin: 20px auto;
font-size: 14px;
box-shadow: 0 2px 10px rgb(125 126 128 / 16%);
padding: 12px;
border-radius: 10px;
background-color: white;
}
.avatar {
width: 38%;
}
.other_info {
width: 74%;
line-height: 22px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.desc {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
img {
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<van-nav-bar
title="心理咨询师列表"
left-arrow
placeholder
fixed
@click-left="window.history.back()">
</van-nav-bar>
<!--咨询师列表-->
<div class="info" @click="toApply(item)" v-for="item in tableData">
<div style="display: flex;">
<!--头像-->
<div class="avatar">
<van-image width="100" height="100"
:src="APP_DOMAIN+FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.avatar"></van-image>
</div>
<!--其他信息-->
<div class="other_info">
<div>
<span style="font-size: 20px">{{item.username}}&ensp;</span>
<span style="color: grey">{{item.sex}}&ensp;</span>&emsp;
</div>
<div>
<div>
<span style="color: grey">职称:</span>{{item.jobTitle}}
</div>
<div>
<span style="color: grey">单位:</span>{{item.unitName}}
</div>
<div class="desc">
<span style="color: grey">特长:</span>{{item.specialty}}
</div>
</div>
</div>
</div>
</div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {}
},
methods: {
async pageData() {
const resp = await $.post('/mobile/psychologyPro/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data
}
},
toApply(o) {
location.href = '/mobile/psychologyPro/apply?doctorId=' + o.userid
}
},
async created() {
await this.pageData()
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,251 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.list-card {
background: #FFFFFF;
width: 92%;
margin: 0px auto 20px;
box-shadow: 0 2px 10px rgb(125 126 128 / 16%);
border-radius: 10px;
}
.van-dropdown-menu__bar {
display: -webkit-box;
}
.card-head {
line-height: 30px;
padding: 8px 16px;
position: relative;
}
.state-text {
position: absolute;
right: 16px;
}
.cancel-button {
text-align: right;
padding: 10px 16px;
}
.cancel-button .van-button {
height: 27px !important;
padding: 0 18px !important;
}
.apply_pop {
width: 100%;
height: 100%;
background-color: #f6f7f9;
font-size: 14px;
}
.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;
font-size: 15px;
}
.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;
}
</style>
<div id="app" v-cloak>
<van-nav-bar
title="我的预约记录"
left-arrow
placeholder
fixed
@click-left="window.history.back()"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu>
<van-dropdown-item v-model="pageForm.year" :options="yearList"
@change="doSearch"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.stateId" :options="stateList"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list v-model="loading"
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
:immediate-check="false"
@load="pageData">
<div v-for="o in tableData" class="list-card" @click="viewInfo(o)">
<div class="card-head">
心理咨询预约
<span class="state-text">
<van-tag size="medium" v-if="o.stateId===2300" type="success">{{o.stateName}}</van-tag>
<van-tag size="medium" v-if="o.stateId===2200" type="error">{{o.stateName}}</van-tag>
<van-tag size="medium" v-if="o.stateId===2100" type="warning">{{o.stateName}}</van-tag>
</span>
</div>
<van-cell-group inset>
<van-cell :border="false" title="预约人">{{o.appointmentUserName}}</van-cell>
<van-cell :border="false" title="开始时间">{{o.startTime}}</van-cell>
<van-cell :border="false" title="结束时间">{{o.endTime}}</van-cell>
</van-cell-group>
<div class="cancel-button">
<van-button v-if="moment().unix() < moment(o.startTime).unix()" @click.stop="doCancel(o.id)" round
size="small" color="#1867b0">取消预约
</van-button>
</div>
</div>
</van-list>
</div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据">
</van-empty>
<van-popup v-model="show" class="apply_pop" position="right">
<van-nav-bar
title="预约详细信息"
left-arrow
placeholder
fixed
@click-left="show = false"
safe-area-inset-top></van-nav-bar>
<div class="van-doc-card" style="margin: 16px">
<div></div>
<div class="van-card-header">
预约时间段
</div>
<div class="van-card-body">
<van-cell-group>
<van-cell title="开始时间">{{ viewData.startTime }}</van-cell>
<van-cell title="结束时间">{{ viewData.endTime }}</van-cell>
</van-cell-group>
</div>
</div>
<div class="van-doc-card" style="margin: 16px">
<div></div>
<div class="van-card-header">
预约人信息
</div>
<div class="van-card-body">
<van-cell-group>
<van-cell title="姓名">{{ viewData.appointmentUserName }}</van-cell>
<van-cell title="工号">{{ viewData.appointmentLoginName }}</van-cell>
<van-cell title="单位">{{ viewData.appointmentUnitName }}</van-cell>
<van-cell title="电话">{{ viewData.appointmentMobile }}</van-cell>
<van-cell title="预约备注">{{ viewData.appointmentUserNote }}</van-cell>
</van-cell-group>
</div>
</div>
<div class="van-doc-card" style="margin: 16px">
<div></div>
<div class="van-card-header">
咨询师信息
</div>
<div class="van-card-body">
<van-cell-group>
<van-cell title="姓名">{{ viewData.doctorUserName || '暂无'}}</van-cell>
<van-cell title="单位">{{ viewData.doctorUnitName || '暂无'}}</van-cell>
<van-cell title="职称">{{ viewData.doctorJobTitle || '暂无'}}</van-cell>
<van-cell title="电话">{{ viewData.doctorMobile || '暂无'}}</van-cell>
<van-cell title="个人简介">{{ viewData.doctorIntroduce || '暂无'}}</van-cell>
</van-cell-group>
</div>
</div>
</van-popup>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
stateList: [
{text: '全部预约状态', value: null},
{text: '预约中', value: 2100},
{text: '预约成功', value: 2300},
{text: '预约失败', value: 2200}
],
show: false,
viewData: {},
}
},
methods: {
async pageData() {
this.loading = true
const {data} = await $.get('/mobile/psychologyPro/MyPageData', this.pageForm)
setTimeout(() => {
this.tableData = this.tableData.concat(data.list)
if (this.tableData.length === data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
this.loading = false
this.pageForm.totalCount = data.totalCount
}, 300)
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.pageData()
},
viewInfo(o) {
this.viewData = o
this.show = true
},
async doCancel(id) {
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '您确定取消此次预约吗?',
confirmButtonColor: '#1867b0'
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/psychologyPro/doCancel', {id})
if (resp.code === 0) {
vant.Toast.success('取消成功')
this.doSearch()
}
}
}
},
created() {
this.pageForm.year = this.yearList[0].value
this.pageForm.stateId = null
this.pageData()
}
})
</script>
<!--#
}
#-->