diff --git a/pages.json b/pages.json index 268d0da..186da6c 100644 --- a/pages.json +++ b/pages.json @@ -10,12 +10,7 @@ "onReachBottomDistance": 50, "app-plus": { "titleNView": false, //禁用原生导航栏 - "softinputNavBar": "none", - "subNVues": [{ - "id": "homeTitleNvue", // 唯一标识 - "path": "pages/tabBar/home/subNvue/homeTitleNvue", // 页面路径 - "type": "navigationBar" - }] + "softinputNavBar": "none" } } }, { diff --git a/pages/goods/refuel/refuel.vue b/pages/goods/refuel/refuel.vue index ea767a7..de9aade 100644 --- a/pages/goods/refuel/refuel.vue +++ b/pages/goods/refuel/refuel.vue @@ -162,13 +162,7 @@ that.isTyAgent = true; } that.getGasStoreList(); - // uni.getLocation({ - // type: 'wgs84', - // success: function(res) { - // that.latitudeful = res.latitude; - // that.longitudeful = res.longitude; - // } - // }) + }, onReachBottom() { this.getGasStoreList(); diff --git a/pages/tabBar/category/category.vue b/pages/tabBar/category/category.vue index 84a65b2..ffbbc1b 100644 --- a/pages/tabBar/category/category.vue +++ b/pages/tabBar/category/category.vue @@ -73,7 +73,8 @@ import { getCouponList, getStoreListByMerchant, - getMerchantList + getMerchantList, + findByLatAndLng } from "../../../Utils/Api.js"; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; let app = getApp(); @@ -141,44 +142,39 @@ success: function(res) { app.globalData.latitude = res.latitude; app.globalData.longitude = res.longitude; - // #ifdef H5 - that.getUserLocation(res.longitude, res.latitude); - // #endif - // #ifdef MP - uni.request({ - url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + - ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', - data: {}, - success: function(res) { - that.city = res.data.result.address_component.city.replace(/市/g, - ''); - app.globalData.cityId = res.data.result.ad_info.adcode; - // app.globalData.cityId = '500100'; - that.getMerchantList(); - } - }) - // #endif + that.findByLatAndLng(res.longitude, res.latitude); + // uni.request({ + // url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + + // ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', + // data: {}, + // success: function(res) { + // that.city = res.data.result.address_component.city.replace(/市/g, + // ''); + // app.globalData.cityId = res.data.result.ad_info.adcode; + // // app.globalData.cityId = '500100'; + // that.getMerchantList(); + // } + // }) } }) }, //金纬度转 - getUserLocation(long, lat) { - let vm = this; - let url = - 'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1'; - let locationObj = lat + ',' + long; - this.$jsonp(url, { - key: '7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', - location: locationObj - }) - .then(res => { - vm.city = res.result.address_component.city.replace(/市/g, - ''); - app.globalData.cityId = res.result.ad_info.adcode; - vm.getMerchantList(); - }) - .catch(err => { - console.log(err); + findByLatAndLng(item, item1) { + let datas = { + lng: item, + lat: item1 + } + findByLatAndLng(datas).then(res => { + if (res.return_code == '000000') { + this.city = res.return_data.result.addressComponent.province; + app.globalData.cityName = res.return_data.result.addressComponent + .province; + app.globalData.cityId = res.return_data.result.addressComponent.adcode; + // app.globalData.cityId = '500100'; + if (res.return_data.result.addressComponent.adcode) { + this.getMerchantList(); + } + } }); }, // 商户列表 diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 8d82847..3a5bb55 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -370,39 +370,35 @@ success: function(res) { app.globalData.latitude = res.latitude; app.globalData.longitude = res.longitude; - - // #ifdef H5 + uni.hideLoading(); that.findByLatAndLng(res.longitude, res.latitude); // that.getUserLocation(res.longitude, res.latitude); - //#endif - // #ifdef MP - uni.request({ - url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + - ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', - data: {}, - success: function(res) { - // that.city = res.data.result.address_component.city.replace(/市/g, - // ''); - that.city = res.data.result.address_component.province; - app.globalData.cityName = res.data.result.address_component - .province; - app.globalData.cityId = res.data.result.ad_info.adcode; - uni.hideLoading(); - if (res.data.result.ad_info.adcode) { - that.getCouponListArea(); - that.getCouponListgold(); - that.getCmsContent(); - that.getCmsAactibity(); - that.getCmsContentcmshome(); - that.getCmsContentcmsContent(); - } - - }, - fail(err) { - uni.hideLoading() - } - }) - //#endif + // uni.request({ + // url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + + // ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', + // data: {}, + // success: function(res) { + // // that.city = res.data.result.address_component.city.replace(/市/g, + // // ''); + // that.city = res.data.result.address_component.province; + // app.globalData.cityName = res.data.result.address_component + // .province; + // app.globalData.cityId = res.data.result.ad_info.adcode; + // uni.hideLoading(); + // if (res.data.result.ad_info.adcode) { + // that.getCouponListArea(); + // that.getCouponListgold(); + // that.getCmsContent(); + // that.getCmsAactibity(); + // that.getCmsContentcmshome(); + // that.getCmsContentcmsContent(); + // } + + // }, + // fail(err) { + // uni.hideLoading() + // } + // }) }, fail: (err) => { if (err.errCode == 2) { @@ -428,16 +424,15 @@ app.globalData.cityName = res.return_data.result.addressComponent .province; app.globalData.cityId = res.return_data.result.addressComponent.adcode; - // app.globalData.cityId = '500100'; - if (res.return_data.result.addressComponent.adcode) { + app.globalData.cityId = '500103'; + // 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) {