@ -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 ="bookTime List" >
< 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 ="bookTime List" >
< 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 ,
bookTime List : fals e,
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 : 40 rpx 24 rpx ;
padding : 40 rpx 24 rpx ;
. date {
. date {
width : 106 rpx ;
width : 12 0 rpx ;
flex - shrink : 0 ;
flex - shrink : 0 ;
margin - right : 34 rpx ;
margin - right : 18 rpx ;
. top {
. top {
width : 106 rpx ;
width : 106 rpx ;
height : 98 rpx ;
height : 98 rpx ;
@ -119,6 +139,7 @@ export default {
color : # 999999 ;
color : # 999999 ;
line - height : 32 rpx ;
line - height : 32 rpx ;
margin - top : 14 rpx ;
margin - top : 14 rpx ;
text - align : center ;
& . active {
& . active {
color : # 50 C382 ;
color : # 50 C382 ;
}
}
@ -203,7 +224,7 @@ export default {
justify - content : center ;
justify - content : center ;
width : 320 rpx ;
width : 320 rpx ;
height : 86 rpx ;
height : 86 rpx ;
background : # DEF3DB ;
background : # F8FFF7 ;
border - radius : 8 rpx ;
border - radius : 8 rpx ;
border : 2 rpx solid # 39 D067 ;
border : 2 rpx solid # 39 D067 ;
margin - bottom : 20 rpx ;
margin - bottom : 20 rpx ;