diff --git a/manifest.json b/manifest.json index 3683510..0f1b78e 100644 --- a/manifest.json +++ b/manifest.json @@ -87,7 +87,7 @@ }, "devServer" : { "port" : "", - "https" : false + "https" : true }, "domain" : "https://hsgcs.dctpay.com", "template" : "" diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 221c55a..8d82847 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -265,7 +265,7 @@ methods: { jumpcdx() { location.href = - 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; + 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; }, //获取首页功能 getCmsContentcmsContent() { @@ -369,11 +369,11 @@ type: 'wgs84', success: function(res) { app.globalData.latitude = res.latitude; - app.globalData.longitude = res.longitude; - - // that.findByLatAndLng(res.longitude, res.latitude); + app.globalData.longitude = res.longitude; + // #ifdef H5 - that.getUserLocation(res.longitude, res.latitude); + that.findByLatAndLng(res.longitude, res.latitude); + // that.getUserLocation(res.longitude, res.latitude); //#endif // #ifdef MP uni.request({ @@ -415,26 +415,6 @@ } }) }, - //H5 获取定位 - getCoordinates() { - let that = this; - // 获取当前地理位置信息 - let data = { - key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //密钥,需要在腾讯位置服务官网(https://lbs.qq.com/)申请自己的密钥。 - }; - let url = "https://apis.map.qq.com/ws/location/v1/ip"; //地理位置信息接口(根据IP自动获取当前城市位置信息) - data.output = "jsonp"; - //判断用户是否输入了搜索关键字,若没有输入搜索关键字则调用根据IP自动获取当前城市位置信息的接口。 - this.$jsonp(url, data) - .then(res => { - app.globalData.latitude = res.result.location.lat; - app.globalData.longitude = res.result.location.lng; - that.getUserLocation(res.result.location.lng, res.result.location.lat); - }) - .catch(error => { - console.log(error); - }); - }, //经纬度转换 findByLatAndLng(item, item1) { let that = this; @@ -449,13 +429,29 @@ .province; app.globalData.cityId = res.return_data.result.addressComponent.adcode; // app.globalData.cityId = '500100'; - that.getCouponListArea(); - that.getCouponListgold(); - uni.hideLoading(); - that.getCmsContent(); - that.getCmsAactibity(); - that.getCmsContentcmshome(); - that.getCmsContentcmsContent(); + if (res.return_data.result.addressComponent.adcode) { + that.getCouponListArea(); + that.getCouponListgold(); + uni.hideLoading(); + that.getCmsContent(); + that.getCmsAactibity(); + that.getCmsContentcmshome(); + that.getCmsContentcmsContent(); + } + uni.getStorage({ + key: 'accountType', + success(e) { + if (e.data) { + app.globalData.accountType = e.data; + if (e.data == '000000#/' && app.globalData.h5code) { + uni.navigateTo({ + url: '../../goods/refuel-details/refuel-details' + }) + } + + } + } + }) } }); }, @@ -506,20 +502,20 @@ that.getCmsAactibity(); that.getCmsContentcmshome(); that.getCmsContentcmsContent(); - } - uni.getStorage({ - key: 'accountType', - success(e) { - if (e.data) { - app.globalData.accountType = e.data; - if (e.data == '000000#/' && app.globalData.h5code) { - uni.navigateTo({ - url: '../../goods/refuel-details/refuel-details' - }) - } - - } - } + } + uni.getStorage({ + key: 'accountType', + success(e) { + if (e.data) { + app.globalData.accountType = e.data; + if (e.data == '000000#/' && app.globalData.h5code) { + uni.navigateTo({ + url: '../../goods/refuel-details/refuel-details' + }) + } + + } + } }) })