Browse Source

预约页面交互

master
kuaileWu 1 year ago
parent
commit
9cdc197732
  1. 4
      App.vue
  2. 89
      components/bookBox.vue
  3. 10
      pages/index/index.vue
  4. 1
      pages/modify_visitor/modify_visitor.vue
  5. 101
      pages/prebook/prebook.vue
  6. 22
      pages/visitors/visitors.vue

4
App.vue

@ -92,7 +92,9 @@
.hover{ .hover{
opacity: 0.8; opacity: 0.8;
} }
.hover2{
background: #DEF3DB !important;
}
.ft18{ .ft18{
font-size:18rpx; font-size:18rpx;
line-height: 18rpx; line-height: 18rpx;

89
components/bookBox.vue

@ -1,53 +1,52 @@
<template> <template>
<view class="book-com"> <view class="book-com">
<view class="date-wraper"> <view class="date-wraper">
<view :class="'date'+((key==0)?' active':'')" v-for="(item,key) in data"> <view :class="'date'+((selectDay==key)?' active':'')" v-for="(item,key) in RegistrationTimeList" @click="chooseDay(key, item)">
<view class="top"> <view class="top">
<view>0{{key+1}}</view> <view>{{item.date.substring(8,10)}}</view>
<view class="PfScMedium">周一</view> <view class="PfScMedium">{{item.weekday}}</view>
</view> </view>
<view :class="'bot'+((key%2==0)?' active':'')+(key==0?' PfScMedium':'')"> <view :class="'bot'+((item.type!=1 && item.type!=5)?' active':'')+(key==0?' PfScMedium':'')">
全天出诊 {{item.type_text}}
</view> </view>
</view> </view>
</view> </view>
<view class="datelist"> <view class="datelist">
<view :class="'item'+(!timeList?' itemempty':' ')" v-if="bookList"> <view :class="'item'+(timeList.am.length<=0?' itemempty':' ')" v-if="bookTimeList">
<view class="title PfScMedium">上午预约</view> <view class="title PfScMedium">上午预约</view>
<view class="inner-wrapper" v-if="timeList"> <view class="inner-wrapper" v-if="timeList.am.length>0">
<view class="son PfScMedium" @click="confirmSubmit">07:30-08:30</view> <view v-for="(item,key) in timeList.am" :class="'son PfScMedium'+(item.bed_count<=0?' disable':'')" @click="confirmSubmit(item)" :hover-class="item.bed_count>0?'hover2':''">
<view class="son PfScMedium">08:30-09:30 <text>2</text></view> {{item.start}}-{{item.end}}
<view class="son PfScMedium">07:30-08:30</view> <text v-if="visitorList.length > item.bed_count || item.bed_count<=0">{{item.bed_count>0?item.bed_count:'满'}}</text>
<view :class="'son PfScMedium'+(disable?' disable':'')">08:30-09:30<text></text></view> </view>
</view> </view>
<view class="empty" v-else> <view class="empty" v-else>
<img :src="cssUrl+'empty.png'" alt=""> <img :src="cssUrl+'empty.png'" alt="">
<view class="info">该时段已约满</view> <view class="info">当前时间段不可预约</view>
</view> </view>
</view> </view>
<view :class="'item'+(!false?' itemempty':' ')" v-if="bookList"> <view :class="'item'+(timeList.pm.length<=0?' itemempty':' ')" v-if="bookTimeList">
<view class="title PfScMedium">午预约</view> <view class="title PfScMedium">午预约</view>
<view class="inner-wrapper" v-if="false"> <view class="inner-wrapper" v-if="timeList.pm.length>0">
<view class="son PfScMedium">07:30-08:30</view> <view :class="'son PfScMedium'+(item.bed_count<=0?' disable':'')" @click="confirmSubmit(item)" :hover-class="item.bed_count>0?'hover2':''" v-for="(item,key) in timeList.pm">
<view class="son PfScMedium">08:30-09:30 <text>2</text></view> {{item.start}}-{{item.end}}
<view class="son PfScMedium">07:30-08:30</view> <text v-if="visitorList.length > item.bed_count || item.bed_count<=0">{{item.bed_count?item.bed_count:''}}</text>
<view :class="'son PfScMedium'+(disable?' disable':'')">08:30-09:30<text></text></view> </view>
</view> </view>
<view class="empty" v-else> <view class="empty" v-else>
<img :src="cssUrl+'empty.png'" alt=""> <img :src="cssUrl+'empty.png'" alt="">
<view class="info">该时段已约满</view> <view class="info">当前时间段不可预约</view>
</view> </view>
</view> </view>
<view class="empty-all" v-else> <view class="empty-all" v-else>
<img :src="cssUrl+'empty.png'" alt=""> <img :src="cssUrl+'empty.png'" alt="">
<view class="info2"> <view class="info2">
<view class="PfScMedium">尚未开放预约</view> <view class="PfScMedium">{{timeList.type_text}}</view>
<view>提前48小时前来预约</view> <view>选择其他可预约日期</view>
</view> </view>
</view> </view>
</view> </view>
@ -59,20 +58,41 @@
export default { export default {
name: "bookBox", name: "bookBox",
props: { props: {
RegistrationTimeList:{
type:Array,
default:()=>[]
},
visitorList:{
type:Array,
default:()=>[]
},
}, },
data() { data() {
return { return {
data:[8,8,8,8,8,8,8,8],
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
bookList:true, bookTimeList:false,
timeList:true, timeList:true,
disable:true disable:true,
selectDay:-1
} }
}, },
methods: { methods: {
confirmSubmit(e){ dataInit(firstRegistrationTime) {
this.$emit('confirmSubmitEvent') this.selectDay = 0
this.bookTimeList = firstRegistrationTime
this.bookTimeList = false
if(firstRegistrationTime.am.length > 0 || firstRegistrationTime.pm.length > 0) this.bookTimeList = true
this.timeList = firstRegistrationTime
},
chooseDay(day, book){
this.selectDay = day
this.bookTimeList = false
if(book.am.length > 0 || book.pm.length > 0) this.bookTimeList = true
this.timeList = book
},
confirmSubmit(times){
if(times.bed_count <= 0) return
this.$emit('confirmSubmitEvent', times)
} }
} }
}; };
@ -94,9 +114,9 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 40rpx 24rpx; padding: 40rpx 24rpx;
.date{ .date{
width: 106rpx; width: 120rpx;
flex-shrink: 0; flex-shrink: 0;
margin-right: 34rpx; margin-right: 18rpx;
.top{ .top{
width: 106rpx; width: 106rpx;
height: 98rpx; height: 98rpx;
@ -119,6 +139,7 @@ export default {
color: #999999; color: #999999;
line-height: 32rpx; line-height: 32rpx;
margin-top: 14rpx; margin-top: 14rpx;
text-align: center;
&.active{ &.active{
color: #50C382; color: #50C382;
} }
@ -203,7 +224,7 @@ export default {
justify-content: center; justify-content: center;
width: 320rpx; width: 320rpx;
height: 86rpx; height: 86rpx;
background: #DEF3DB; background: #F8FFF7;
border-radius: 8rpx; border-radius: 8rpx;
border: 2rpx solid #39D067; border: 2rpx solid #39D067;
margin-bottom: 20rpx; margin-bottom: 20rpx;

10
pages/index/index.vue

@ -50,7 +50,7 @@
</view> </view>
</view> </view>
<view class="bot primary btn btn2" hover-class="hover" @click="toVisitors"> <view class="bot primary btn btn2" hover-class="hover" @click="toVisitors(item)">
预约看诊 预约看诊
</view> </view>
</view> </view>
@ -102,7 +102,7 @@
}, },
onShow() { onShow() {
this.doctor_id = getApp().globalData.doctorId this.doctor_id = getApp().globalData.doctorId
if(!this.doctor_id) return; if(!this.doctor_id) return
var title = '李静医生预约就诊' var title = '李静医生预约就诊'
if(this.code) title = '登录' if(this.code) title = '登录'
@ -144,7 +144,7 @@
}); });
}, },
login() { login() {
this.$http.req('client/user/login', {code:this.code}, 'POST').then(data=>{ this.$http.req('client/user/login/', {code:this.code}, 'POST').then(data=>{
if(data == -1) return if(data == -1) return
uni.setStorageSync('token', data.token) uni.setStorageSync('token', data.token)
var rebackPagePath = uni.getStorageSync('rebackPagePath') var rebackPagePath = uni.getStorageSync('rebackPagePath')
@ -182,7 +182,9 @@
urls: list urls: list
}); });
}, },
toVisitors(){ toVisitors(hospital){
uni.setStorageSync('hospital_id', hospital.id)
uni.setStorageSync('hospital', JSON.stringify(hospital))
uni.navigateTo({ uni.navigateTo({
url:"/pages/visitors/visitors?type=1" url:"/pages/visitors/visitors?type=1"
}) })

1
pages/modify_visitor/modify_visitor.vue

@ -42,7 +42,6 @@
add() { add() {
if(this.adding) return if(this.adding) return
this.adding = true this.adding = true
console.log(123)
var param = new Object() var param = new Object()
param.real_name = this.name param.real_name = this.name
param.id_no = this.idcardExt param.id_no = this.idcardExt

101
pages/prebook/prebook.vue

@ -2,9 +2,9 @@
<view class="page-prebook"> <view class="page-prebook">
<view class="title flex"> <view class="title flex">
<img :src="cssUrl+'ten.svg'"> <img :src="cssUrl+'ten.svg'">
广安门中医医院西单门诊部 针灸科 {{hospital.hospital_name}} {{hospital.hospital_dept_name}}
</view> </view>
<book @confirmSubmitEvent="showConfirm"/> <book ref="book" @confirmSubmitEvent="showConfirm" :RegistrationTimeList="RegistrationTimeList" :visitorList="activeVisitors"/>
<slider-box ref="sliderbox"> <slider-box ref="sliderbox">
<view class="slider-title PfScMedium">预约信息确认</view> <view class="slider-title PfScMedium">预约信息确认</view>
<view class="members-box" v-if="needSelectMembers"> <view class="members-box" v-if="needSelectMembers">
@ -69,7 +69,12 @@
data() { data() {
return { return {
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
needSelectMembers:false needSelectMembers:false,
doctorId:false,
RegistrationTimeList:[],
hospitalId:false,
hospital:false,
activeVisitors:[]
} }
}, },
components:{ components:{
@ -77,7 +82,21 @@
SliderBox SliderBox
}, },
onShow() { onShow() {
var activeVisitors = uni.getStorageSync('active_visitors')
if(!activeVisitors){
this.$pop.modelShow('请先选择要预约的就诊人', '/pages/visitors/visitors?type=1')
return
}
this.activeVisitors = JSON.parse(activeVisitors)
this.hospitalId = uni.getStorageSync('hospital_id')
this.hospital = uni.getStorageSync('hospital')
if(!this.hospitalId && this.hospital) {
this.$pop.modelShow('请先选择要预约的医院', '/pages/index/index')
return
}
this.hospital = JSON.parse(this.hospital)
this.doctorId = getApp().globalData.doctorId
this.getAvailabletRegistrationTime()
}, },
methods: { methods: {
tips(){ tips(){
@ -86,11 +105,83 @@
mask:true, mask:true,
image:this.cssUrl+'gou.svg' image:this.cssUrl+'gou.svg'
}) })
},
getAvailabletRegistrationTime() {
this.$http.req('client/doctor/visit_hospital/days/'+this.hospitalId).then(data=>{
if(data == -1) return
data.days = [
{
date: "2024-04-16", type: 2, type_text: "上午出诊", weekday: "周一",
am: [
{
"start": "12:00",
"end": "12:30",
"bed_count": 0
},
{
"start": "13:00",
"end": "14:30",
"bed_count": 2
}
],
pm: []
},
{
date: "2024-04-17", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: []
},
{
date: "2024-04-18", type: 3, type_text: "全天出诊", weekday: "周三", am: [
{
"start": "12:00",
"end": "12:30",
"bed_count": 0
},
{
"start": "13:00",
"end": "14:30",
"bed_count": 2
}
], pm: [
{
"start": "12:00",
"end": "12:30",
"bed_count": 0
},
{
"start": "13:00",
"end": "14:30",
"bed_count": 8
}
]
},
{
date: "2024-04-19", type: 4, type_text: "下午出诊", weekday: "周四", am: [], pm: [
{
"start": "12:00",
"end": "12:30",
"bed_count": 0
},
{
"start": "13:00",
"end": "14:30",
"bed_count": 1
}
]
},
{
date: "2024-04-20", type: 1, type_text: "全天休息", weekday: "周五", am: [], pm: []
},
]
this.RegistrationTimeList = data.days
if(this.RegistrationTimeList.length>0) this.$refs.book.dataInit(this.RegistrationTimeList[0])
});
}, },
closeConfirm() { closeConfirm() {
this.$refs.sliderbox.closeConfirm() this.$refs.sliderbox.closeConfirm()
}, },
showConfirm() { showConfirm(times) {
console.log(times)
this.$refs.sliderbox.showConfirm() this.$refs.sliderbox.showConfirm()
}, },
submitConfim(){ submitConfim(){

22
pages/visitors/visitors.vue

@ -82,7 +82,9 @@
popTitle:'确认删除', popTitle:'确认删除',
popShowCancel:true, popShowCancel:true,
visitUsers:false, visitUsers:false,
selectCount:0 selectCount:0,
hospitalId:false,
activeVisitors:[]
} }
}, },
components:{ components:{
@ -91,13 +93,20 @@
onLoad(option) { onLoad(option) {
if(option.type) this.type = option.type if(option.type) this.type = option.type
this.getVisitors() this.getVisitors()
this.hospitalId = uni.getStorageSync('hospital_id')
if(!this.hospitalId) {
this.$pop.modelShow('请先选择要预约的医院', '/pages/index/index')
return
}
},
onShow() {
}, },
methods: { methods: {
chooseVisitor(info, key){ chooseVisitor(info, key){
this.selectCount = 0 this.selectCount = 0
this.visitUsers[key].select = !this.visitUsers[key].select this.visitUsers[key].select = !this.visitUsers[key].select
this.$set(this.visitUsers, key, this.visitUsers[key]) this.$set(this.visitUsers, key, this.visitUsers[key])
for (let i = 0; i < this.visitUsers.length; i++) { for (var i = 0; i < this.visitUsers.length; i++) {
if(this.visitUsers[i].select) ++this.selectCount if(this.visitUsers[i].select) ++this.selectCount
} }
}, },
@ -130,6 +139,13 @@
this.$pop.modelShow('请选择就诊人') this.$pop.modelShow('请选择就诊人')
return return
} }
this.activeVisitors = []
for (var i = 0; i < this.visitUsers.length; i++) {
if(this.visitUsers[i].select) this.activeVisitors.push(this.visitUsers[i])
}
uni.setStorageSync('active_visitors', JSON.stringify(this.activeVisitors))
uni.navigateTo({ uni.navigateTo({
url:"/pages/prebook/prebook" url:"/pages/prebook/prebook"
}) })
@ -145,7 +161,7 @@
width: 714rpx; width: 714rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(0,0,0,0.03); box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(0,0,0,0.03);
border-radius: 8rpx; border-radius: 12rpx;
margin: 20rpx auto 0; margin: 20rpx auto 0;
} }
.header{ .header{

Loading…
Cancel
Save