Merge branch '5月27日-一键加油分支' into dev

yj-dev
杨杰 2 years ago
commit 6d2d61e8b0
  1. 7
      pages.json
  2. 8
      pages/goods/refuel/refuel.vue
  3. 66
      pages/tabBar/category/category.vue
  4. 63
      pages/tabBar/home/home.vue

@ -10,12 +10,7 @@
"onReachBottomDistance": 50, "onReachBottomDistance": 50,
"app-plus": { "app-plus": {
"titleNView": false, // "titleNView": false, //
"softinputNavBar": "none", "softinputNavBar": "none"
"subNVues": [{
"id": "homeTitleNvue", //
"path": "pages/tabBar/home/subNvue/homeTitleNvue", //
"type": "navigationBar"
}]
} }
} }
}, { }, {

@ -162,13 +162,7 @@
that.isTyAgent = true; that.isTyAgent = true;
} }
that.getGasStoreList(); that.getGasStoreList();
// uni.getLocation({
// type: 'wgs84',
// success: function(res) {
// that.latitudeful = res.latitude;
// that.longitudeful = res.longitude;
// }
// })
}, },
onReachBottom() { onReachBottom() {
this.getGasStoreList(); this.getGasStoreList();

@ -73,7 +73,8 @@
import { import {
getCouponList, getCouponList,
getStoreListByMerchant, getStoreListByMerchant,
getMerchantList getMerchantList,
findByLatAndLng
} from "../../../Utils/Api.js"; } from "../../../Utils/Api.js";
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp(); let app = getApp();
@ -141,44 +142,39 @@
success: function(res) { success: function(res) {
app.globalData.latitude = res.latitude; app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude; app.globalData.longitude = res.longitude;
// #ifdef H5 that.findByLatAndLng(res.longitude, res.latitude);
that.getUserLocation(res.longitude, res.latitude); // uni.request({
// #endif // url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude +
// #ifdef MP // ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB',
uni.request({ // data: {},
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + // success: function(res) {
',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', // that.city = res.data.result.address_component.city.replace(//g,
data: {}, // '');
success: function(res) { // app.globalData.cityId = res.data.result.ad_info.adcode;
that.city = res.data.result.address_component.city.replace(/市/g, // // app.globalData.cityId = '500100';
''); // that.getMerchantList();
app.globalData.cityId = res.data.result.ad_info.adcode; // }
// app.globalData.cityId = '500100'; // })
that.getMerchantList();
}
})
// #endif
} }
}) })
}, },
// //
getUserLocation(long, lat) { findByLatAndLng(item, item1) {
let vm = this; let datas = {
let url = lng: item,
'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1'; lat: item1
let locationObj = lat + ',' + long; }
this.$jsonp(url, { findByLatAndLng(datas).then(res => {
key: '7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', if (res.return_code == '000000') {
location: locationObj this.city = res.return_data.result.addressComponent.province;
}) app.globalData.cityName = res.return_data.result.addressComponent
.then(res => { .province;
vm.city = res.result.address_component.city.replace(/市/g, app.globalData.cityId = res.return_data.result.addressComponent.adcode;
''); // app.globalData.cityId = '500100';
app.globalData.cityId = res.result.ad_info.adcode; if (res.return_data.result.addressComponent.adcode) {
vm.getMerchantList(); this.getMerchantList();
}) }
.catch(err => { }
console.log(err);
}); });
}, },
// //

@ -370,39 +370,35 @@
success: function(res) { success: function(res) {
app.globalData.latitude = res.latitude; app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude; app.globalData.longitude = res.longitude;
uni.hideLoading();
// #ifdef H5
that.findByLatAndLng(res.longitude, res.latitude); that.findByLatAndLng(res.longitude, res.latitude);
// that.getUserLocation(res.longitude, res.latitude); // that.getUserLocation(res.longitude, res.latitude);
//#endif // uni.request({
// #ifdef MP // url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude +
uni.request({ // ',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB',
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude + // data: {},
',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB', // success: function(res) {
data: {}, // // that.city = res.data.result.address_component.city.replace(//g,
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
that.city = res.data.result.address_component.province; // .province;
app.globalData.cityName = res.data.result.address_component // app.globalData.cityId = res.data.result.ad_info.adcode;
.province; // uni.hideLoading();
app.globalData.cityId = res.data.result.ad_info.adcode; // if (res.data.result.ad_info.adcode) {
uni.hideLoading(); // that.getCouponListArea();
if (res.data.result.ad_info.adcode) { // that.getCouponListgold();
that.getCouponListArea(); // that.getCmsContent();
that.getCouponListgold(); // that.getCmsAactibity();
that.getCmsContent(); // that.getCmsContentcmshome();
that.getCmsAactibity(); // that.getCmsContentcmsContent();
that.getCmsContentcmshome(); // }
that.getCmsContentcmsContent();
}
}, // },
fail(err) { // fail(err) {
uni.hideLoading() // uni.hideLoading()
} // }
}) // })
//#endif
}, },
fail: (err) => { fail: (err) => {
if (err.errCode == 2) { if (err.errCode == 2) {
@ -428,16 +424,15 @@
app.globalData.cityName = res.return_data.result.addressComponent app.globalData.cityName = res.return_data.result.addressComponent
.province; .province;
app.globalData.cityId = res.return_data.result.addressComponent.adcode; app.globalData.cityId = res.return_data.result.addressComponent.adcode;
// app.globalData.cityId = '500100'; app.globalData.cityId = '500103';
if (res.return_data.result.addressComponent.adcode) { // if (res.return_data.result.addressComponent.adcode) {
that.getCouponListArea(); that.getCouponListArea();
that.getCouponListgold(); that.getCouponListgold();
uni.hideLoading();
that.getCmsContent(); that.getCmsContent();
that.getCmsAactibity(); that.getCmsAactibity();
that.getCmsContentcmshome(); that.getCmsContentcmshome();
that.getCmsContentcmsContent(); that.getCmsContentcmsContent();
} // }
uni.getStorage({ uni.getStorage({
key: 'accountType', key: 'accountType',
success(e) { success(e) {

Loading…
Cancel
Save