|
@@ -219,76 +219,48 @@
|
|
this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
|
|
this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
|
|
// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
|
|
// console.log("导航栏高度:"+this.globalData.navigationBarHeight)
|
|
// #endif
|
|
// #endif
|
|
- this.initLocation();
|
|
|
|
|
|
+ this.initLocation();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
initLocation() {
|
|
initLocation() {
|
|
let that = this;
|
|
let that = this;
|
|
this.$util.$L.getLocation().then(res => {
|
|
this.$util.$L.getLocation().then(res => {
|
|
const qqmapsdk = new QQMapWX({
|
|
const qqmapsdk = new QQMapWX({
|
|
- key: '7FJBZ-ACWCN-EFWFQ-SBXR5-QXC7K-LPF2U'
|
|
|
|
|
|
+ key: '7FJBZ-ACWCN-EFWFQ-SBXR5-QXC7K-LPF2U'
|
|
//key: '7FJBZ-ACWCN-EFWFQ-SBXR5-QXC7K-LPF2U'
|
|
//key: '7FJBZ-ACWCN-EFWFQ-SBXR5-QXC7K-LPF2U'
|
|
});
|
|
});
|
|
- qqmapsdk.reverseGeocoder({
|
|
|
|
- location: {
|
|
|
|
- latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
- longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
- },
|
|
|
|
- success: (res2) => {
|
|
|
|
- const address = res2.result.address; // 完整地址(如北京市海淀区中关村)
|
|
|
|
- const province = res2.result.ad_info.province; // 省份
|
|
|
|
- const city = res2.result.ad_info.city; // 城市
|
|
|
|
- const recommend = res2.result.address_reference.landmark_l2.title;; // 推荐使用的地址描述,描述精确性较高
|
|
|
|
- console.log('地址信息1:', res2);
|
|
|
|
- that.userAddress = recommend;
|
|
|
|
- getMerchantList({
|
|
|
|
- latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
- longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
- }).then(res => {
|
|
|
|
- that.merchantList = res.data.list;
|
|
|
|
- console.log('商品信息:', that.merchantList);
|
|
|
|
- });
|
|
|
|
- that.getHomeData();
|
|
|
|
- },
|
|
|
|
- fail: (err) => {
|
|
|
|
- console.error('逆地理编码失败:', err);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ qqmapsdk.reverseGeocoder({
|
|
|
|
+ location: {
|
|
|
|
+ latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
+ longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
+ },
|
|
|
|
+ success: (res2) => {
|
|
|
|
+ const address = res2.result.address; // 完整地址(如北京市海淀区中关村)
|
|
|
|
+ const province = res2.result.ad_info.province; // 省份
|
|
|
|
+ const city = res2.result.ad_info.city; // 城市
|
|
|
|
+ const recommend = res2.result.address_reference.landmark_l2.title;; // 推荐使用的地址描述,描述精确性较高
|
|
|
|
+ console.log('地址信息1:', res2);
|
|
|
|
+ that.userAddress = recommend;
|
|
|
|
+ getMerchantList({
|
|
|
|
+ latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
+ longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
+ }).then(res => {
|
|
|
|
+ that.merchantList = res.data.list;
|
|
|
|
+ console.log('商品信息:', that.merchantList);
|
|
|
|
+ });
|
|
|
|
+ that.getHomeData();
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.error('逆地理编码失败:', err);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
})
|
|
})
|
|
-
|
|
|
|
-
|
|
|
|
- // const qqmapsdk = new QQMapWX({
|
|
|
|
- // key: 'SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7'
|
|
|
|
- // //key: '7FJBZ-ACWCN-EFWFQ-SBXR5-QXC7K-LPF2U'
|
|
|
|
- // });
|
|
|
|
- // qqmapsdk.reverseGeocoder({
|
|
|
|
- // location: {
|
|
|
|
- // latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
- // longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
- // },
|
|
|
|
- // success: (res2) => {
|
|
|
|
- // const address = res2.result.address; // 完整地址(如北京市海淀区中关村)
|
|
|
|
- // const province = res2.result.ad_info.province; // 省份
|
|
|
|
- // const city = res2.result.ad_info.city; // 城市
|
|
|
|
- // const recommend = res2.result.address_reference.landmark_l2.title;; // 推荐使用的地址描述,描述精确性较高
|
|
|
|
- // console.log('地址信息1:', res2);
|
|
|
|
- // that.userAddress = recommend;
|
|
|
|
- // getMerchantList({
|
|
|
|
- // latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
- // longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
- // }).then(res => {
|
|
|
|
- // that.merchantList = res.data.list;
|
|
|
|
- // console.log('商品信息:', that.merchantList);
|
|
|
|
- // });
|
|
|
|
- // that.getHomeData();
|
|
|
|
- // },
|
|
|
|
- // fail: (err) => {
|
|
|
|
- // console.error('逆地理编码失败:', err);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
getHomeData() {
|
|
getHomeData() {
|
|
- getHomeInfo().then(res => {
|
|
|
|
|
|
+ getHomeInfo({
|
|
|
|
+ latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
+ longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
+ }).then(res => {
|
|
this.bannerList = res.data.banner;
|
|
this.bannerList = res.data.banner;
|
|
this.proList = res.data.proList;
|
|
this.proList = res.data.proList;
|
|
console.log(this.proList)
|
|
console.log(this.proList)
|
|
@@ -302,7 +274,7 @@
|
|
})
|
|
})
|
|
// this.messageList = [{"id":2,"title":"绿草地活动大促,消费满三十减十五"},{"id":3,"title":"绿草地活动大促,消费满三十减十五33333"}];
|
|
// this.messageList = [{"id":2,"title":"绿草地活动大促,消费满三十减十五"},{"id":3,"title":"绿草地活动大促,消费满三十减十五33333"}];
|
|
console.log("this.messageList--", this.messageList)
|
|
console.log("this.messageList--", this.messageList)
|
|
- this.startScroll();
|
|
|
|
|
|
+ // this.startScroll();
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|