Browse Source

确认报道页面相关

master
kuaileWu 6 months ago
parent
commit
a3ccf63906
  1. 16
      App.vue
  2. 18
      components/userCard.vue
  3. 83
      main.js
  4. 39
      pages/index/index.vue
  5. 89
      pages/visitors/visitors.vue
  6. 45
      pages/waiting_method/waiting_method.vue

16
App.vue

@ -10,13 +10,17 @@
try { try {
const pathParts = location.pathname.split('/'); const pathParts = location.pathname.split('/');
const paramIndex = pathParts.indexOf('did'); const paramIndex = pathParts.indexOf('did');
if(paramIndex !== -1 && paramIndex + 1 < pathParts.length) { if(paramIndex !== -1 && paramIndex + 1 < pathParts.length) {
did = pathParts[paramIndex + 1] did = pathParts[paramIndex + 1]
} }
} catch (e) { } catch (e) {
} }
if(option.query && option.query.depart_id) {
uni.setStorageSync('checkin_depart_id', option.query.depart_id)
}
if(!did){ if(!did){
var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey) var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey)
if(doctor_id){ if(doctor_id){
@ -238,7 +242,7 @@
line-height: 40rpx !important; line-height: 40rpx !important;
height: 40rpx !important; height: 40rpx !important;
} }
.pages-visitors-visitors ::v-deep .uni-actionsheet__cell{ .pages-visitors-visitors ::v-deep .uni-actionsheet__cell{
color:#31333B !important; color:#31333B !important;
font-size: 34rpx; font-size: 34rpx;
@ -258,7 +262,7 @@
.pages-visitors-visitors ::v-deep .uni-actionsheet__menu{ .pages-visitors-visitors ::v-deep .uni-actionsheet__menu{
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
} }
.pages-visitors-visitors ::v-deep uni-actionsheet .uni-actionsheet__cell:before { .pages-visitors-visitors ::v-deep uni-actionsheet .uni-actionsheet__cell:before {
border-top: 2rpx solid #EEEEEE; border-top: 2rpx solid #EEEEEE;
color: #EEEEEE; color: #EEEEEE;
@ -267,7 +271,7 @@
margin-top: 24rpx; margin-top: 24rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
</style> </style>

18
components/userCard.vue

@ -6,8 +6,8 @@
</view> </view>
<view class="bed-wrapper" v-show="type == 1"> <view class="bed-wrapper" v-show="type == 1">
<uni-easyinput v-model="value" placeholder="请输入床位位置" placeholderStyle="color: #999999;font-size: 30rpx;" :trim="true"></uni-easyinput> <uni-easyinput v-model="value" placeholder="请输入床位位置" placeholderStyle="color: #999999;font-size: 30rpx;" :trim="true" @input="inputevent"></uni-easyinput>
</view> </view>
<view class="card-cus-txt" v-if="type == 0"> <view class="card-cus-txt" v-if="type == 0">
首次就诊建议等待医生叫号 首次就诊建议等待医生叫号
@ -59,10 +59,20 @@ export default {
methods: { methods: {
confirm() { confirm() {
}, },
inputevent(e){
var obj = new Object()
obj.key = this.index
obj.type = this.type
obj.bed_desc = e
this.$emit('clickEvent', obj)
},
changeType(e) { changeType(e) {
var obj = new Object() var obj = new Object()
obj.key = this.index obj.key = this.index
obj.type = this.type obj.type = this.type
obj.bed_desc = ''
if(this.type == 1) obj.bed_desc = this.value
this.$emit('clickEvent', obj) this.$emit('clickEvent', obj)
}, },
setType(typeval) { setType(typeval) {
@ -158,14 +168,14 @@ export default {
margin-left: 12rpx; margin-left: 12rpx;
color: #666666; color: #666666;
} }
.radio__inner{ .radio__inner{
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
border: 2rpx solid #BCBCBC; border: 2rpx solid #BCBCBC;
border-radius: 36rpx; border-radius: 36rpx;
} }
&.is--button{ &.is--button{
margin-right: 0rpx; margin-right: 0rpx;
padding: 20rpx 42rpx 20rpx 24rpx; padding: 20rpx 42rpx 20rpx 24rpx;

83
main.js

@ -54,7 +54,7 @@ function isMobile() {
var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
var mobile_flag = false; var mobile_flag = false;
//根据userAgent判断是否是手机 //根据userAgent判断是否是手机
for (var v = 0; v < mobileAgents.length; v++) { for (var v = 0; v < mobileAgents.length; v++) {
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
@ -147,7 +147,7 @@ try{
Vue.prototype.xcxtype = 2; Vue.prototype.xcxtype = 2;
Vue.prototype.provider = Vue.prototype.provider_alipay; Vue.prototype.provider = Vue.prototype.provider_alipay;
} }
if(Vue.prototype.xcxtype == -1){ if(Vue.prototype.xcxtype == -1){
Vue.prototype.isMobile = isMobile(); Vue.prototype.isMobile = isMobile();
isOpenMode(); isOpenMode();
@ -184,9 +184,9 @@ Vue.prototype.add_preview = 3;
Vue.prototype.edit_album = 4; Vue.prototype.edit_album = 4;
function removeLogin() { function removeLogin() {
removeToken() removeToken()
removeUinfo() removeUinfo()
} }
function req(url, data={}, method = 'POST', header={}) { function req(url, data={}, method = 'POST', header={}) {
var domain = Vue.prototype.request_domain; var domain = Vue.prototype.request_domain;
@ -203,7 +203,7 @@ function req(url, data={}, method = 'POST', header={}) {
} }
} }
var getWxH5LoginConfigUri = 'common/wxh5_login' var getWxH5LoginConfigUri = 'common/wxh5_login'
var noNeedLoginFunc = [ var noNeedLoginFunc = [
getWxH5LoginConfigUri, getWxH5LoginConfigUri,
'client/user/login' 'client/user/login'
@ -231,12 +231,17 @@ function req(url, data={}, method = 'POST', header={}) {
var logindatac = new Object(); var logindatac = new Object();
logindatac.redirect_uri = location.origin; logindatac.redirect_uri = location.origin;
logindatac.state = 'user'; logindatac.state = 'user';
var checkin_depart_id = uni.getStorageSync('checkin_depart_id');
if(checkin_depart_id){
}
)
const pagesc = getCurrentPages(); const pagesc = getCurrentPages();
const currentPagec = pagesc[pagesc.length - 1]; const currentPagec = pagesc[pagesc.length - 1];
var pageUrlc = '/'+currentPagec.route; var pageUrlc = '/'+currentPagec.route;
uni.setStorageSync('rebackPagePath', pageUrlc); uni.setStorageSync('rebackPagePath', pageUrlc);
var doctor_id = uni.getStorageSync('doctor_id'); var doctor_id = uni.getStorageSync('doctor_id');
req(getWxH5LoginConfigUri+'/?did='+doctor_id, logindatac, 'POST').then(data=>{ req(getWxH5LoginConfigUri+'/?did='+doctor_id, logindatac, 'POST').then(data=>{
if(data == -1 || !data.authurl) return; if(data == -1 || !data.authurl) return;
@ -326,7 +331,7 @@ function toPage(path){
url: path url: path
}); });
} }
}else{ }else{
if(path.indexOf('/index/index') == -1){ if(path.indexOf('/index/index') == -1){
uni.navigateTo({ uni.navigateTo({
@ -337,7 +342,7 @@ function toPage(path){
url:path url:path
}); });
} }
} }
} }
@ -352,38 +357,38 @@ function modelShow(content, path="",title="提示") {
} }
} }
}); });
}
function getToken() {
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
return uni.getStorageSync('token_'+did)
}
function removeToken() {
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.removeStorageSync('token_'+did)
}
function setToken(token) {
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.setStorageSync('token_'+did, token)
}
function removeUinfo(){
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.removeStorageSync('uinfo_'+did)
} }
function setUinfo(info){ function getToken() {
var did = uni.getStorageSync('doctor_id') var did = uni.getStorageSync('doctor_id')
if(!did) return; if(!did) return ""
uni.setStorageSync('uinfo_'+did, info) return uni.getStorageSync('token_'+did)
} }
function removeToken() {
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.removeStorageSync('token_'+did)
}
function setToken(token) {
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.setStorageSync('token_'+did, token)
}
function removeUinfo(){
var did = uni.getStorageSync('doctor_id')
if(!did) return ""
uni.removeStorageSync('uinfo_'+did)
}
function setUinfo(info){
var did = uni.getStorageSync('doctor_id')
if(!did) return;
uni.setStorageSync('uinfo_'+did, info)
}
//设置页main标题 //设置页main标题
function setTitlefFunc(title) { function setTitlefFunc(title) {

39
pages/index/index.vue

@ -134,42 +134,7 @@
1:'上午', 1:'上午',
2:'下午', 2:'下午',
3:'全天', 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:{
@ -337,7 +302,7 @@
uni.setStorageSync('depart', JSON.stringify(hospital)) uni.setStorageSync('depart', JSON.stringify(hospital))
uni.setStorageSync('doctor_info', JSON.stringify(this.doctorInfo)) uni.setStorageSync('doctor_info', JSON.stringify(this.doctorInfo))
uni.navigateTo({ uni.navigateTo({
url:"/pages/visitors/visitors?type=1" url:"/pages/visitors/visitors?type=1&is_preview=1"
}) })
}, },
toPrebookList(){ toPrebookList(){

89
pages/visitors/visitors.vue

@ -4,16 +4,16 @@
{{hospital_depart_name}} {{hospital_depart_name}}
</view> </view>
<view class="header block flex line40" @click="addVisitor" v-if="type != 3"> <view class="header block flex line40" @click="addVisitor" v-if="(type != 3 && type != 0) || is_preview">
<img :src="cssUrl+'add.svg'">增加就诊人 <img :src="cssUrl+'add.svg'">增加就诊人
</view> </view>
<view class="list-wrapper" v-if="(type == 1 || (type == 3 && hasBaoDaoData))"> <view class="list-wrapper" v-if="(type == 1 || type == 0 || is_preview) && visitUsers && visitUsers.length > 0">
<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 over2">{{item.name}}</view> <view class="name PfScSemibold over2">{{item.name}}</view>
<!-- <view class="aam_times" v-if="item.remain_num > 0">剩余{{item.remain_num}}</view> --> <!-- <view class="aam_times" v-if="item.remain_num > 0">剩余{{item.remain_num}}</view> -->
<view class="book-date" v-if="type == 3">已预约今日 {{ item.visit_time.split('-')[0] }} 就诊</view> <view class="book-date" v-if="type == 0 && item.visit_time && !is_preview">已预约今日 {{ item.visit_time.split('-')[0] }} 就诊</view>
<!-- <view class="book-date" v-if="type == 3">已预约今日 12:30 就诊</view> --> <!-- <view class="book-date" v-if="type == 3">已预约今日 12:30 就诊</view> -->
</view> </view>
<view class="bot line36"> <view class="bot line36">
@ -23,25 +23,24 @@
<img class="bg" :src="cssUrl+'visitor_list__bg.svg'"> <img class="bg" :src="cssUrl+'visitor_list__bg.svg'">
</view> </view>
</view> </view>
<view class="baodao-empty" v-if="type == 0 && (!visitUsers || visitUsers.length<=0)">
<view class="baodao-empty" v-if="type == 3 && !hasBaoDaoData">
<img :src="cssUrl+'empty.png'"> <img :src="cssUrl+'empty.png'">
<text>今日没有预约哦请先预约时间</text> <text>今日没有预约哦请先预约时间</text>
</view> </view>
<view class="submit flex baodao-submit" v-if="type == 3 && !hasBaoDaoData"> <view class="submit flex baodao-submit" v-if="type == 0 && !is_preview">
<view :class="'btn cancel btn1 PfScMedium'" hover-class="hover" @click="reback">返回</view> <view :class="'btn cancel btn1 PfScMedium'" hover-class="hover" @click="reback">返回</view>
<view class="btn primary btn1 PfScMedium" hover-class="hover" @click="appointTime">预约时间</view> <view class="btn primary btn1 PfScMedium" hover-class="hover" @click="appointTime">预约时间</view>
</view> </view>
<view class="submit" v-if="type == 0" @click="toPrebook"> <view class="submit" v-if="is_preview" @click="toPrebook">
<view class="bot primary btn btn2 submitbtn" hover-class="hover"> <view class="bot primary btn btn2 submitbtn" hover-class="hover">
确认预约已选{{selectCount}} 确认预约已选{{selectCount}}
</view> </view>
<view class="tip height40">请确保预约就诊前在门诊先挂号</view> <view class="tip height40">请确保预约就诊前在门诊先挂号</view>
</view> </view>
<view class="submit" v-if="type == 1" @click="toPrebook"> <view class="submit" v-if="(type == 1 || type == 0) && !is_preview && visitUsers && visitUsers.length > 0" @click="toPrebook">
<view class="bot primary btn btn2 submitbtn" hover-class="hover"> <view class="bot primary btn btn2 submitbtn" hover-class="hover">
确认以上患者已到已选{{selectCount}} 确认以上患者已到已选{{selectCount}}
</view> </view>
@ -117,6 +116,9 @@
hasBaoDaoData:false, hasBaoDaoData:false,
type:-1, type:-1,
pageshow:false, pageshow:false,
is_preview:false,
doctorInfo:false,
hospitals:false,
} }
}, },
components:{ components:{
@ -138,7 +140,6 @@
uni.setStorageSync('visitor_type', this.type) uni.setStorageSync('visitor_type', this.type)
this.getVisitors()
this.depart_id = uni.getStorageSync('depart_id') this.depart_id = uni.getStorageSync('depart_id')
if(!this.depart_id && this.type == 1) { if(!this.depart_id && this.type == 1) {
this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index') this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index')
@ -150,10 +151,11 @@
return return
} }
if(this.type == 3) this.depart_id = option.depart_id if(option.depart_id) this.depart_id = option.depart_id
if(option.is_preview) this.is_preview = true
}, },
onReady() { async onShow() {
await this.getDoctorInfo();
if(this.type == 2){ if(this.type == 2){
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:'就诊人' title:'就诊人'
@ -162,7 +164,6 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:'确认报到' title:'确认报到'
}) })
this.getDepartInfo();
}else{ }else{
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:'请选择就诊人' title:'请选择就诊人'
@ -172,12 +173,49 @@
}, },
methods: { methods: {
reback(){ reback(){
uni.navigateBack(-1) uni.navigateTo({
url:'/'
})
}, },
// -- // --
async getDoctorInfo() {
await this.$http.req('user/index_info', {}, 'GET').then(data=>{
if(data == -1) return
this.doctorInfo = data;
if(this.doctorInfo.hospital_departs && this.doctorInfo.hospital_departs.length>0) this.hospitals = this.doctorInfo.hospital_departs;
var hospital = {}
this.hospitals.forEach(item=>{
if(item.depart_id == this.depart_id) hospital = item
})
if(!hospital || Object.keys(hospital).length === 0) {
this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index')
return
}
this.hospital_depart_name = hospital.hospital_name + ' ' + hospital.depart_name
this.type = hospital.type
if(this.type == 2){
this.$pop.modelShow('该科室不允许签到', '/pages/index/index')
return;
}
uni.setStorageSync('depart', JSON.stringify(hospital))
uni.setStorageSync('doctor_info', JSON.stringify(this.doctorInfo))
uni.setStorageSync('depart_id', this.depart_id)
this.getVisitors()
});
},
appointTime(){ appointTime(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/visitors/visitors?type=1' url:"/pages/visitors/visitors?type=1&is_preview=1"
}) })
}, },
modifyVistor(visitor){ modifyVistor(visitor){
@ -224,10 +262,17 @@
} }
}, },
getVisitors() { getVisitors() {
this.$http.req('user/get_visitors', {}, 'POST').then(data=>{ var obj = new Object();
if(!this.is_preview && this.type == 0) {
obj.get_preview = 1
obj.depart_id = this.depart_id
}
this.$http.req('user/get_visitors', obj, 'POST').then(data=>{
this.visitUsers = data; this.visitUsers = data;
this.visitUsers = [...this.visitUsers] this.visitUsers = [...this.visitUsers]
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++) {
this.visitUsers[i].select = false this.visitUsers[i].select = false
@ -241,15 +286,7 @@
this.popShowCancel = popinfo.popShowCancel this.popShowCancel = popinfo.popShowCancel
this.showPopCom() this.showPopCom()
} }
});
},
getDepartInfo() {
this.$http.req('user/get_depart_info', {depart_id:this.depart_id}, 'POST').then(data=>{
this.type = data.type
if(this.type == 2){
this.$pop.modelShow('签到二维码已过期', '/pages/index/index')
return;
}
this.pageshow = true this.pageshow = true
}); });
}, },
@ -299,7 +336,7 @@
uni.setStorageSync('active_visitors', JSON.stringify(this.activeVisitors)) uni.setStorageSync('active_visitors', JSON.stringify(this.activeVisitors))
// => // =>
if(this.type == 3 && this.hasBaoDaoData){ if((this.type == 0 || this.type == 1) && !this.is_preview){
uni.navigateTo({ uni.navigateTo({
url:'/pages/waiting_method/waiting_method' url:'/pages/waiting_method/waiting_method'
}) })

45
pages/waiting_method/waiting_method.vue

@ -17,7 +17,7 @@
<script> <script>
import userCard from '@/components/userCard.vue'; import userCard from '@/components/userCard.vue';
export default { export default {
data() { data() {
return { return {
@ -25,6 +25,7 @@
depart_id:0, depart_id:0,
active_visitors:[], active_visitors:[],
hospital_depart_name:'', hospital_depart_name:'',
submitting:false,
visitorList:[ visitorList:[
{name:'张三',type:1}, {name:'张三',type:1},
{name:'李四', type:1}, {name:'李四', type:1},
@ -67,23 +68,45 @@
}); });
}, },
changeType(info) { changeType(info) {
console.log(info)
// //
this.active_visitors[info.key].type = info.type; this.active_visitors[info.key].type = info.type;
this.active_visitors[info.key].bed_desc = info.bed_desc ? info.bed_desc: '';
}, },
submitWaitType(){ submitWaitType(){
// if(this.submitting) return;
// this.active_visitors this.submitting = true;
// jiekou ----
setTimeout(() => {
this.$http.req('user/get_visitors', {}, 'POST').then(data=>{ this.submitting = false;
}, 3000);
var params = [];
this.active_visitors.forEach(visitor => {
params.push({
visitor_id: visitor.id,
visit_id: visitor.visit_id ? visitor.visit_id: 0,
wait_type: visitor.type,
bed_desc: visitor.bed_desc || ""
});
});
var obj = new Object();
obj.depart_id = this.depart_id;
obj.checkin_list = JSON.stringify(params);
this.$http.req('user/checkin', obj, 'POST').then(data => {
//
if(data == -1) return
uni.navigateTo({ uni.navigateTo({
url:'/pages/prebook_list/prebook_list' url: '/pages/prebook_list/prebook_list'
}) });
}).catch(err => {
this.$pop.msg('提交失败,请重试');
}); });
} }
} }
} }
</script> </script>

Loading…
Cancel
Save