Browse Source

预约确认选择就诊人交互

master
kuaileWu 1 year ago
parent
commit
a3d0e583b1
  1. 1
      components/bookBox.vue
  2. 100
      pages/prebook/prebook.vue

1
components/bookBox.vue

@ -93,6 +93,7 @@ export default {
confirmSubmit(times){ confirmSubmit(times){
if(times.bed_count <= 0) return if(times.bed_count <= 0) return
times.date = this.RegistrationTimeList[this.selectDay].date times.date = this.RegistrationTimeList[this.selectDay].date
times.key = this.selectDay
this.$emit('confirmSubmitEvent', times) this.$emit('confirmSubmitEvent', times)
} }
} }

100
pages/prebook/prebook.vue

@ -8,26 +8,26 @@
<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">
<view class="desc">当前时段余号不足只能预约2</view> <view class="desc">当前时段余号不足只能预约{{times.left_count}}</view>
<view class="members"> <view class="members">
<view class="memmbers-item active"> <view class="memmbers-item active">
<img :src="cssUrl+'checkbox_false.svg'" alt=""> <img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'" alt=""> <img :src="cssUrl+'checkbox_true.svg'">
上官子涵 上官子涵
</view> </view>
<view class="memmbers-item"> <view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt=""> <img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'" alt=""> <img :src="cssUrl+'checkbox_true.svg'">
帅哥 帅哥
</view> </view>
<view class="memmbers-item"> <view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt=""> <img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'" alt=""> <img :src="cssUrl+'checkbox_true.svg'">
发财哥 发财哥
</view> </view>
<view class="memmbers-item"> <view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt=""> <img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'" alt=""> <img :src="cssUrl+'checkbox_true.svg'">
王富贵 王富贵
</view> </view>
</view> </view>
@ -50,9 +50,9 @@
</view> </view>
<view class="item"> <view class="item">
<view class="left">看诊时间</view> <view class="left">看诊时间</view>
<view class="right orange">2023.11.12 上午 9:30-10:30</view> <view class="right orange">{{times.date}} 上午 {{times.start_time}}-{{times.end_time}}</view>
</view> </view>
<view class="btns-box flex"> <view class="btns-box flex">
<view class="btn cancel btn1" hover-class="hover" @click="closeConfirm">我再想想</view> <view class="btn cancel btn1" hover-class="hover" @click="closeConfirm">我再想想</view>
<view class="primary btn btn1" hover-class="hover" @click="submitConfim">确认预约</view> <view class="primary btn btn1" hover-class="hover" @click="submitConfim">确认预约</view>
@ -62,8 +62,8 @@
</template> </template>
<script> <script>
import Book from '@/components/bookBox.vue'; import Book from '@/components/bookBox.vue'
import SliderBox from '@/components/sliderBox.vue'; import SliderBox from '@/components/sliderBox.vue'
export default { export default {
onLoad(op) { onLoad(op) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -79,7 +79,8 @@
hospitalId:false, hospitalId:false,
hospital:false, hospital:false,
activeVisitors:[], activeVisitors:[],
nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'] nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'],
times:false
} }
}, },
components:{ components:{
@ -116,15 +117,16 @@
uni.showToast({ uni.showToast({
title:"成功预约8人", title:"成功预约8人",
mask:true, mask:true,
image:this.cssUrl+'gou.svg' image:this.cssUrl+'gou.svg',
times:false
}) })
}, },
getAvailabletRegistrationTime() { getAvailabletRegistrationTime(refresh = true, chooseDay = '') {
this.$http.req('client/doctor/visit_hospital/days/'+this.hospitalId).then(data=>{ this.$http.req('client/doctor/visit_hospital/days/'+this.hospitalId).then(data=>{
if(data == -1) return if(data == -1) return
data.days = [ data.days = [
{ {
date: "2024-04-16", type: 2, type_text: "上午出诊", weekday: "周一", date: "2024-04-17", type: 2, type_text: "上午出诊", weekday: "周一",
am: [ am: [
{ {
"start": "12:00", "start": "12:00",
@ -136,14 +138,14 @@
"end": "14:30", "end": "14:30",
"bed_count": 2 "bed_count": 2
} }
], ],
pm: [] pm: []
}, },
{ {
date: "2024-04-17", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: [] date: "2024-04-18", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: []
}, },
{ {
date: "2024-04-18", type: 3, type_text: "全天出诊", weekday: "周三", am: [ date: "2024-04-19", type: 3, type_text: "全天出诊", weekday: "周三", am: [
{ {
"start": "12:00", "start": "12:00",
"end": "12:30", "end": "12:30",
@ -168,7 +170,7 @@
] ]
}, },
{ {
date: "2024-04-19", type: 4, type_text: "下午出诊", weekday: "周四", am: [], pm: [ date: "2024-04-20", type: 4, type_text: "下午出诊", weekday: "周四", am: [], pm: [
{ {
"start": "12:00", "start": "12:00",
"end": "12:30", "end": "12:30",
@ -182,31 +184,73 @@
] ]
}, },
{ {
date: "2024-04-20", type: 1, type_text: "全天休息", weekday: "周五", am: [], pm: [] date: "2024-04-21", type: 1, type_text: "全天休息", weekday: "周五", am: [], pm: []
}, },
] ]
// if(!refresh){
// // data.days[3].pm[1].bed_count=0
// // data.days[3].type=1
// data.days = [
// {
// date: "2024-04-17", 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-18", type: 5, type_text: "", weekday: "", am: [], pm: []
// }
// ]
// }
this.RegistrationTimeList = data.days this.RegistrationTimeList = data.days
if(this.RegistrationTimeList.length>0) this.$refs.book.dataInit(this.RegistrationTimeList[0]) if(this.RegistrationTimeList.length>0) {
if(refresh || chooseDay>=this.RegistrationTimeList.length) {
this.$refs.book.dataInit(this.RegistrationTimeList[0])
}else{
this.$refs.book.chooseDay(chooseDay, this.RegistrationTimeList[chooseDay])
}
}
}); });
}, },
closeConfirm() { closeConfirm() {
this.$refs.sliderbox.closeConfirm() this.$refs.sliderbox.closeConfirm()
}, },
appointCheck(times){ appointCheck(times, chooseDay=''){
var param = new Object() var param = new Object()
param.start_time = times.start param.start_time = times.start
param.end_time = times.end param.end_time = times.end
param.date = times.date param.date = times.date
param.visit_hospital_id = this.hospitalId param.visit_hospital_id = this.hospitalId
param.visit_user_count = this.activeVisitors.length param.visit_user_count = 1
this.times = param
this.$http.req('client/user/appoint/check', param).then(data=>{ this.$http.req('client/user/appoint/check', param).then(data=>{
if(data == -1) return if(data == -1) {
this.$refs.sliderbox.showConfirm() this.getAvailabletRegistrationTime(false, chooseDay)
return
}
if(data.left_count < this.activeVisitors.length){
this.needSelectMembers = true
this.$refs.sliderbox.showConfirm()
this.times.left_count = data.left_count
}else{
this.$refs.sliderbox.showConfirm()
}
}); });
}, },
showConfirm(times) { showConfirm(times) {
this.appointCheck(times) this.appointCheck(times, times.key)
}, },
submitConfim(){ submitConfim(){
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save