diff --git a/pages/index/index.vue b/pages/index/index.vue index 5ee6b4c..8d2d7ea 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -122,14 +122,6 @@ preBookList, }, onLoad(option) { - // define('DEPART_TYPE_FULL', 0); // 全功能 - // define('DEPART_TYPE_COUNT', 1); // 仅计数 - // define('DEPART_TYPE_CARD', 2); // 仅名片 - // $GLOBALS['depart_type_list'] = array( - // DEPART_TYPE_FULL => '全功能', - // DEPART_TYPE_COUNT => '仅计数', - // DEPART_TYPE_CARD => '仅名片' - // ); if(option.code && option.state) { this.code = option.code this.state = option.state @@ -301,6 +293,12 @@ lat: lats } } + }, + onShareAppMessage() { + return { + title: this.doctorInfo.doctor_info.doctor_name + '的预约挂号', + path: '/pages/index/index?did='+this.doctor_id + } } } diff --git a/pages/prebook/prebook.vue b/pages/prebook/prebook.vue index 84c60a8..a4647d9 100644 --- a/pages/prebook/prebook.vue +++ b/pages/prebook/prebook.vue @@ -27,7 +27,7 @@ 医生姓名: - {{doctorInfo.doctor_info.doctor_name}} + {{doctor_name}} 就诊医院: @@ -64,30 +64,41 @@ departId:false, depart:false, visitor_ids:false, + checkin:false, + doctor_name:'' } }, components:{ Book, SliderBox }, + onLoad(option) { + if(option.checkin) this.checkin = true + }, onShow() { - var activeVisitors = uni.getStorageSync('active_visitors') - if(!activeVisitors){ - this.$func.toPage('/pages/index/index') - return - } - - this.activeVisitors = JSON.parse(activeVisitors) this.departId = uni.getStorageSync('depart_id') this.depart = uni.getStorageSync('depart') var doctorInfo = uni.getStorageSync('doctor_info') + + var redi_path = '/pages/index/index' + if(this.departId && this.checkin) redi_path = "/pages/visitors/visitors?type=3&depart_id="+this.departId if(!doctorInfo){ - this.$pop.modelShow('请先选择要预约的医生', '/pages/index/index') + this.$pop.modelShow('请先选择要预约的医生', redi_path) return } + + var activeVisitors = uni.getStorageSync('active_visitors') + if(!activeVisitors){ + this.$func.toPage(redi_path) + return + } + this.activeVisitors = JSON.parse(activeVisitors) + this.doctorInfo = JSON.parse(doctorInfo) + this.doctor_name = this.doctorInfo.doctor_info.doctor_name + if(!this.departId && this.depart) { - this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index') + this.$pop.modelShow('请先选择要预约的医院科室', redi_path) return } this.depart = JSON.parse(this.depart) @@ -120,7 +131,11 @@ times:false, success() { setTimeout(function(){ - that.$nav.navToPath("/pages/prebook_list/prebook_list") + if(that.checkin) { + that.$nav.navToPath("/pages/visitors/visitors?type=3&depart_id="+that.departId) + }else{ + that.$nav.navToPath("/pages/prebook_list/prebook_list") + } }, 1500) } }) diff --git a/pages/visitors/visitors.vue b/pages/visitors/visitors.vue index ec23bba..c98ff09 100644 --- a/pages/visitors/visitors.vue +++ b/pages/visitors/visitors.vue @@ -112,6 +112,7 @@ is_preview:false, doctorInfo:false, hospitals:false, + checkin:false, } }, components:{ @@ -131,6 +132,8 @@ if(type) this.type = type } + if(option.checkin) this.checkin = true + uni.setStorageSync('visitor_type', this.type) this.depart_id = uni.getStorageSync('depart_id') @@ -207,7 +210,7 @@ }); }, appointTime(){ - this.$nav.navToPath("/pages/visitors/visitors?type=1&is_preview=1") + this.$nav.navToPath("/pages/visitors/visitors?type=1&is_preview=1&checkin=1") }, modifyVistor(visitor){ uni.setStorageSync('visitor_info_'+visitor.id, JSON.stringify(visitor)) @@ -325,7 +328,9 @@ return } // 预约人员 - this.$nav.navToPath("/pages/prebook/prebook") + var prebook = "/pages/prebook/prebook" + if(this.checkin) prebook = prebook+'?checkin=1' + this.$nav.navToPath(prebook) } }