diff --git a/main.js b/main.js index db8fc67..de58246 100644 --- a/main.js +++ b/main.js @@ -22,10 +22,10 @@ const NODE_ENV = 'development'; // const NODE_ENV = 'production'; if(NODE_ENV == 'development'){ Vue.prototype.cssUrl = '/static/images/frontend/'; - Vue.prototype.request_domain = "http://apizj.checkcopy.com/"; + Vue.prototype.request_domain = "http://api.checkcopy.com/"; }else{ Vue.prototype.cssUrl = '/static/images/frontend/'; - Vue.prototype.request_domain = "http://apizj.checkcopy.com/"; + Vue.prototype.request_domain = "http://api.yizherenxin.cn/"; } try{ @@ -174,9 +174,9 @@ if(Vue.prototype.provider == Vue.prototype.provider_weixin) { Vue.prototype.View = currentPageView+'New'; } -const CODE_SUCCESS = 2000; +const CODE_SUCCESS = 0; const CODE_ERROR = 40001; -const CODE_LOGIN_EXIPRE = 401; +const CODE_LOGIN_EXIPRE = 40002; Vue.prototype.user_preview = 1; Vue.prototype.edit_preview = 2; @@ -193,7 +193,7 @@ function req(url, data={}, method = 'POST', header={}) { data.appid = Vue.prototype.appid; data.xcx_scource = Vue.prototype.USER_SOURCE_WX_XCX; }else{ - domain = '/api/'; + domain = '/api/user/'; if(Vue.prototype.isMobile){ data.xcx_scource = Vue.prototype.USER_SOURCE_H5; if(Vue.prototype.env_val.indexOf('weixin') > -1) data.xcx_scource = Vue.prototype.USER_SOURCE_WX_H5; @@ -234,10 +234,11 @@ function req(url, data={}, method = 'POST', header={}) { const currentPagec = pagesc[pagesc.length - 1]; var pageUrlc = '/'+currentPagec.route; uni.setStorageSync('rebackPagePath', pageUrlc); - req(getWxH5LoginConfigUri, logindatac, 'GET').then(data=>{ - if(data == -1 || !data.user_authorize_url) return; - location.href = data.user_authorize_url; - }); + location.href = Vue.prototype.request_domain+'api/common/wxh5_login/?state=user' + // req(getWxH5LoginConfigUri, logindatac, 'GET').then(data=>{ + // if(data == -1 || !data.user_authorize_url) return; + // location.href = data.user_authorize_url; + // }); return; } diff --git a/manifest.json b/manifest.json index 45c83f4..befff9e 100644 --- a/manifest.json +++ b/manifest.json @@ -80,7 +80,7 @@ "disableHostCheck" : true, "proxy" : { "/api" : { - "target" : "http://apizj.checkcopy.com", + "target" : "http://api.checkcopy.com", "changeOrigin" : true, "secure" : false } diff --git a/pages/index/index.vue b/pages/index/index.vue index 75f53d7..ccfdf34 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,19 +3,19 @@ - {{doctorInfo.name}} + {{doctorInfo.doctor_info.name}} {{doctor_dept}} - - {{doctorInfo.brief}} + + {{doctorInfo.doctor_info.desc}} - + - + 医生简介 @@ -24,7 +24,7 @@ - {{doctorInfo.intro}} + {{doctorInfo.doctor_info.detail}} @@ -33,15 +33,15 @@ - {{item.hospital_name}} - + {{item.h_name}} + - - 出诊:{{item.visit_day_text}} + + 出诊:{{item.visit_times}} - + 导航 @@ -90,7 +90,8 @@ doctorInfo:false, doctor_dept:false, hospitals:false, - recentAppoint:[] + recentAppoint:[], + loginToken:false } }, components:{ @@ -99,24 +100,29 @@ }, onLoad(option) { if(option.code) this.code = option.code + if(option.token) { + this.loginToken = option.token + uni.setStorageSync('token', this.loginToken) + // var rebackPagePath = uni.getStorageSync('rebackPagePath') + // if(!rebackPagePath) + } }, onShow() { this.doctor_id = getApp().globalData.doctorId if(!this.doctor_id) return - var title = '李静医生预约就诊' + var title = '' if(this.code) title = '登录' uni.setNavigationBarTitle({ title:title }) - - var token = uni.getStorageSync('token') - if(this.code && !token) { - var rebackPagePath = uni.getStorageSync('rebackPagePath') - this.login() - return - } + // var token = uni.getStorageSync('token') + // if(this.code && !token) { + // var rebackPagePath = uni.getStorageSync('rebackPagePath') + // this.login() + // return + // } this.getDoctorInfo() }, methods: { @@ -125,18 +131,19 @@ uni.showActionSheet({ itemList: ['腾讯地图', '百度地图', '高德地图'], success: function (res) { - var lngLat = hospital.hospital_location.toString().split(',') + var lngLat = hospital.h_pos.toString().split(',') var lng = lngLat[0].toString() , lat = lngLat[1].toString() var baiduLngLat = that.qqMapTransBMap(lng, lat) var mapList = [ - 'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.hospital_name, - 'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.hospital_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo', - 'https://m.amap.com/share/index/lnglat='+hospital.hospital_location+'&name='+hospital.hospital_name+'&src=uriapi&innersrc=uriapi', + 'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.h_name, + 'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.h_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo', + 'https://m.amap.com/share/index/lnglat='+hospital.h_pos+'&name='+hospital.h_name+'&src=uriapi&innersrc=uriapi', ] console.log(mapList[res.tapIndex]) // return; + // return; location.href = mapList[res.tapIndex] }, fail: function (res) { @@ -144,33 +151,34 @@ }); }, login() { - this.$http.req('client/user/login', {code:this.code}, 'POST').then(data=>{ - if(data == -1) return - uni.setStorageSync('token', data.token) - var rebackPagePath = uni.getStorageSync('rebackPagePath') - if(rebackPagePath){ - uni.navigateTo({ - url:rebackPagePath - }) - } - }); + // this.$http.req('login', {code:this.code}, 'POST').then(data=>{ + // if(data == -1) return + // uni.setStorageSync('token', data.token) + // var rebackPagePath = uni.getStorageSync('rebackPagePath') + // if(rebackPagePath){ + // uni.navigateTo({ + // url:rebackPagePath + // }) + // } + // }); }, getDoctorInfo() { - this.$http.req('client/user/doctorpage/'+this.doctor_id, {}, 'GET').then(data=>{ + // if(this.loginToken) return; + + this.$http.req('index_info', {}, 'GET').then(data=>{ if(data == -1) return this.pageShow = true - this.keywords = data this.doctorInfo = data - if(this.doctorInfo.visit_hospital && this.doctorInfo.visit_hospital.length>0){ - this.doctor_dept = this.doctorInfo.visit_hospital[0].hospital_dept_name + if(this.doctorInfo.doctor_info && this.doctorInfo.doctor_info.depart_name.length>0){ + this.doctor_dept = this.doctorInfo.doctor_info.depart_name } - if(this.doctorInfo.visit_hospital && this.doctorInfo.visit_hospital.length>0){ - this.hospitals = this.doctorInfo.visit_hospital + if(this.doctorInfo.hospital_list && this.doctorInfo.hospital_list.length>0){ + this.hospitals = this.doctorInfo.hospital_list } - if(this.doctorInfo.appoint_record && this.doctorInfo.appoint_record.length>0){ - this.recentAppoint = this.doctorInfo.appoint_record + if(this.doctorInfo.appoint_list && this.doctorInfo.appoint_list.length>0){ + this.recentAppoint = this.doctorInfo.appoint_list } }); },