1.修改ios. 不能定位

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

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

@ -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() {
@ -371,9 +371,9 @@
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
// that.findByLatAndLng(res.longitude, res.latitude);
// #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'
})
}
}
}
})
}
});
},

Loading…
Cancel
Save