Style(首页):去掉定位授权服务
This commit is contained in:
@@ -306,7 +306,6 @@
|
||||
<script>
|
||||
import {mapActions, mapGetters} from 'vuex';
|
||||
import {formatDateTime} from "@/utils";
|
||||
import config from '@/utils/mapConfig';
|
||||
|
||||
import PromotionGood from '@/components/PromotionGood';
|
||||
import CouponWindow from '@/components/CouponWindow';
|
||||
@@ -523,8 +522,6 @@ export default {
|
||||
this.getUnreadMsgList();
|
||||
}
|
||||
|
||||
//定位
|
||||
this.getCurAddress();
|
||||
this.init();
|
||||
//获取团购商品
|
||||
this.getGroupGoods();
|
||||
@@ -671,74 +668,6 @@ export default {
|
||||
msgConfirm: function () {
|
||||
that.$refs.popup.close();
|
||||
},
|
||||
//获取当前定位地址
|
||||
getCurAddress() {
|
||||
let that = this;
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
success: function (res) {
|
||||
let latitude = res.latitude;
|
||||
let longitude = res.longitude;
|
||||
|
||||
that.setLocation({
|
||||
'latitude': latitude + '',
|
||||
'longitude': longitude + ''
|
||||
});
|
||||
|
||||
// #ifdef H5
|
||||
Vue.jsonp(
|
||||
'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' +
|
||||
longitude + '&key=' +
|
||||
config.key, {
|
||||
//callbackName: 'QQmap',
|
||||
output: 'jsonp',
|
||||
}).then(json => {
|
||||
// Success.
|
||||
// uni.hideLoading();
|
||||
that.cityName = json.result.ad_info.city;
|
||||
//定位成功刷新数据
|
||||
//if (that.activeIndex==0) {
|
||||
that.getHotelList();
|
||||
that.getShopList();
|
||||
that.getRestaurantList();
|
||||
//}
|
||||
|
||||
}).catch(err => {
|
||||
// Failed.
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
uni.request({
|
||||
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + latitude + ',' +
|
||||
longitude +
|
||||
'&key=' + config.key,
|
||||
success: function (res) {
|
||||
const address = res.data.result.ad_info
|
||||
that.cityName = address.city;
|
||||
let location = address.province + address.city + address.district;
|
||||
uni.setStorageSync("location", location)
|
||||
|
||||
//定位成功刷新数据
|
||||
//if (that.activeIndex==0) {
|
||||
that.getHotelList();
|
||||
that.getShopList();
|
||||
that.getRestaurantList();
|
||||
//}
|
||||
|
||||
},
|
||||
fail: function (res) {
|
||||
},
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log("home getCurAddress", err)
|
||||
}
|
||||
});
|
||||
},
|
||||
getHotelList: function () {
|
||||
let that = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user