Browse Source

预约列表交互

master
kuaileWu 1 year ago
parent
commit
b85a0e8eee
  1. 11
      components/preBookList.vue
  2. 257
      pages/prebook_list/prebook_list.vue

11
components/preBookList.vue

@ -1,14 +1,14 @@
<template> <template>
<view class="prebook-list-com"> <view class="prebook-list-com">
<view class="list btPadding"> <view class="list btPadding" v-if="dataList.length>0">
<view :class="'item '+item" v-for="(item, key) in dataList"> <view :class="'item '+item" v-for="(item, key) in dataList">
<view class="left"> <view class="left">
<view class="title PfScMedium"><text v-if="item.real_name">{{item.real_name}}</text><text v-else></text></view> <view class="title PfScMedium"><text v-if="item.real_name || item.username">{{item.real_name ? item.real_name:item.username}}</text><text v-else></text></view>
<view class="date">{{item.date}} {{getDayOfWeek(item.date)}} {{item.start_time}}-{{item.end_time}}</view> <view class="date">{{item.date}} {{getDayOfWeek(item.date)}} {{item.start_time}}-{{item.end_time}}</view>
<view class="loction">{{item.visit_hospital.hospital_name}}</view> <view class="loction">{{item.visit_hospital.hospital_name}} {{item.visit_hospital.hospital_dept_name}}</view>
</view> </view>
<view class="right"> <view class="right">
<view :class="statusList[item.status]+' status'"><view class="over">候诊</view></view> <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_count"><view>前方<text class="PfScSemibold">{{item.wait_count}}</text></view> </view> <view class="queue-num" v-if="statusList[item.status]=='status_wait' && item.wait_count"><view>前方<text class="PfScSemibold">{{item.wait_count}}</text></view> </view>
</view> </view>
</view> </view>
@ -31,7 +31,8 @@ export default {
data() { data() {
return { return {
cssUrl:this.cssUrl, cssUrl:this.cssUrl,
statusList:['status_wait', 'status_ing', 'status_out_num', 'status_expire', 'status_down'] statusList:['status_wait', 'status_ing', 'status_out_num', 'status_expire', 'status_down'],
statusDescList:['候诊', '就诊中', '过号', '已过期', '已完成']
} }
}, },
methods: { methods: {

257
pages/prebook_list/prebook_list.vue

@ -1,24 +1,10 @@
<template> <template>
<view class="page-prebook-list"> <view class="page-prebook-list">
<view class="nav"> <view class="nav">
<view :class="'item'+(userSelectIndex==0?' active':'')">全部</view> <view :class="'item'+(userSelectIndex==0?' active':'')" @click="selectUser(0)">全部</view>
<view class="item">帅哥</view> <view :class="'item'+(userSelectIndex==(key+1)?' active':'')" v-for="(item,key) in vistors" @click="selectUser(key+1)">{{item.real_name}}</view>
<view class="item">马家辉</view>
<view class="item">刘老板</view>
<view class="item">张小宇</view>
<view class="item">刘大琪</view>
<view class="item">帅哥</view>
<view class="item">马家辉</view>
<view class="item">刘老板</view>
<view class="item">张小宇</view>
<view class="item">刘大琪</view>
<view class="item">帅哥</view>
<view class="item">马家辉</view>
<view class="item">刘老板</view>
<view class="item">张小宇</view>
<view class="item">刘大琪</view>
</view> </view>
<pre-book-list class="preg-books"></pre-book-list> <pre-book-list class="preg-books" :dataList="bookList"></pre-book-list>
</view> </view>
</template> </template>
@ -27,22 +13,251 @@
export default { export default {
data() { data() {
return { return {
userSelectIndex:0 userSelectIndex:0,
vistors:false,
bookList:[]
} }
}, },
components:{ components:{
preBookList preBookList
}, },
onShow(){ onShow(){
this.getBookData() this.getVisitors()
}, },
methods: { methods: {
selectUser(key){
this.userSelectIndex = key
this.getBookData()
},
getBookData() { getBookData() {
var param = new Object() var param = new Object()
param.doctor_id = getApp().globalData.doctorId param.doctor_id = getApp().globalData.doctorId
this.$http.req('client/user/appoint/', param, 'POST', true).then(data=>{ if(this.userSelectIndex-1 >= 0){
param.visit_user_id = this.vistors[this.userSelectIndex-1].id
}
uni.showLoading({
title:'加载中',
mask:true
})
var timerobj = setTimeout(function(){
uni.hideLoading()
}, 3000)
this.$http.req('client/user/appoint/', param, 'GET', true).then(data=>{
clearTimeout(timerobj)
uni.hideLoading()
if(data == -1) return
this.bookList = data.data
// this.bookList = [
// {
// "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() {
var param = new Object()
param.page = 1
param.limit = 10000
this.$http.req('client/user/visit_user/', param, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.getBookData()
this.vistors = data.data
}); });
}, },
pageInit() { pageInit() {

Loading…
Cancel
Save