Browse Source

接口调试及页面显示、样式调整

master
zq 1 year ago
parent
commit
1e7763a240
  1. 1
      App.vue
  2. 76
      components/bookBox.vue
  3. 24
      components/preBookList.vue
  4. 8
      main.js
  5. 4
      pages.json
  6. 60
      pages/book_detail/book_detail.vue
  7. 146
      pages/index/index.vue
  8. 72
      pages/modify_visitor/modify_visitor.vue
  9. 216
      pages/prebook/prebook.vue
  10. 218
      pages/prebook_list/prebook_list.vue
  11. 36
      pages/user_modify/user_modify.vue
  12. 6
      pages/usercenter/usercenter.vue
  13. 127
      pages/visitors/visitors.vue

1
App.vue

@ -5,6 +5,7 @@
doctoridStorageKey:'doctor_id' doctoridStorageKey:'doctor_id'
}, },
onLaunch: function(option) { onLaunch: function(option) {
console.log(option,'option====');
if(!(option.query && option.query.did)){ if(!(option.query && option.query.did)){
var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey) var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey)
if(doctor_id){ if(doctor_id){

76
components/bookBox.vue

@ -1,14 +1,17 @@
<template> <template>
<view class="book-com"> <view class="book-com">
<view class="date-wraper"> <view class="date-wraper">
<view :class="'date'+((selectDay==key)?' active':'')" v-for="(item,key) in RegistrationTimeList" @click="chooseDay(key, item)"> <view :class="'date'+((selectDay===item.date)?' active':'')" v-for="(item,key) in Object.values(RegistrationTimeList)" @click="chooseDay(item.date)">
<view class="top"> <view class="top">
<view>{{item.date.date.substring(8,10)}}</view> <view>{{item.month}}.{{ item.day }}</view>
<view class="PfScMedium">{{item.date.weekday}}</view> <view class="PfScMedium">{{item.week_desc}}</view>
</view> </view>
<view :class="'bot'+((item.date.type!=1 && item.date.type!=5)?' active':'')+(key==0?' PfScMedium':'')"> <view :class="'bot'+((item.work_desc !== '不出诊')?' active':'')+(key==0?' PfScMedium':'')">
{{item.date.type_text}} {{item.work_desc}}
</view> </view>
<!-- <view :class="'bot'+((item.date.type!=1 && item.date.type!=5)?' active':'')+(key==0?' PfScMedium':'')">
{{item.work_desc}}
</view> -->
</view> </view>
</view> </view>
@ -16,9 +19,9 @@
<view :class="'item'+(timeList.am.length<=0?' itemempty':' ')" v-if="bookTimeList"> <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.am.length>0"> <view class="inner-wrapper" v-if="timeList.am.length>0">
<view v-for="(item,key) in timeList.am" :class="'son PfScMedium'+(item.bed_count<=0?' disable':'')" @click="confirmSubmit(item, 1)" :hover-class="item.bed_count>0?'hover2':''"> <view v-for="(item,key) in timeList.am" :class="'son PfScMedium'+( time2remain[item] <=0?' disable':'')" @click="confirmSubmit(item, 1)" :hover-class="time2remain[item]>0?'hover2':''">
{{item.start}}-{{item.end}} {{item}}
<text v-if="visitorList.length > item.bed_count || item.bed_count<=0">{{item.bed_count>0?item.bed_count:'满'}}</text> <text v-if="visitorList.length > time2remain[item] || time2remain[item]<=0">{{time2remain[item]>0?time2remain[item]:'满'}}</text>
</view> </view>
</view> </view>
@ -31,9 +34,9 @@
<view :class="'item'+(timeList.pm.length<=0?' itemempty':' ')" v-if="bookTimeList"> <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="timeList.pm.length>0"> <view class="inner-wrapper" v-if="timeList.pm.length>0">
<view :class="'son PfScMedium'+(item.bed_count<=0?' disable':'')" @click="confirmSubmit(item, 2)" :hover-class="item.bed_count>0?'hover2':''" v-for="(item,key) in timeList.pm"> <view :class="'son PfScMedium'+(time2remain[item]<=0?' disable':'')" @click="confirmSubmit(item, 2)" :hover-class="time2remain[item]>0?'hover2':''" v-for="(item,key) in timeList.pm">
{{item.start}}-{{item.end}} {{item}}
<text v-if="visitorList.length > item.bed_count || item.bed_count<=0">{{item.bed_count?item.bed_count:''}}</text> <text v-if="visitorList.length > time2remain[item] || time2remain[item]<=0">{{time2remain[item]?time2remain[item]:''}}</text>
</view> </view>
</view> </view>
<view class="empty" v-else> <view class="empty" v-else>
@ -58,10 +61,11 @@
export default { export default {
name: "bookBox", name: "bookBox",
props: { props: {
RegistrationTimeList:{ // RegistrationTimeList:Object,
type:Array, // RegistrationTimeList:{
default:()=>[] // type:Object,
}, // default:()=>{}
// },
visitorList:{ visitorList:{
type:Array, type:Array,
default:()=>[] default:()=>[]
@ -70,32 +74,46 @@ export default {
data() { data() {
return { return {
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
workDate:[],
time2remain:[],
bookTimeList:false, bookTimeList:false,
timeList:true, timeList:true,
disable:true, disable:true,
selectDay:-1 selectDay:-1,
RegistrationTimeList:[]
} }
}, },
methods: { methods: {
dataInit(firstRegistrationTime) { dataInit(allDate,chooseDate) {//
this.selectDay = 0 // dataInit(firstRegistrationTime,time2remain,chooseDate) {//
this.bookTimeList = firstRegistrationTime let firstRegistrationTime = allDate['date2time']
this.RegistrationTimeList = allDate['date2work']
this.time2remain = allDate['time2remain'];
if(chooseDate){
this.selectDay = chooseDate;
}else{
this.selectDay = Object.keys(this.RegistrationTimeList)[0];
this.chooseDay(this.selectDay)
return
}
this.bookTimeList = false this.bookTimeList = false
if(firstRegistrationTime.am.length > 0 || firstRegistrationTime.pm.length > 0) this.bookTimeList = true if(firstRegistrationTime.am.length > 0 || firstRegistrationTime.pm.length > 0) this.bookTimeList = true
this.timeList = firstRegistrationTime this.timeList = firstRegistrationTime
}, },
chooseDay(day, book){ chooseDay(date){
this.selectDay = day this.selectDay = date
this.bookTimeList = false this.bookTimeList = false
if(book.am.length > 0 || book.pm.length > 0) this.bookTimeList = true this.$emit('getAvailabletRegistrationTime', date)
this.timeList = book // if(book.am.length > 0 || book.pm.length > 0) this.bookTimeList = true
// this.timeList = book
}, },
confirmSubmit(times, type){ confirmSubmit(time_interval, type){
if(times.bed_count <= 0) return let param = new Object()
times.date = this.RegistrationTimeList[this.selectDay].date if(this.time2remain[time_interval] <= 0) return
times.key = this.selectDay param.date = this.selectDay
times.type = type param.time_interval = time_interval
this.$emit('confirmSubmitEvent', times) param.type = type
this.$emit('confirmSubmitEvent', param)
} }
} }
}; };

24
components/preBookList.vue

@ -3,20 +3,21 @@
<view class="list btPadding" v-if="dataList.length>0"> <view class="list btPadding" v-if="dataList.length>0">
<view :class="'item '+item" v-for="(item, key) in dataList" @click="toBookDetail(item)"> <view :class="'item '+item" v-for="(item, key) in dataList" @click="toBookDetail(item)">
<view class="left"> <view class="left">
<view class="title PfScMedium"><text v-if="item.visitor_name">{{item.visitor_name}}</text><text v-else></text></view> <view class="title PfScMedium"><text v-if="item.name">{{item.name}}</text><text v-else></text></view>
<view class="date">{{item.visit_date}} {{getDayOfWeek(item.visit_date)}} {{item.visit_time}}</view> <view class="date">{{item.date}} {{item.week_desc}} {{item.time_interval}}</view>
<view class="loction">{{item.h_name}} {{item.depart_name}}</view> <view class="loction over1">
{{item.hospital_name}}
<!-- {{item.depart_name}} 科目类型-->
</view> </view>
<view class="right">
<view :class="statusList[item.status]+' status'"><view class="over">{{statusDescList[item.status]}}</view></view>
<view class="queue-num" v-if="statusList[item.status]=='status_wait' && item.wait_visit_count && item.wait_visit_count>0"><view>前方<text class="PfScSemibold">{{item.wait_visit_count}}</text></view> </view>
</view> </view>
<view class="right">
<view :class="statusStyleList[item.status_desc]+' status'"><view class="over">{{item.status_desc}}</view></view>
<view class="queue-num" v-if="item.status_desc=='候诊' && item.wait_visit_count && item.wait_visit_count>0"><view>前方<text class="PfScSemibold">{{item.wait_visit_count}}</text></view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "preBookList", name: "preBookList",
@ -31,13 +32,14 @@ export default {
data() { data() {
return { return {
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
statusList:['status_wait', 'status_ing', 'status_down', 'status_out_num', 'status_expire', 'status_expire'], // statusList:['status_wait', 'status_ing', 'status_down', 'status_out_num', 'status_expire', 'status_expire'],
statusDescList:['候诊', '就诊中', '已完成', '过号', '已过期', '已取消'] // statusDescList:['', '', '', '', '', ''],
statusStyleList:{'待就诊':'status_wait', '就诊中':'status_ing', '就诊完成':'status_down', '过号':'status_out_num', '过期':'status_expire','取消':'status_cancle'}
} }
}, },
methods: { methods: {
toBookDetail(item){ toBookDetail(item){
this.$func.toPage('/pages/book_detail/book_detail?id='+item.id) this.$func.toPage('/pages/book_detail/book_detail?id='+item.id+'&depart_id='+item.depart_id)
}, },
getDayOfWeek(dateString) { getDayOfWeek(dateString) {
var str = new Date(dateString); var str = new Date(dateString);
@ -142,7 +144,7 @@ export default {
color: #B6B8BF; color: #B6B8BF;
} }
} }
&.status_expire{ &.status_expire,&.status_cancle{
view{ view{
background: #FCFCFC; background: #FCFCFC;
border: 1rpx solid #AEB0B8; border: 1rpx solid #AEB0B8;

8
main.js

@ -357,7 +357,13 @@ function modelShow(content, path="",title="提示") {
} }
}); });
} }
//设置页main标题
function setTitlefFunc(title) {
uni.setNavigationBarTitle({
title: title || ''
});
};
Vue.prototype.$setTitle = {setTitlefFunc}
Vue.prototype.$pop = {modelShow} Vue.prototype.$pop = {modelShow}
Vue.prototype.$func = {toPage} Vue.prototype.$func = {toPage}
Vue.prototype.$http = {req} Vue.prototype.$http = {req}

4
pages.json

@ -3,9 +3,9 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "预约就诊"
} }
}, },
{ {
"path" : "pages/prebook_list/prebook_list", "path" : "pages/prebook_list/prebook_list",
"style" : "style" :
@ -14,6 +14,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/book_detail/book_detail", "path" : "pages/book_detail/book_detail",
"style" : "style" :
@ -29,7 +30,6 @@
"navigationBarTitleText": "修改资料", "navigationBarTitleText": "修改资料",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "pages/usercenter/usercenter", "path" : "pages/usercenter/usercenter",

60
pages/book_detail/book_detail.vue

@ -28,8 +28,9 @@
export default { export default {
data() { data() {
return { return {
statusList:['status_wait', 'status_ing', 'status_out_num', 'status_expire', 'status_down', 'status_expire'], statusList:['status_wait', 'status_ing', 'status_down', 'status_out_num', 'status_expire', 'status_cancle'],
statusDescList:['候诊', '就诊中', '过号', '已过期', '已完成', '已取消'], statusStyleList:{'0':'status_wait', '1':'status_ing', '2':'status_down', '3':'status_out_num', '4':'status_expire','5':'status_cancle'},
statusDescList:['候诊', '就诊中', '已完成','过号', '已过期', '已取消'],
status:'', status:'',
queueNum:88, queueNum:88,
bookDate:"2024.01.09 周二 09:30-12:00", bookDate:"2024.01.09 周二 09:30-12:00",
@ -46,6 +47,7 @@
showCancelBook:false, showCancelBook:false,
redirect:'/pages/prebook_list/prebook_list', redirect:'/pages/prebook_list/prebook_list',
bookId:false, bookId:false,
depart_id:false,
bookInfo:false, bookInfo:false,
showReBook:false, showReBook:false,
cssUrl:this.cssUrl cssUrl:this.cssUrl
@ -54,10 +56,11 @@
onLoad(option) { onLoad(option) {
// if(option.index) this.redirect = '/pages/index/index' // if(option.index) this.redirect = '/pages/index/index'
if(option.id) this.bookId = option.id if(option.id) this.bookId = option.id
if(option.depart_id) this.depart_id = option.depart_id
}, },
onShow() { onShow() {
if(!this.bookId){ if(!this.bookId || !this.depart_id){
this.$func.toPage('/pages/index/index') this.$func.toPage('/pages/index/index')
return; return;
} }
@ -74,7 +77,11 @@
content:'确认取消预约?', content:'确认取消预约?',
success(res) { success(res) {
if(!res.confirm) return if(!res.confirm) return
that.$http.req('cancel_appoint', {appoint_id:that.bookId}, 'GET').then(data=>{ that.$http.req('user/cancel_appoint', {
appoint_id:that.bookId,
depart_id:that.depart_id
},
'POST').then(data=>{
if(data == -1) return if(data == -1) return
that.getBookDetail() that.getBookDetail()
uni.showToast({ uni.showToast({
@ -97,31 +104,32 @@
this.$func.toPage('/pages/index/index') this.$func.toPage('/pages/index/index')
}, },
getBookDetail(){ getBookDetail(){
this.$http.req('get_appoint_detail', {appoint_id:this.bookId}, 'GET').then(data=>{ this.$http.req('user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
if(data == -1) { if(data == -1) {
this.bookInfo = false this.bookInfo = false
return return
} }
var bookInfo = data var bookInfo = data
if(bookInfo && bookInfo.length <= 0){ // if(bookInfo && bookInfo.length <= 0){
this.$pop.modelShow('预约信息为空') // this.$pop.modelShow('')
return // return
} // }
bookInfo = data bookInfo = data
this.bookInfo = bookInfo this.bookInfo = bookInfo
this.status = this.statusList[bookInfo.status] this.status = this.statusStyleList[bookInfo.status]
if(bookInfo.status==0 || bookInfo.status==2) this.showCancelBook = true if(bookInfo.status==0 || bookInfo.status==2) this.showCancelBook = true
this.list[0].custom = "<view class='"+this.status+" status'><view class='over status_text'>"+this.statusDescList[bookInfo.status]+"</view></view>" this.list[0].custom = "<view class='"+this.status+" status'><view class='over status_text'>"+bookInfo.status_desc+"</view></view>"
this.list[1].rightTitle = bookInfo.visitor_name this.list[1].rightTitle = bookInfo.name
this.list[2].rightTitle = bookInfo.hospital_name this.list[2].rightTitle = bookInfo.hospital_name
this.list[3].rightTitle = bookInfo.depart_name this.list[3].rightTitle = bookInfo.depart_name
this.list[4].rightTitle = bookInfo.doctor_name ? bookInfo.doctor_name : '无' this.list[4].rightTitle = bookInfo.doctor_name ? bookInfo.doctor_name : '无'
this.list[5].custom = "<view class='queue-text'>前方<text class='queue-num-txt PfScSemibold'>"+bookInfo.wait_visit_count+"</text>人</view>" // this.list[5].custom = "<view class='queue-text'><text class='queue-num-txt PfScSemibold'>"+bookInfo.wait_visit_count+"</text></view>"
if(bookInfo.wait_visit_count<=0 || bookInfo.status!=0) this.list[5].show = false // if(bookInfo.wait_visit_count<=0 || bookInfo.status!=0) this.list[5].show = false
this.list[6].custom = "<view class='book-date"+(bookInfo.status==0?' wait':' expire')+"'>"+bookInfo.visit_date+' '+bookInfo.week+' '+bookInfo.visit_time+"</view>" this.list[5].show = false
this.notice = bookInfo.notice this.list[6].custom = "<view class='book-date"+(bookInfo.status==0?' wait':' expire')+"'>"+bookInfo.visit_date+' '+bookInfo.week_desc+' '+bookInfo.visit_time+"</view>"
this.notice = bookInfo.notice;
}); });
} }
} }
@ -164,36 +172,36 @@
} }
&.status_wait{ &.status_wait{
.status_text{ .status_text{
background: #F8FFF7; background: #EEFFF6;
border: 1rpx solid #5BD07A; // border: 1rpx solid #5BD07A;
color: #58CA7F; color: #4FC381;
} }
} }
&.status_out_num{ &.status_out_num{
.status_text{ .status_text{
background: #FFFAF7; background: #FFF2EE;
border: 1rpx solid #FE6710; // border: 1rpx solid #FE6710;
color: #FE6710; color: #FE6710;
} }
} }
&.status_down{ &.status_down{
.status_text{ .status_text{
background: #FCFCFC; background: #FCFCFC;
border: 1rpx solid #AEB0B8; // border: 1rpx solid #AEB0B8;
color: #B6B8BF; color: #B6B8BF;
} }
} }
&.status_expire{ &.status_expire,&.status_cancle{
.status_text{ .status_text{
background: #FCFCFC; background: #FCFCFC;
border: 1rpx solid #AEB0B8; // border: 1rpx solid #AEB0B8;
color: #B6B8BF; color: #B6B8BF;
} }
} }
&.status_ing{ &.status_ing{
.status_text{ .status_text{
border: 1rpx solid #5FA1CB; // border: 1rpx solid #5FA1CB;
background: #F7FCFF; background: #EEF8FF;
color: #5FA1CB; color: #5FA1CB;
} }
} }

146
pages/index/index.vue

@ -3,19 +3,18 @@
<view class="header-wrapper flex"> <view class="header-wrapper flex">
<view class="left"> <view class="left">
<view class="flex top PfScMedium"> <view class="flex top PfScMedium">
<view class="ft50 over2">{{doctorInfo.doctor_info.name}}</view> <view class="ft50 over2">{{doctorInfo.doctor_info.doctor_name}}</view>
<view v-if="doctor_dept"> <view v-if="doctor_dept">
<view class="over2">{{doctor_dept}}</view> <view class="over2">{{doctor_dept}}</view>
</view> </view>
</view> </view>
<view class="bt over2" v-if="doctorInfo.doctor_info.desc"> <view class="bt over2" v-if="doctorInfo.doctor_info.doctor_desc">
{{doctorInfo.doctor_info.desc}} {{doctorInfo.doctor_info.doctor_desc}}
</view> </view>
</view> </view>
<img class="right" :src="doctorInfo.doctor_info.avator" alt="" @click="enlargePicture(doctorInfo.doctor_info.avator)" v-if="doctorInfo.doctor_info.avator"> <img class="right" :src="doctorInfo.doctor_info.avator" alt="" @click="enlargePicture(doctorInfo.doctor_info.avator)" v-if="doctorInfo.doctor_info.avator">
</view> </view>
<view class="block desc-wrapper" v-if="doctorInfo.doctor_info.doctor_detail">
<view class="block desc-wrapper" v-if="doctorInfo.doctor_info.detail">
<view class="title-wrapper flex"> <view class="title-wrapper flex">
<view class="title"> <view class="title">
医生简介 医生简介
@ -23,8 +22,10 @@
<img :src="cssUrl+'right_bg.png'" alt=""> <img :src="cssUrl+'right_bg.png'" alt="">
</view> </view>
<view class="con over2 over4"> <view class="con">
{{doctorInfo.doctor_info.detail}} <!-- <view class="con over2 over4"> -->
{{doctorInfo.doctor_info.doctor_detail}}
北京中医药大学硕士研究生中国针灸学会会员中国中医药信息学会专科专病诊疗分会理事学会专科专病诊疗分会理事擅长针药并用治疗内科疾病
</view> </view>
</view> </view>
@ -33,15 +34,18 @@
<view class="top flex"> <view class="top flex">
<view class="left"> <view class="left">
<view class="title flex"> <view class="title flex">
<text class="over2">{{item.h_name}} {{item.depart_name}}</text> <text class="over2 PfScMedium">{{item.hospital_name}}
<img :src="cssUrl+'index_comback.svg'" v-if="item.h_pos" @click="toLocation(item)"> <!-- {{item.depart_name}} -->
<!-- 科室 -->
</text>
<img :src="cssUrl+'index_comback.svg'" v-if="item.hospital_pos" @click="toLocation(item)">
</view> </view>
<view class="date over2" v-if="item.visit_times"> <view class="date over2 over4">
出诊{{item.visit_times}} 出诊{{ item.visit_time }}
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="flex right-wrapper" style="justify-content:flex-end;" v-if="item.h_pos"> <view class="flex right-wrapper" style="justify-content:flex-end;" v-if="item.hospital_pos">
<view class="" @click="toLocation(item)"> <view class="" @click="toLocation(item)">
<img :src="cssUrl+'index_nav.svg'" alt=""> <img :src="cssUrl+'index_nav.svg'" alt="">
<view>导航</view> <view>导航</view>
@ -93,6 +97,47 @@
recentAppoint:[], recentAppoint:[],
loginToken:false, loginToken:false,
state:'', state:'',
workdate:[],
workPlan:{
1:'上午',
2:'下午',
3:'全天',
},
visitlist:[
{
"id": "16",
"depart_id": "18",
"name": "暴富喽",
"date": "2024-09-28",
"week_desc": "六",
"time_interval": "08:00-08:30",
"status_desc": "就诊完成",
"hospital_name": "北京LY暴富",
"depart_name": "针灸科"
},
{
"id": "15",
"depart_id": "18",
"name": "刘老铁",
"date": "2024-09-28",
"week_desc": "六",
"time_interval": "08:30-09:00",
"status_desc": "候诊",
"hospital_name": "北京LY暴富",
"depart_name": "针灸科"
},
{
"id": "14",
"depart_id": "18",
"name": "首富哈",
"date": "2024-09-28",
"week_desc": "六",
"time_interval": "08:00-08:30",
"status_desc": "过号",
"hospital_name": "北京LY暴富",
"depart_name": "针灸科"
},
]
} }
}, },
components:{ components:{
@ -120,7 +165,6 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:title title:title
}) })
var token = uni.getStorageSync('token') var token = uni.getStorageSync('token')
if(this.code && this.state && !token) { if(this.code && this.state && !token) {
var rebackPagePath = uni.getStorageSync('rebackPagePath') var rebackPagePath = uni.getStorageSync('rebackPagePath')
@ -129,21 +173,29 @@
} }
await this.getDoctorInfo() await this.getDoctorInfo()
}, },
// onReady() {
// // console.log(this.doctorInfo,'this.doctorInfo');
// uni.setNavigationBarTitle({
// title: + ''
// })
// },
// "navigationBarTitleText": ""
methods: { methods: {
toLocation(hospital){ toLocation(hospital){
var that = this var that = this
uni.showActionSheet({ uni.showActionSheet({
itemList: ['腾讯地图', '百度地图', '高德地图'], itemList: ['腾讯地图', '百度地图', '高德地图'],
success: function (res) { success: function (res) {
var lngLat = hospital.h_pos.toString().split(',') var lngLat = hospital.hospital_pos.toString().split(',')
var lng = lngLat[0].toString() var lng = lngLat[0].toString()
, lat = lngLat[1].toString() , lat = lngLat[1].toString()
var baiduLngLat = that.qqMapTransBMap(lng, lat) var baiduLngLat = that.qqMapTransBMap(lng, lat)
var mapList = [ var mapList = [
'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.h_name, 'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.hospital_name,
'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.h_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo', 'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.hospital_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo',
'https://m.amap.com/share/index/lnglat='+hospital.h_pos+'&name='+hospital.h_name+'&src=uriapi&innersrc=uriapi', 'https://m.amap.com/share/index/lnglat='+hospital.hospital_pos+'&name='+hospital.hospital_name+'&src=uriapi&innersrc=uriapi',
] ]
// return; // return;
location.href = mapList[res.tapIndex] location.href = mapList[res.tapIndex]
@ -172,21 +224,47 @@
}, },
async getDoctorInfo() { async getDoctorInfo() {
await this.$http.req('user/get_user_info', {}, 'GET').then(data=>{ await this.$http.req('user/index_info', {}, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.pageShow = true this.pageShow = true;
this.doctorInfo = data let visitFlag = true;
if(this.doctorInfo.doctor_info && this.doctorInfo.doctor_info.depart_name.length>0){ this.doctorInfo = data;
this.doctor_dept = this.doctorInfo.doctor_info.depart_name if(this.doctorInfo.doctor_info && this.doctorInfo.doctor_info.depart_name && this.doctorInfo.doctor_info.depart_name.length>0){
} this.doctor_dept = this.doctorInfo.doctor_info.depart_name;
}
if(this.doctorInfo.hospital_list && this.doctorInfo.hospital_list.length>0){ if(this.doctorInfo.hospital_departs && this.doctorInfo.hospital_departs.length>0){
this.hospitals = this.doctorInfo.hospital_list this.hospitals = this.doctorInfo.hospital_departs;
} this.doctor_dept = this.doctorInfo.hospital_departs[0]['depart_name'];
var docname = this.doctorInfo.doctor_info.name this.doctorInfo.doctor_info.depart_name = this.doctor_dept;
if(this.doctorInfo.appoint_list && this.doctorInfo.appoint_list.length>0){ }else{
this.recentAppoint = this.doctorInfo.appoint_list visitFlag = false;
} }
if(this.doctorInfo.visit_list && this.doctorInfo.visit_list.length>0){
this.recentAppoint = this.doctorInfo.visit_list;
}
if(this.doctorInfo.workdate && Object.keys(this.doctorInfo.workdate).length > 0){
this.workdate = this.doctorInfo.workdate;
}else{
visitFlag = false;
}
// if(visitFlag){//
let workDatKeyArr = Object.keys(this.workdate);
let workDateValArr = Object.values(this.workdate);
let timeList = [];
this.hospital_departs = this.doctorInfo.hospital_departs.map((item,index)=>{
let indexofNum = workDatKeyArr.indexOf(item.depart_id);
if(indexofNum > -1){
let departCurItem = workDateValArr[indexofNum];
for(let key in departCurItem){
let dateItem = departCurItem[key];
if(Number(dateItem.plan) === 0)continue
timeList.push(dateItem.week_desc+this.workPlan[dateItem.plan])
item.visit_time = timeList.join('、')
}
}
return item
})
// }
}); });
}, },
enlargePicture(imgUrl) { enlargePicture(imgUrl) {
@ -295,7 +373,9 @@
font-size: 30rpx; font-size: 30rpx;
line-height: 50rpx; line-height: 50rpx;
.con{ .con{
height: auto; // height: auto;
overflow-y: auto;
max-height: 200rpx;
} }
} }
.title-wrapper{ .title-wrapper{
@ -384,7 +464,7 @@
img{ img{
width: 20rpx; width: 20rpx;
height: 32rpx; height: 32rpx;
margin-top: 8rpx; // margin-top: 8rpx;
margin-left: 8rpx; margin-left: 8rpx;
} }
} }

72
pages/modify_visitor/modify_visitor.vue

@ -3,15 +3,21 @@
<view class="block"> <view class="block">
<view class="title PfScMedium">就诊人信息</view> <view class="title PfScMedium">就诊人信息</view>
<input-box class="inputcom-wrapper" v-model="name" holder="就诊人姓名" label="姓名" @blurEvent="nameBlurEvent"></input-box> <input-box class="inputcom-wrapper" v-model="name" holder="就诊人姓名" label="姓名" @blurEvent="nameBlurEvent"></input-box>
<input-box class="inputcom-wrapper" v-model="idcardExt" holder="请输入身份证后4位" label="身份证尾号" @blurEvent="idCardBlurEvent" rule="idcardext"></input-box> <input-box class="inputcom-wrapper" v-model="idcard" holder="请输入身份证后4位" label="身份证尾号" @blurEvent="idCardBlurEvent" rule="idcardext"></input-box>
<input-box class="inputcom-wrapper" v-model="phone" holder="请输入就诊人手机号" label="常用手机号" @blurEvent="phoneBlurEvent" rule="phone"></input-box> <input-box class="inputcom-wrapper" v-model="phone" holder="请输入就诊人手机号" label="常用手机号" @blurEvent="phoneBlurEvent" rule="phone"></input-box>
</view> </view>
<view class="submit-wrapper btPadding"> <view class="submit-wrapper btPadding" v-if="!vid">
<view :class="'btn btn3 submit'+(canSubmit?' primary':' noclick')" :hover-class="(canSubmit?'hover':'')" @click="submit"> <view :class="'btn btn3 submit'+(canSubmit?' primary':' noclick')" :hover-class="(canSubmit?'hover':'')" @click="submit">
确认就诊人 确认就诊人
</view> </view>
</view> </view>
<view class="fixedBot btPadding" v-if="vid">
<view class="submit">
<view class="btn cancel btn1" @click="reback">取消</view>
<view class="btn primary btn1" hover-class="hover" @click="submit">确认</view>
</view>
</view>
</view> </view>
</template> </template>
@ -24,13 +30,14 @@
canSubmit:false, canSubmit:false,
name:'', name:'',
nameRule:false, nameRule:false,
idcardExt:'', idcard:'',
idcardExtRule:false, idcardExtRule:false,
phone:'', phone:'',
phoneRule:false, phoneRule:false,
type:1, type:1,
adding:false, adding:false,
vid:false vid:false,
visitor_info:{}
} }
}, },
components:{ components:{
@ -49,41 +56,46 @@
this.adding = true this.adding = true
var param = new Object() var param = new Object()
param.name = this.name param.name = this.name
param.idcard_ext = this.idcardExt param.idcard = this.idcard
param.phone = this.phone param.phone = this.phone
var that = this var that = this
var addtimer = setTimeout(function() { var addtimer = setTimeout(function() {
that.adding = false that.adding = false
}, 5000); }, 5000);
var req = 'setting_visitor/' var req = 'user/add_visitor'
var method = 'POST' var method = 'POST'
if(this.vid){ if(this.vid){
param.id = this.vid param.id = this.vid
req = 'user/update_visitor'
} }
this.$http.req(req, param, method, true).then(data=>{ this.$http.req(req, param, method, true).then(data=>{
clearTimeout(addtimer) clearTimeout(addtimer)
this.adding = false this.adding = false
if(data == -1) return if(this.vid){
uni.removeStorageSync('visitor_info_'+ this.vid)
}
this.$func.toPage('/pages/visitors/visitors?type='+this.type) this.$func.toPage('/pages/visitors/visitors?type='+this.type)
}); });
}, },
getVisitorInfo() { getVisitorInfo() {
this.$http.req('get_visitor_info', {id:this.vid}, 'GET', true).then(data=>{ this.visitor_info = JSON.parse(uni.getStorageSync('visitor_info_'+ this.vid))
if(data == -1) { //
this.$func.toPage('/pages/index/index') // this.$http.req('user/get_visitor_info', {id:this.vid}, 'GET', true).then(data=>{
return // if(data == -1) {
} // this.$func.toPage('/pages/index/index')
// return
this.name = data.name // }
this.idcardExt = data.idcard_ext console.log(this.visitor_info,'visitor_info');
this.phone = data.phone this.name = this.visitor_info.name
this.idcard = this.visitor_info.idcard
this.phone = this.visitor_info.phone
this.nameRule = true this.nameRule = true
this.idcardExtRule = true this.idcardExtRule = true
this.phoneRule = true this.phoneRule = true
this.checkSubmit() this.checkSubmit()
}); // });
}, },
nameBlurEvent(value, res){ nameBlurEvent(value, res){
this.name = value this.name = value
@ -91,7 +103,7 @@
this.checkSubmit() this.checkSubmit()
}, },
idCardBlurEvent(value, res){ idCardBlurEvent(value, res){
this.idcardExt = value this.idcard = value
this.idcardExtRule = res this.idcardExtRule = res
this.checkSubmit() this.checkSubmit()
}, },
@ -105,6 +117,12 @@
if(!this.nameRule || !this.idcardExtRule || !this.phoneRule) return if(!this.nameRule || !this.idcardExtRule || !this.phoneRule) return
this.canSubmit = true this.canSubmit = true
}, },
reback(){
if(this.vid){
uni.removeStorageSync('visitor_info_'+ this.vid)
}
this.$func.toPage('/pages/visitors/visitors')
},
submit(){ submit(){
this.checkSubmit() this.checkSubmit()
if(!this.canSubmit) return if(!this.canSubmit) return
@ -149,6 +167,24 @@
.submit{ .submit{
margin: 0 auto; margin: 0 auto;
} }
.fixedBot{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 124rpx;
background: #FFFFFF;
box-shadow: 0rpx -2rpx 6rpx 0rpx rgba(181,181,181,0.13);
backdrop-filter: blur(20rpx);
display: flex;
.submit{
width: 100%;
display: flex;
justify-content: center;
align-items: center;
column-gap: 50rpx;
}
}
} }
</style> </style>

216
pages/prebook/prebook.vue

@ -2,18 +2,18 @@
<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'">
{{depart.h_name}} {{depart.depart_name}} {{depart.hospital_name}} {{depart.depart_name}}
</view> </view>
<book ref="book" @confirmSubmitEvent="showConfirm" :RegistrationTimeList="RegistrationTimeList" :visitorList="activeVisitors"/> <book ref="book" @confirmSubmitEvent="showConfirm" @getAvailabletRegistrationTime = "getAvailabletRegistrationTime" :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">
<view class="desc">当前时段余号不足只能预约{{times.remain_num}}</view> <view class="desc">当前时段余号不足只能预约{{times.remain}}</view>
<view class="members"> <view class="members">
<view :class="'memmbers-item'+(item.choose?' active':'')" v-for="(item,key) in activeVisitors" @click="chooseVisitor(key)"> <view :class="'memmbers-item'+(item.choose?' active':'')" v-for="(item,key) in activeVisitors" @click="chooseVisitor(key)">
<img :src="cssUrl+'checkbox_false.svg'"> <img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'"> <img :src="cssUrl+'checkbox_true.svg'">
{{item.visitor_name}} {{item.name}}
</view> </view>
</view> </view>
</view> </view>
@ -21,21 +21,21 @@
<view class="left">就诊人</view> <view class="left">就诊人</view>
<view class="right over2 over5"> <view class="right over2 over5">
<text v-for="(item,key) in activeVisitors"> <text v-for="(item,key) in activeVisitors">
<text v-if="key<=9">{{nums[key]}}</text><text v-else>n.</text>{{item.visitor_name}} <text v-if="key<=9">{{nums[key]}}</text><text v-else>n.</text>{{item.name}}
</text> </text>
</view> </view>
</view> </view>
<view class="item" > <view class="item" >
<view class="left">医生姓名</view> <view class="left">医生姓名</view>
<view class="right">{{doctorInfo.doctor_info.name}}</view> <view class="right">{{doctorInfo.doctor_info.doctor_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="left">就诊医院</view> <view class="left">就诊医院</view>
<view class="right over2 over5">{{depart.h_name}} {{depart.depart_name}}</view> <view class="right over2 over5">{{depart.hospital_name}} {{depart.depart_name}}</view>
</view> </view>
<view class="item"> <view class="item">
<view class="left">看诊时间</view> <view class="left">看诊时间</view>
<view class="right orange">{{times.date}} {{times.time_desc}} {{times.start_time}}-{{times.end_time}}</view> <view class="right orange">{{times.date}} {{times.time_desc}} {{times.time_interval}}</view>
</view> </view>
<view class="btns-box flex"> <view class="btns-box flex">
@ -66,7 +66,7 @@
chooseVisitorCount:0, chooseVisitorCount:0,
departId:false, departId:false,
depart:false, depart:false,
visit_nums_id:false visitor_ids:false,
} }
}, },
components:{ components:{
@ -129,107 +129,56 @@
} }
}) })
}, },
getAvailabletRegistrationTime(refresh = true, chooseDay = '') { getAvailabletRegistrationTime(date) {
this.$http.req('get_appoint_times',{depart_id:this.departId}, 'GET').then(data=>{ const param = {
if(data == -1) return depart_id:this.departId,
// data.days = [ date:date?date:''
// { }
// date: "2024-04-17", type: 2, type_text: "", weekday: "", //
// am: [ // const data1={"date2work":{"2024-09-25":{"date":"2024-09-25","week_desc":"","work_desc":""},"2024-09-26":{"date":"2024-09-26","week_desc":"","work_desc":""},"2024-09-27":{"date":"2024-09-27","week_desc":"","work_desc":""},"2024-09-30":{"date":"2024-09-30","week_desc":"","work_desc":""},"2024-10-01":{"date":"2024-10-01","week_desc":"","work_desc":""},"2024-10-02":{"date":"2024-10-02","week_desc":"","work_desc":""},"2024-10-03":{"date":"2024-10-03","week_desc":"","work_desc":""}},
// { // "date2time":{
// "start": "12:00", // "am":[
// "end": "12:30", // "8:00-08:30","08:30-09:00","09:00-09:30","09:30-10:00","10:00-10:30","10:30-11:00","11:00-11:30","11:30-12:00"
// "bed_count": 0 // ],"pm":[
// }, // "13:00-13:30",
// { // "13:30-14:00",
// "start": "13:00", // "14:00-14:30",
// "end": "14:30", // "14:30-15:00",
// "bed_count": 2 // "15:00-15:30",
// } // "15:30-16:00",
// ], // "14:00-14:30",
// pm: [] // "14:30-15:00",
// }, // "15:00-15:30",
// { // "15:30-16:00",
// date: "2024-04-18", type: 5, type_text: "", weekday: "", am: [], pm: [] // "16:00-16:30",
// }, // "16:30-17:00",
// { // ]},
// date: "2024-04-19", type: 3, type_text: "", weekday: "", am: [ // "time2remain":{"8:00-08:30":1,"08:30-09:00":2,"09:00-09:30":20,"09:30-10:00":20,"10:00-10:30":20,"10:30-11:00":20,"11:00-11:30":20,"11:30-12:00":20}}
// { this.$http.req('/user/get_appoint_times',param, 'POST').then(data=>{
// "start": "12:00", let date2work = data.date2work
// "end": "12:30", // let date2work = data1.date2work;//
// "bed_count": 0 let regxp = /^0/;
// }, for(let key in date2work){
// { let itemObj = date2work[key];
// "start": "13:00", let month = itemObj.date.split('-')[1];
// "end": "14:30", let day = itemObj.date.split('-')[2];
// "bed_count": 2 itemObj['day'] = day;
// } if(regxp.test(month)){
// ], pm: [ itemObj['month'] = month.replace('0','')
// {
// "start": "12:00",
// "end": "12:30",
// "bed_count": 0
// },
// {
// "start": "13:00",
// "end": "14:30",
// "bed_count": 8
// }
// ]
// },
// {
// date: "2024-04-20", 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-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
if(this.RegistrationTimeList.length>0) {
if(refresh || chooseDay>=this.RegistrationTimeList.length) {
this.$refs.book.dataInit(this.RegistrationTimeList[0])
}else{ }else{
this.$refs.book.chooseDay(chooseDay, this.RegistrationTimeList[chooseDay]) itemObj['month'] = month
} }
} }
// this.RegistrationTimeList = date2work
// if(this.RegistrationTimeList.length>0) {
// if(refresh) {
// this.$refs.book.dataInit(data1['date2time'],data1['time2remain'])
this.$refs.book.dataInit(data1,date)
// this.$refs.book.dataInit(data['date2time'],data['time2remain'],date)
// }else{
// this.$refs.book.chooseDay(chooseDay, this.RegistrationTimeList[chooseDay])
// }
// }
}); });
}, },
closeConfirm() { closeConfirm() {
@ -238,7 +187,6 @@
appoint() { appoint() {
var param = new Object() var param = new Object()
param.depart_id = this.departId param.depart_id = this.departId
param.visit_nums_id = this.visit_nums_id
var uids = new Array() var uids = new Array()
for (var i = 0; i < this.activeVisitors.length; i++) { for (var i = 0; i < this.activeVisitors.length; i++) {
var visitor = this.activeVisitors[i] var visitor = this.activeVisitors[i]
@ -255,45 +203,41 @@
return return
} }
if(uids.length > this.times.remain_num){ if(uids.length > this.times.remain){
this.$pop.modelShow('当前时段余号不足,只能预约'+this.times.remain_num+'人') this.$pop.modelShow('当前时段余号不足,只能预约'+this.times.remain+'人')
return return
} }
param.visitor_ids = uids.join(',') param.visitor_ids = uids;
param.time_interval = this.times.time_interval;
param.date = this.times.date;
this.chooseVisitorCount = uids.length this.chooseVisitorCount = uids.length
this.$http.req('appoint', param).then(data=>{ this.$http.req('user/appoint', param,'POST').then(data=>{
if(data == -1) return if(data == -1) return
this.tips() this.tips()
}); });
}, },
appointCheck(times, chooseDay='', visit_nums_id){ appointCheck(times){
var param = new Object() var param = {...times}
param.depart_id = this.departId param.depart_id = this.departId;
this.visit_nums_id = param.visit_nums_id = visit_nums_id let visitor_ids = new Array();
var visitor_ids = new Array();
for (var i = 0; i < this.activeVisitors.length; i++) { for (var i = 0; i < this.activeVisitors.length; i++) {
visitor_ids.push(this.activeVisitors[i].id) visitor_ids.push(this.activeVisitors[i].id)
} }
param.visitor_ids = visitor_ids.join(',')
this.times = param param.visitor_ids = this.visitor_ids = visitor_ids;
this.times.date = times.date.date this.times = param;
this.times.start_time = times.start this.times.date = times.date;
this.times.end_time = times.end this.times.time_desc = '下午';
this.times.time_desc = '下午' if(times.type == 1) this.times.time_desc = '上午';
if(times.type == 1) this.times.time_desc = '上午' this.$http.req('user/check_appoint_nums', param,'POST').then(data=>{
// if(data == -1) {
this.$http.req('check_appoint_nums', param).then(data=>{ // this.getAvailabletRegistrationTime(false, chooseDay)
if(data == -1) { // return
this.getAvailabletRegistrationTime(false, chooseDay) // }
return let remain = 1
} if(remain < this.activeVisitors.length){
if(data.remain_num < this.activeVisitors.length){
this.needSelectMembers = true this.needSelectMembers = true
this.$set(this.times, 'remain_num', data.remain_num) this.$set(this.times, 'remain', remain)
this.$refs.sliderbox.showConfirm() this.$refs.sliderbox.showConfirm()
}else{ }else{
this.$refs.sliderbox.showConfirm() this.$refs.sliderbox.showConfirm()
@ -301,7 +245,7 @@
}); });
}, },
showConfirm(times) { showConfirm(times) {
this.appointCheck(times, times.key, times.id) this.appointCheck(times)
}, },
submitConfim(){ submitConfim(){
this.appoint() this.appoint()

218
pages/prebook_list/prebook_list.vue

@ -2,7 +2,7 @@
<view class="page-prebook-list"> <view class="page-prebook-list">
<view class="nav"> <view class="nav">
<view :class="'item'+(userSelectIndex==0?' active':'')" @click="selectUser(0)">全部</view> <view :class="'item'+(userSelectIndex==0?' active':'')" @click="selectUser(0)">全部</view>
<view :class="'item'+(userSelectIndex==(key+1)?' active':'')" v-for="(item,key) in vistors" @click="selectUser(key+1)">{{item.visitor_name}}</view> <view :class="'item'+(userSelectIndex==(key+1)?' active':'')" v-for="(item,key) in vistors" @click="selectUser(key+1)">{{item.name}}</view>
</view> </view>
<pre-book-list class="preg-books" :dataList="bookList"></pre-book-list> <pre-book-list class="preg-books" :dataList="bookList"></pre-book-list>
</view> </view>
@ -22,7 +22,7 @@
preBookList preBookList
}, },
onShow(){ onShow(){
this.getVisitors() this.getBookData()
}, },
methods: { methods: {
selectUser(key){ selectUser(key){
@ -34,8 +34,10 @@
param.page = 1 param.page = 1
param.limit = 10000 param.limit = 10000
if(this.userSelectIndex-1 >= 0){ if(this.userSelectIndex-1 >= 0){
param.visitor_id = this.vistors[this.userSelectIndex-1].id param.visitor_id = this.vistors[this.userSelectIndex-1].visitor_id
console.log(this.vistors) console.log(this.vistors)
}else{
param.visitor_id = '0'
} }
uni.showLoading({ uni.showLoading({
title:'加载中', title:'加载中',
@ -44,219 +46,21 @@
var timerobj = setTimeout(function(){ var timerobj = setTimeout(function(){
uni.hideLoading() uni.hideLoading()
}, 3000) }, 3000)
this.$http.req('get_appoints', param, 'POST', true).then(data=>{ this.$http.req('user/get_appoints', param, 'POST', true).then(data=>{
clearTimeout(timerobj) clearTimeout(timerobj)
uni.hideLoading() uni.hideLoading()
if(data == -1) return if(data == -1) return
this.bookList = data.data this.bookList = data;
// this.bookList = [ if(this.userSelectIndex === 0){
// { this.vistors = JSON.parse(JSON.stringify(data))
// "id": 27, }
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 2,
// "date": "2024-04-03",
// "username": "",
// "create_datetime": "2024-04-03 15:44:26",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 10,
// "handler_type": 1,
// "start_time": "16:00",
// "end_time": "16:30",
// "status": 0
// },
// {
// "id": 26,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 2,
// "date": "2024-04-03",
// "username": "",
// "create_datetime": "2024-04-03 14:57:17",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "15:00",
// "end_time": "15:30",
// "status": 2
// },
// {
// "id": 25,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-30",
// "username": "",
// "create_datetime": "2024-03-30 08:48:17",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "09:00",
// "end_time": "09:30",
// "status": 2
// },
// {
// "id": 24,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 2,
// "date": "2024-03-30",
// "username": "",
// "create_datetime": "2024-03-30 07:46:51",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 2,
// "start_time": "14:00",
// "end_time": "14:30",
// "status": 1
// },
// {
// "id": 23,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-31",
// "username": "",
// "create_datetime": "2024-03-30 06:50:52",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "15:00",
// "end_time": "15:30",
// "status": 2
// },
// {
// "id": 22,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-30",
// "username": "",
// "create_datetime": "2024-03-30 06:21:43",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "07:00",
// "end_time": "07:30",
// "status": 2
// },
// {
// "id": 21,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-30",
// "username": "",
// "create_datetime": "2024-03-30 06:20:40",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "07:00",
// "end_time": "07:30",
// "status": 2
// },
// {
// "id": 20,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-31",
// "username": "",
// "create_datetime": "2024-03-30 05:07:08",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "15:00",
// "end_time": "15:30",
// "status": 2
// },
// {
// "id": 19,
// "user_ids": [],
// "user_infos": null,
// "doctor_id": 1,
// "date": "2024-03-31",
// "username": "",
// "create_datetime": "2024-03-30 05:02:29",
// "visit_hospital": {
// "id": 1,
// "visit_day_text": ",,",
// "hospital_name": "",
// "hospital_location": "34.5145141,25.6414014",
// "hospital_dept_name": "",
// "remind_text": ""
// },
// "wait_count": 0,
// "handler_type": 1,
// "start_time": "10:00",
// "end_time": "10:30",
// "status": 2
// }
// ]
// console.log(this.bookList)
}); });
}, },
getVisitors() { getVisitors() {
var param = new Object() var param = new Object()
param.page = 1 param.page = 1
param.limit = 10000 param.limit = 10000
this.$http.req('get_visitor_names', param, 'GET').then(data=>{ this.$http.req('user/get_visitors', {}, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.getBookData() this.getBookData()
this.vistors = data this.vistors = data

36
pages/user_modify/user_modify.vue

@ -5,8 +5,8 @@
<view class="item"> <view class="item">
<view class="left PfScMedium">头像</view> <view class="left PfScMedium">头像</view>
<view class="right" @click="upload"> <view class="right" @click="upload">
<img :src="avator" class="avator" v-if="!uinfo.avator"> <img :src="avator" class="avator" v-if="!uinfo.user_avatar">
<img :src="uinfo.avator" class="avator" v-else> <img :src="uinfo.user_avatar" class="avator" v-else>
<view class="avator_tips">点击上传照片</view> <view class="avator_tips">点击上传照片</view>
</view> </view>
</view> </view>
@ -38,17 +38,20 @@
return { return {
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
avator:this.cssUrl+'default_avator.svg', avator:this.cssUrl+'default_avator.svg',
uinfo:{}, uinfo:{
user_avatar:''
},
nick:'', nick:'',
tempFilePaths:'', tempFilePaths:'',
tempFiles:''
} }
}, },
onLoad() { onLoad() {
this.getUser() // this.getUser()
}, },
methods: { methods: {
getUser(){ getUser(){
this.$http.req('get_userinfo', {}, 'GET').then(data=>{ this.$http.req('user/get_user_info', {}, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.uinfo = data this.uinfo = data
this.nick = this.uinfo.nick this.nick = this.uinfo.nick
@ -56,18 +59,19 @@
}, },
save(){ save(){
var param = new Object() var param = new Object()
param.nick = this.nick
var that = this
var token = uni.getStorageSync('token') var token = uni.getStorageSync('token')
console.log(that.tempFilePaths) var that = this;
param.nick = this.nick;
uni.uploadFile({ uni.uploadFile({
url: '/api/user/setting_user/', url: '/api/user/setting_user',
filePath:that.tempFilePaths, filePath:that.tempFilePaths,
name: that.tempFilePaths ? 'avator':'empty', name: 'avatar_file',
header: { header: {
'Authorization': token 'AUTH': token
},
formData:{
nick:param.nick,
}, },
formData:{nick:param.nick},
success: function(res){ success: function(res){
try{ try{
var data = JSON.parse(res.data) var data = JSON.parse(res.data)
@ -78,7 +82,7 @@
uni.showToast({ uni.showToast({
title:data.msg title:data.msg
}) })
if(that.tempFilePaths) that.uinfo.avator = that.tempFilePaths if(that.tempFilePaths) that.uinfo.user_avatar = that.tempFilePaths
}catch(e){ }catch(e){
that.$pop.modelShow('保存失败~'+e.message) that.$pop.modelShow('保存失败~'+e.message)
} }
@ -101,9 +105,13 @@
uni.chooseImage({ uni.chooseImage({
count: 1, count: 1,
success: function(res) { success: function(res) {
console.log(res,'res---');
var tempFilePaths = res.tempFilePaths var tempFilePaths = res.tempFilePaths
let tempFiles = res.tempFiles;
that.tempFilePaths = tempFilePaths[0] that.tempFilePaths = tempFilePaths[0]
that.uinfo.avator = that.tempFilePaths that.tempFiles = tempFiles[0]
that.uinfo.user_avatar = that.tempFilePaths
console.log(that.uinfo,'=uinfo');
} }
}); });
} }

6
pages/usercenter/usercenter.vue

@ -1,9 +1,9 @@
<template> <template>
<view class="page-usercenter"> <view class="page-usercenter">
<view class="user-wrapper" @click="toUserModify"> <view class="user-wrapper" @click="toUserModify">
<img :src="uinfo.avator" class="avator" v-if="uinfo.avator"> <img :src="uinfo.user_avatar" class="avator" v-if="uinfo.user_avatar">
<img :src="cssUrl+'user_grey.svg'" class="avator" v-else> <img :src="cssUrl+'user_grey.svg'" class="avator" v-else>
<view class="ucode PfScMedium over2">{{uinfo.uid}}</view> <view class="ucode PfScMedium over2">{{uinfo.user_nick}}</view>
</view> </view>
<view class="menu"> <view class="menu">
@ -39,7 +39,7 @@
}, },
methods: { methods: {
getUser(){ getUser(){
this.$http.req('get_userinfo', {}, 'GET').then(data=>{ this.$http.req('user/get_user_info', {}, 'POST').then(data=>{
if(data == -1) return if(data == -1) return
this.uinfo = data this.uinfo = data
}); });

127
pages/visitors/visitors.vue

@ -6,11 +6,11 @@
<view class="list-wrapper" v-if="type == 1"> <view class="list-wrapper" v-if="type == 1">
<view :class="'item block'+(item.select?' active':'')" v-for="(item,key) in visitUsers" @click="chooseVisitor(item, key)"> <view :class="'item block'+(item.select?' active':'')" v-for="(item,key) in visitUsers" @click="chooseVisitor(item, key)">
<view class="top flex"> <view class="top flex">
<view class="name PfScSemibold">{{item.visitor_name}}</view> <view class="name PfScSemibold">{{item.name}}</view>
<view class="aam_times" v-if="item.remain_num">{{item.remain_desc}}</view> <view class="aam_times" v-if="item.remain_num > 0">剩余{{item.remain_num}}</view>
</view> </view>
<view class="bot line36"> <view class="bot line36">
身份证尾号{{item.idcard_ext}} 身份证尾号{{item.idcard}}
</view> </view>
<img class="status" :src="cssUrl+'visitor_select_active.svg'"> <img class="status" :src="cssUrl+'visitor_select_active.svg'">
<img class="bg" :src="cssUrl+'visitor_list__bg.svg'"> <img class="bg" :src="cssUrl+'visitor_list__bg.svg'">
@ -26,19 +26,32 @@
<view class="list-wrapper2" v-if="type == 2"> <view class="list-wrapper2" v-if="type == 2">
<view class="item block" v-for="(item,key) in visitUsers"> <view class="item block" v-for="(item,key) in visitUsers">
<view class="top flex" @click="vistorOption(item)"> <view class="top flex" @click="vistorOption(item)">
<view class="PfScSemibold">{{item.visitor_name}}</view> <view class="PfScSemibold">{{item.name}}</view>
<view>身份证尾号{{item.idcard_ext}}</view> <view>身份证尾号{{item.idcard}}</view>
</view> </view>
<view class="bt" v-if="item.hospital_info.length>0"> <!-- 暂时注释 多个医院信息渲染 -->
<!-- <view class="bt-item flex" v-for="(item2,key2) in item.hospital_info" @click="showNotice(item2.popmsgIndex)"> --> <!-- <view class="bt" v-if="item.hospital_info.length>0">
<view class="bt-item flex" v-for="(item2,key2) in item.hospital_info"> <view class="bt-item flex" v-for="(item2,key2) in item.hospital_info">
<view class="left flex"> <view class="left flex">
<view class="over3">{{item2.hospital_name}} {{item2.hospital_dept}}</view> <view class="over3">{{item2.hospital_name}} {{item2.hospital_dept}}</view>
<view class="status2" v-if="!item2.hospital_state">停诊</view> <view class="status2" v-if="!item2.hospital_state">停诊</view>
<view class="status2" v-else-if="item2.is_expire">{{item2.expire_desc}}</view> <view class="status2" v-else-if="item2.is_expire">{{item2.expire_desc}}</view>
</view> </view>
<view class="more right" v-if="item2.times>=0">剩余<text>{{item2.times}}</text></view> <view class="more right" v-if="item2.remain_num>=0">剩余<text>{{item2.remain_num}}</text></view>
<view class="owe right" v-else><text>{{-item2.times}}</text></view> <view class="owe right" v-else><text>{{-item2.remain_num}}</text></view>
</view>
</view> -->
<view class="bt" v-if="item.hospital">
<view class="bt-item flex">
<view class="left flex">
<view class="over">{{ item.hospital}}</view>
<!-- <view :class="(!item.doctor_status && !item.weeks)? 'over' : ''">{{ item.hospital}}</view> -->
<view class="over depart">{{item.depart }}</view>
<view class="status2" v-if="item.doctor_status !== '出诊'">{{ item.doctor_status }}</view>
<view class="status2" v-else-if="item.weeks">{{ item.weeks }}周未看病</view>
</view>
<view class="more right" v-if="item.remain_num>=0">剩余<text>{{item.remain_num}}</text></view>
<view class="owe right" v-else><text>{{-item.remain_num}}</text></view>
</view> </view>
</view> </view>
</view> </view>
@ -117,11 +130,10 @@
var that = this var that = this
uni.showModal({ uni.showModal({
title:'删除', title:'删除',
content:'确认删除就诊人('+visitor.visitor_name+')?', content:'删除'+visitor.name+'后,就诊记录还可以查到,确定删除吗?',
success(res) { success(res) {
if(!res.confirm) return if(!res.confirm) return
that.$http.req('setting_visitor', {id:visitor.id,is_del:1}).then(data=>{ that.$http.req('/user/del_visitor', {id:visitor.id},'POST').then(data=>{
if(data == -1) return
that.getVisitors() that.getVisitors()
}); });
} }
@ -155,13 +167,25 @@
} }
}, },
getVisitors() { getVisitors() {
var param = new Object() // var param = new Object()
param.page = 1 // param.page = 1
param.limit = 10000 // param.limit = 10000
this.$http.req('get_visitors', param, 'GET').then(data=>{ this.$http.req('user/get_visitors', {}, 'POST').then(data=>{
if(data == -1) return this.visitUsers = data;
this.visitUsers = data let arr =
console.log(this.visitUsers) //
{
'id':'32',
"name": "暴富喽",
"idcard": "6666",
"phone": "18816661888",
"hospital": "北京LY暴富",
"depart": "针灸科",
"doctor_status": "停诊",
"remain_num": "4",
"last_visit": "1970-01-01 00:00:01"
}
this.visitUsers = [...this.visitUsers,arr]
this.popMsgs = [] this.popMsgs = []
var popmsgIndex = 0 var popmsgIndex = 0
for (var i = 0; i < this.visitUsers.length; i++) { for (var i = 0; i < this.visitUsers.length; i++) {
@ -173,7 +197,9 @@
// "hospital_dept": "", // "hospital_dept": "",
// "hospital_state": true, // "hospital_state": true,
// "is_expire":true, // "is_expire":true,
// "last_visit_time": "2021-01-12 13:16:26" // "last_visit_time": "2021-01-12 13:16:26",
// "expire_desc":''
// }, // },
// { // {
@ -185,31 +211,30 @@
// "last_visit_time": "2021-01-12 13:16:26" // "last_visit_time": "2021-01-12 13:16:26"
// } // }
// ] // ]
// hospital_info
// try{
// var hospitalInfo = this.visitUsers[i].hospital_info
// for (var j = 0; j < hospitalInfo.length; j++) {
// if(!hospitalInfo[j].hospital_state || this.type == 1) continue
try{ // var popobj = new Object()
var hospitalInfo = this.visitUsers[i].hospital_info // popobj.popShowCancel = false
for (var j = 0; j < hospitalInfo.length; j++) { // if(hospitalInfo[j].is_expire){
if(!hospitalInfo[j].hospital_state || this.type == 1) continue // popobj.popContent = this.visitUsers[i].real_name+'<span style="color:red;">'+hospitalInfo[j].expire_day+'</span>'+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+''
// popobj.popTitle = ""
var popobj = new Object() // }
popobj.popShowCancel = false
if(hospitalInfo[j].is_expire){
popobj.popContent = this.visitUsers[i].real_name+'已<span style="color:red;">'+hospitalInfo[j].expire_day+'</span>没有来'+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+'针灸。如还需要,请尽快安排'
popobj.popTitle = "提醒"
}
if(hospitalInfo[j].times < 0){ // if(hospitalInfo[j].remain_num < 0){
popobj.popContent = this.visitUsers[i].real_name+'在'+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+'须补挂号啦,请挂号缴费后告知医生' // popobj.popContent = this.visitUsers[i].real_name+''+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+''
popobj.popTitle = "挂号提醒" // popobj.popTitle = ""
} // }
popmsgIndex = this.popMsgs.length // popmsgIndex = this.popMsgs.length
this.visitUsers[i].hospital_info[j].popmsgIndex = popmsgIndex // this.visitUsers[i].hospital_info[j].popmsgIndex = popmsgIndex
this.popMsgs.push(popobj) // this.popMsgs.push(popobj)
} // }
}catch(et){ // }catch(et){
} // }
} }
if(this.popMsgs.length > 0 && !uni.getStorageSync('has_noticed')){ if(this.popMsgs.length > 0 && !uni.getStorageSync('has_noticed')){
this.popIndex = 0 this.popIndex = 0
var popinfo = this.popMsgs[this.popIndex] var popinfo = this.popMsgs[this.popIndex]
@ -318,14 +343,14 @@
letter-spacing: 3rpx; letter-spacing: 3rpx;
} }
.aam_times{ .aam_times{
min-width: 134rpx; // min-width: 134rpx;
color: #79624A; color: #79624A;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
background: rgba(254, 232, 198, 0.66); background: rgba(254, 232, 198, 0.66);
border-radius: 6rpx; border-radius: 6rpx;
height: 44rpx; height: 44rpx;
padding: 0 10rpx; padding: 0 17rpx;
line-height: 44rpx; line-height: 44rpx;
margin-left: 56rpx; margin-left: 56rpx;
} }
@ -417,7 +442,9 @@
max-width: 250rpx; max-width: 250rpx;
align-items: flex-end; align-items: flex-end;
} }
.depart{
margin-left: 10rpx;
}
.status2{ .status2{
height: 38rpx; height: 38rpx;
background: #FFE9E9; background: #FFE9E9;
@ -430,28 +457,24 @@
} }
.right{ .right{
flex-grow: 1; flex-grow: 1;
&.more{ &.more,&.owe{
font-size: 28rpx; font-size: 28rpx;
color: #949699; color: #949699;
letter-spacing: 2rpx; letter-spacing: 2rpx;
text-align: right; text-align: right;
line-height: 52rpx;
text{ text{
font-size: 52rpx; font-size: 52rpx;
color: #000000; color: #000000;
line-height: 52rpx;
letter-spacing: 3rpx; letter-spacing: 3rpx;
} }
} }
&.owe{ &.owe{
text-align: right;
font-size: 28rpx;
color: #FD0000; color: #FD0000;
letter-spacing: 2rpx;
line-height: 52rpx; line-height: 52rpx;
text{ text{
font-size: 52rpx;
color: #FD0000; color: #FD0000;
line-height: 52rpx;
letter-spacing: 3rpx;
} }
} }
} }

Loading…
Cancel
Save