From a3ccf639060bd63685055c95dbef040579fd501e Mon Sep 17 00:00:00 2001 From: kuaileWu <1432334894@qq.com> Date: Sun, 27 Apr 2025 18:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8A=A5=E9=81=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 16 +++--- components/userCard.vue | 18 +++++-- main.js | 83 +++++++++++++++--------------- pages/index/index.vue | 39 +-------------- pages/visitors/visitors.vue | 89 +++++++++++++++++++++++---------- pages/waiting_method/waiting_method.vue | 45 +++++++++++++---- 6 files changed, 167 insertions(+), 123 deletions(-) diff --git a/App.vue b/App.vue index 3e7d6ad..852c117 100644 --- a/App.vue +++ b/App.vue @@ -10,13 +10,17 @@ try { const pathParts = location.pathname.split('/'); const paramIndex = pathParts.indexOf('did'); - + if(paramIndex !== -1 && paramIndex + 1 < pathParts.length) { did = pathParts[paramIndex + 1] } } catch (e) { } + if(option.query && option.query.depart_id) { + uni.setStorageSync('checkin_depart_id', option.query.depart_id) + } + if(!did){ var doctor_id = uni.getStorageSync(this.globalData.doctoridStorageKey) if(doctor_id){ @@ -238,7 +242,7 @@ line-height: 40rpx !important; height: 40rpx !important; } - + .pages-visitors-visitors ::v-deep .uni-actionsheet__cell{ color:#31333B !important; font-size: 34rpx; @@ -258,7 +262,7 @@ .pages-visitors-visitors ::v-deep .uni-actionsheet__menu{ border-radius: 20rpx 20rpx 0 0; } - + .pages-visitors-visitors ::v-deep uni-actionsheet .uni-actionsheet__cell:before { border-top: 2rpx solid #EEEEEE; color: #EEEEEE; @@ -267,7 +271,7 @@ margin-top: 24rpx; margin-bottom: 10rpx; } - - - + + + diff --git a/components/userCard.vue b/components/userCard.vue index e0810ef..2c1b0d4 100644 --- a/components/userCard.vue +++ b/components/userCard.vue @@ -6,8 +6,8 @@ - - + + 首次就诊,建议等待医生叫号 @@ -59,10 +59,20 @@ export default { methods: { 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) { var obj = new Object() obj.key = this.index obj.type = this.type + obj.bed_desc = '' + if(this.type == 1) obj.bed_desc = this.value + this.$emit('clickEvent', obj) }, setType(typeval) { @@ -158,14 +168,14 @@ export default { margin-left: 12rpx; color: #666666; } - + .radio__inner{ width: 36rpx; height: 36rpx; border: 2rpx solid #BCBCBC; border-radius: 36rpx; } - + &.is--button{ margin-right: 0rpx; padding: 20rpx 42rpx 20rpx 24rpx; diff --git a/main.js b/main.js index e52e121..3ecdc3d 100644 --- a/main.js +++ b/main.js @@ -54,7 +54,7 @@ function isMobile() { var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var mobile_flag = false; - + //根据userAgent判断是否是手机 for (var v = 0; v < mobileAgents.length; v++) { if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { @@ -147,7 +147,7 @@ try{ Vue.prototype.xcxtype = 2; Vue.prototype.provider = Vue.prototype.provider_alipay; } - + if(Vue.prototype.xcxtype == -1){ Vue.prototype.isMobile = isMobile(); isOpenMode(); @@ -184,9 +184,9 @@ Vue.prototype.add_preview = 3; Vue.prototype.edit_album = 4; function removeLogin() { - removeToken() + removeToken() removeUinfo() -} +} function req(url, data={}, method = 'POST', header={}) { 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 = [ getWxH5LoginConfigUri, 'client/user/login' @@ -231,12 +231,17 @@ function req(url, data={}, method = 'POST', header={}) { var logindatac = new Object(); logindatac.redirect_uri = location.origin; logindatac.state = 'user'; + var checkin_depart_id = uni.getStorageSync('checkin_depart_id'); + if(checkin_depart_id){ + + } +) const pagesc = getCurrentPages(); const currentPagec = pagesc[pagesc.length - 1]; var pageUrlc = '/'+currentPagec.route; uni.setStorageSync('rebackPagePath', pageUrlc); - + var doctor_id = uni.getStorageSync('doctor_id'); req(getWxH5LoginConfigUri+'/?did='+doctor_id, logindatac, 'POST').then(data=>{ if(data == -1 || !data.authurl) return; @@ -326,7 +331,7 @@ function toPage(path){ url: path }); } - + }else{ if(path.indexOf('/index/index') == -1){ uni.navigateTo({ @@ -337,7 +342,7 @@ function toPage(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){ - var did = uni.getStorageSync('doctor_id') - if(!did) return; - uni.setStorageSync('uinfo_'+did, info) -} - + +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){ + var did = uni.getStorageSync('doctor_id') + if(!did) return; + uni.setStorageSync('uinfo_'+did, info) +} + //设置页main标题 function setTitlefFunc(title) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 6085543..539daef 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -134,42 +134,7 @@ 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:{ @@ -337,7 +302,7 @@ uni.setStorageSync('depart', JSON.stringify(hospital)) uni.setStorageSync('doctor_info', JSON.stringify(this.doctorInfo)) uni.navigateTo({ - url:"/pages/visitors/visitors?type=1" + url:"/pages/visitors/visitors?type=1&is_preview=1" }) }, toPrebookList(){ diff --git a/pages/visitors/visitors.vue b/pages/visitors/visitors.vue index 97df9a0..2c0ea36 100644 --- a/pages/visitors/visitors.vue +++ b/pages/visitors/visitors.vue @@ -4,16 +4,16 @@ {{hospital_depart_name}} - + 增加就诊人 - + {{item.name}} - 已预约今日 {{ item.visit_time.split('-')[0] }} 就诊 + 已预约今日 {{ item.visit_time.split('-')[0] }} 就诊 @@ -23,25 +23,24 @@ - - + 今日没有预约哦,请先预约时间 - + 返回 预约时间 - + 确认预约(已选{{selectCount}}位) 请确保预约就诊前在门诊先挂号 - + 确认以上患者已到(已选{{selectCount}}位) @@ -117,6 +116,9 @@ hasBaoDaoData:false, type:-1, pageshow:false, + is_preview:false, + doctorInfo:false, + hospitals:false, } }, components:{ @@ -138,7 +140,6 @@ uni.setStorageSync('visitor_type', this.type) - this.getVisitors() this.depart_id = uni.getStorageSync('depart_id') if(!this.depart_id && this.type == 1) { this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index') @@ -150,10 +151,11 @@ 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){ uni.setNavigationBarTitle({ title:'就诊人' @@ -162,7 +164,6 @@ uni.setNavigationBarTitle({ title:'确认报到' }) - this.getDepartInfo(); }else{ uni.setNavigationBarTitle({ title:'请选择就诊人' @@ -172,12 +173,49 @@ }, methods: { 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(){ uni.navigateTo({ - url:'/pages/visitors/visitors?type=1' + url:"/pages/visitors/visitors?type=1&is_preview=1" }) }, modifyVistor(visitor){ @@ -224,10 +262,17 @@ } }, 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 = [...this.visitUsers] this.popMsgs = [] + var popmsgIndex = 0 for (var i = 0; i < this.visitUsers.length; i++) { this.visitUsers[i].select = false @@ -241,15 +286,7 @@ this.popShowCancel = popinfo.popShowCancel 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 }); }, @@ -299,7 +336,7 @@ 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({ url:'/pages/waiting_method/waiting_method' }) diff --git a/pages/waiting_method/waiting_method.vue b/pages/waiting_method/waiting_method.vue index 9493ba5..ae124e4 100644 --- a/pages/waiting_method/waiting_method.vue +++ b/pages/waiting_method/waiting_method.vue @@ -17,7 +17,7 @@