Browse Source

预约确认选择就诊人交互

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

1
components/bookBox.vue

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

94
pages/prebook/prebook.vue

@ -8,26 +8,26 @@
<slider-box ref="sliderbox">
<view class="slider-title PfScMedium">预约信息确认</view>
<view class="members-box" v-if="needSelectMembers">
<view class="desc">当前时段余号不足只能预约2</view>
<view class="desc">当前时段余号不足只能预约{{times.left_count}}</view>
<view class="members">
<view class="memmbers-item active">
<img :src="cssUrl+'checkbox_false.svg'" alt="">
<img :src="cssUrl+'checkbox_true.svg'" alt="">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
上官子涵
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt="">
<img :src="cssUrl+'checkbox_true.svg'" alt="">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
帅哥
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt="">
<img :src="cssUrl+'checkbox_true.svg'" alt="">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
发财哥
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'" alt="">
<img :src="cssUrl+'checkbox_true.svg'" alt="">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
王富贵
</view>
</view>
@ -50,7 +50,7 @@
</view>
<view class="item">
<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 class="btns-box flex">
@ -62,8 +62,8 @@
</template>
<script>
import Book from '@/components/bookBox.vue';
import SliderBox from '@/components/sliderBox.vue';
import Book from '@/components/bookBox.vue'
import SliderBox from '@/components/sliderBox.vue'
export default {
onLoad(op) {
uni.setNavigationBarTitle({
@ -79,7 +79,8 @@
hospitalId:false,
hospital:false,
activeVisitors:[],
nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩']
nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'],
times:false
}
},
components:{
@ -116,15 +117,16 @@
uni.showToast({
title:"成功预约8人",
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=>{
if(data == -1) return
data.days = [
{
date: "2024-04-16", type: 2, type_text: "上午出诊", weekday: "周一",
date: "2024-04-17", type: 2, type_text: "上午出诊", weekday: "周一",
am: [
{
"start": "12:00",
@ -140,10 +142,10 @@
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",
"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",
"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
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() {
this.$refs.sliderbox.closeConfirm()
},
appointCheck(times){
appointCheck(times, chooseDay=''){
var param = new Object()
param.start_time = times.start
param.end_time = times.end
param.date = times.date
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=>{
if(data == -1) return
if(data == -1) {
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) {
this.appointCheck(times)
this.appointCheck(times, times.key)
},
submitConfim(){
uni.navigateTo({

Loading…
Cancel
Save