1.修改ios. 不能定位

yj-dev
杨杰 3 years ago
parent fbd1cac020
commit cb857da6b4
  1. 2
      manifest.json
  2. 88
      pages/tabBar/home/home.vue

@ -87,7 +87,7 @@
}, },
"devServer" : { "devServer" : {
"port" : "", "port" : "",
"https" : false "https" : true
}, },
"domain" : "https://hsgcs.dctpay.com", "domain" : "https://hsgcs.dctpay.com",
"template" : "" "template" : ""

@ -265,7 +265,7 @@
methods: { methods: {
jumpcdx() { jumpcdx() {
location.href = 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() { getCmsContentcmsContent() {
@ -369,11 +369,11 @@
type: 'wgs84', type: 'wgs84',
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;
// that.findByLatAndLng(res.longitude, res.latitude);
// #ifdef H5 // #ifdef H5
that.getUserLocation(res.longitude, res.latitude); that.findByLatAndLng(res.longitude, res.latitude);
// that.getUserLocation(res.longitude, res.latitude);
//#endif //#endif
// #ifdef MP // #ifdef MP
uni.request({ 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) { findByLatAndLng(item, item1) {
let that = this; let that = this;
@ -449,13 +429,29 @@
.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 = '500100';
that.getCouponListArea(); if (res.return_data.result.addressComponent.adcode) {
that.getCouponListgold(); that.getCouponListArea();
uni.hideLoading(); that.getCouponListgold();
that.getCmsContent(); uni.hideLoading();
that.getCmsAactibity(); that.getCmsContent();
that.getCmsContentcmshome(); that.getCmsAactibity();
that.getCmsContentcmsContent(); 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.getCmsAactibity();
that.getCmsContentcmshome(); that.getCmsContentcmshome();
that.getCmsContentcmsContent(); that.getCmsContentcmsContent();
} }
uni.getStorage({ uni.getStorage({
key: 'accountType', key: 'accountType',
success(e) { success(e) {
if (e.data) { if (e.data) {
app.globalData.accountType = e.data; app.globalData.accountType = e.data;
if (e.data == '000000#/' && app.globalData.h5code) { if (e.data == '000000#/' && app.globalData.h5code) {
uni.navigateTo({ uni.navigateTo({
url: '../../goods/refuel-details/refuel-details' url: '../../goods/refuel-details/refuel-details'
}) })
} }
} }
} }
}) })
}) })

Loading…
Cancel
Save