diff --git a/App.vue b/App.vue index d9c57c2..47b65e0 100644 --- a/App.vue +++ b/App.vue @@ -5,14 +5,13 @@ doctoridStorageKey:'doctor_id' }, onLaunch: function(option) { - console.log(option,'option===='); + console.log(option, 'option===='); var did = false // #ifdef H5 try { const pathParts = location.pathname.split('/'); const paramIndex = pathParts.indexOf('did'); - if(paramIndex !== -1 && paramIndex + 1 < pathParts.length) { did = pathParts[paramIndex + 1] } @@ -32,8 +31,14 @@ params[pair[0]] = pair[1]; } }); - if(params['depart_id']) did = params['depart_id']; - option.query.logintype = params['logintype']; + + if(params['d']) { + did = params['d']; + } + if(params['dp']) option.query.depart_id = params['dp']; + if(params['t']) option.query.type = params['t']; + if(params['c']) option.query.checkin = params['c']; + if(params['logintype']) option.query.logintype = params['logintype']; uni.clearStorageSync() } // #endif @@ -57,7 +62,7 @@ // #ifdef MP-WEIXIN uni.showModal({ - title: '请扫描小程序二维码进入', + title: '请扫描小程序二维码或点击小程序链接进入', content: '', showCancel: false, success: ({ confirm, cancel }) => {} diff --git a/pages/visitors/visitors.vue b/pages/visitors/visitors.vue index c98ff09..c976c00 100644 --- a/pages/visitors/visitors.vue +++ b/pages/visitors/visitors.vue @@ -119,6 +119,21 @@ pop }, onLoad(option) { + if(option.scene) { + var scene = decodeURIComponent(option.scene) + var params = {}; + scene.split('&').forEach(item => { + var pair = item.split('='); + if (pair.length === 2) { + params[pair[0]] = pair[1]; + } + }); + + if(params['dp']) option.depart_id = params['dp']; + if(params['t']) option.type = params['t']; + if(params['c']) option.checkin = params['c']; + } + var depart_info = uni.getStorageSync('depart') if(depart_info) { depart_info = JSON.parse(depart_info) @@ -138,7 +153,7 @@ this.depart_id = uni.getStorageSync('depart_id') if(!this.depart_id && this.type == 1) { - this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index') + this.$pop.modelShow('请先选择要预约的医院科室!', '/pages/index/index') return } @@ -190,7 +205,7 @@ }) if(!hospital || Object.keys(hospital).length === 0) { - this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index') + this.$pop.modelShow('请先选择要预约的医院科室~', '/pages/index/index') return }