diff --git a/App.vue b/App.vue index 0fbe8c1..81c60bd 100644 --- a/App.vue +++ b/App.vue @@ -55,7 +55,16 @@ }); }, - onShow: function() { + onShow: function(e) { + console.log(e.query.code) + if(e && e.query.code){ //h5微信公众号登录返回的code + let code = e.query.code + this.$queue.setData('wxCode', code); + } + if(e && e.query.latng){ //h5公众号地图选点返回的经纬度 + this.$queue.setData('latH', e.query.latng.split(',')[0]); + this.$queue.setData('lngH', e.query.latng.split(',')[1]); + } }, onHide: function() {} }; diff --git a/common/config.js b/common/config.js index abd7d86..11d164b 100644 --- a/common/config.js +++ b/common/config.js @@ -1,6 +1,6 @@ // const ROOTPATH1 = "http://10.11.32.109:8891/sqx_fast"; -const ROOTPATH1 = "http://10.11.32.107:8891/sqx_fast"; -// const ROOTPATH1 = "http://waimai.n.gznl.top/sqx_fast"; +// const ROOTPATH1 = "http://10.11.32.107:8891/sqx_fast"; +const ROOTPATH1 = "http://waimai.admin.service.yiqihuiju.com/sqx_fast"; const ROOTPATH = "https://bwc.xianmxkj.com/sqx_fast"; module.exports = { APIHOST: ROOTPATH, diff --git a/main.js b/main.js index a232aa8..b0461d8 100644 --- a/main.js +++ b/main.js @@ -27,6 +27,8 @@ Vue.config.productionTip = false Vue.prototype.$Request = HttpRequest; Vue.prototype.$queue = queue; +Vue.prototype.$WechatUrl = 'http://waimai.admin.service.yiqihuiju.com'; + Vue.prototype.$Sysconf = HttpRequest.config; Vue.prototype.$SysCache = HttpCache; Vue.mixin(share) diff --git a/manifest.json b/manifest.json index 589de20..38a65bf 100644 --- a/manifest.json +++ b/manifest.json @@ -166,7 +166,7 @@ }, "h5" : { "title" : "惠聚", - "domain" : "https://bwc.xianmxkj.com", + "domain" : "http://waimai.admin.service.yiqihuiju.com", "router" : { "mode" : "history" }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 2df0d39..39e4bb7 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,7 +4,7 @@ - {{ city }} + {{ localCampus }} @@ -134,9 +134,6 @@ }, onLoad(e) { let that = this; - // #ifdef H5 - that.initMyPosition(); - // #endif if (e.userByinvitationId) { this.$queue.setData('userByinvitationId', e.userByinvitationId); } @@ -215,6 +212,7 @@ let that = this; var city = this.$queue.getData('city'); var localCampus = this.$queue.getData('localCampus'); + console.log(localCampus) if (city && localCampus) { console.log(city) this.latitude = this.$queue.getData('latitude'); @@ -225,6 +223,10 @@ this.page = 1; this.getHaoDianTuiJian1(); this.getHaoDianTuiJian(); + } else{ + // #ifdef H5 + that.initMyPosition(); + // #endif } let userId = this.$queue.getData('userId'); @@ -506,12 +508,14 @@ }, //微信公众号获取地理位置 wxGetLocation(){ + var that = this; var pageUrl = encodeURIComponent(window.location.href); jweixin.wxGetLocation(pageUrl).then((result)=>{ let str = `output=jsonp&location=${result.latitude},${result.longitude}&key=LH3BZ-NYN62-2SIUW-CGKY5-K5MXT-FWFOI` this.$jsonp('https://apis.map.qq.com/ws/geocoder/v1/?'+str).then(res=>{ uni.hideLoading(); if(res.status == 0){ + console.log(res) that.setLocation(result.latitude, result.longitude, res) } }) @@ -699,7 +703,7 @@ }); //#endif //#ifdef H5 - window.location.href = 'http://waimai.n.gznl.top/sqx_fast/appLogin/wechatLogin'; + window.location.href = this.$WechatUrl + '/sqx_fast/appLogin/wechatLogin'; //#endif }, navClick: function(res) { diff --git a/pages/index/selectCampus.vue b/pages/index/selectCampus.vue index ef3c368..465bf91 100644 --- a/pages/index/selectCampus.vue +++ b/pages/index/selectCampus.vue @@ -28,6 +28,7 @@