修改代码,不请求方法之间写死 qqmap_key的值
This commit is contained in:
parent
53d09262c2
commit
184ed7feab
@ -39,23 +39,26 @@
|
|||||||
this.address = uni.getStorageSync('city');
|
this.address = uni.getStorageSync('city');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.request({
|
this.qqmap_key = '55NBZ-MUQYW-EAJRL-YIWPA-ZXCR6-4NBPP';
|
||||||
url: apiArr.get_host_info,
|
this.getUserLocation()
|
||||||
method: 'post',
|
|
||||||
header: {
|
|
||||||
'Content-type': 'application/x-www-form-urlencoded'
|
|
||||||
},
|
|
||||||
dataType: 'json',
|
|
||||||
success: (result) => {
|
|
||||||
console.log(result, 'result');
|
|
||||||
let wxapp = result.data.all.wxapp;
|
|
||||||
|
|
||||||
if (wxapp) {
|
// uni.request({
|
||||||
this.qqmap_key = wxapp.qqmap_key;
|
// url: apiArr.get_host_info,
|
||||||
this.getUserLocation()
|
// method: 'post',
|
||||||
}
|
// header: {
|
||||||
},
|
// 'Content-type': 'application/x-www-form-urlencoded'
|
||||||
})
|
// },
|
||||||
|
// dataType: 'json',
|
||||||
|
// success: (result) => {
|
||||||
|
// console.log(result, 'result');
|
||||||
|
// let wxapp = result.data.all.wxapp;
|
||||||
|
|
||||||
|
// if (wxapp) {
|
||||||
|
// this.qqmap_key = wxapp.qqmap_key;
|
||||||
|
// this.getUserLocation()
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
|
|
||||||
getUserLocation() {
|
getUserLocation() {
|
||||||
|
|||||||
@ -104,7 +104,7 @@
|
|||||||
<view class="serverList_left">
|
<view class="serverList_left">
|
||||||
<swiper>
|
<swiper>
|
||||||
<swiper-item v-for="(item, index) in homeLeftList" :key="index" @click="headerServerClick(item)">
|
<swiper-item v-for="(item, index) in homeLeftList" :key="index" @click="headerServerClick(item)">
|
||||||
<image :src="item.pic_src" alt=""/>
|
<image :src="item.pic_src" alt="" />
|
||||||
<!-- <view>{{ item.ad_position }}</view> -->
|
<!-- <view>{{ item.ad_position }}</view> -->
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
@ -403,22 +403,24 @@ export default {
|
|||||||
title: '加载中',
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
});
|
});
|
||||||
uni.request({
|
this.qqmap_key = '55NBZ-MUQYW-EAJRL-YIWPA-ZXCR6-4NBPP';
|
||||||
url: apiArr.get_host_info,
|
this.getUserLocation()
|
||||||
method: 'POST',
|
// uni.request({
|
||||||
header: {
|
// url: apiArr.get_host_info,
|
||||||
'Content-type': 'application/x-www-form-urlencoded'
|
// method: 'POST',
|
||||||
},
|
// header: {
|
||||||
dataType: 'json',
|
// 'Content-type': 'application/x-www-form-urlencoded'
|
||||||
success: (result) => {
|
// },
|
||||||
let wxapp = result.data.all.wxapp;
|
// dataType: 'json',
|
||||||
if (wxapp) {
|
// success: (result) => {
|
||||||
this.qqmap_key = wxapp.qqmap_key;
|
// let wxapp = result.data.all.wxapp;
|
||||||
// 获取当前地址信息
|
// if (wxapp) {
|
||||||
this.getUserLocation();
|
// this.qqmap_key = wxapp.qqmap_key;
|
||||||
}
|
// // 获取当前地址信息
|
||||||
}
|
// this.getUserLocation();
|
||||||
});
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user