邓洁 : 地图接口
This commit is contained in:
@@ -3,18 +3,13 @@
|
||||
<InputAndSwiper type='0' :bannerURL="swiperList"></InputAndSwiper>
|
||||
<view class="home-content">
|
||||
<view class="service">
|
||||
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx"/>
|
||||
<button
|
||||
open-type="contact"
|
||||
bindcontact="handleContact"
|
||||
session-from="sessionFrom"
|
||||
class="service-btn"
|
||||
>
|
||||
</button>
|
||||
<u-image src="/static/statistics/sy_icon_lxkf.png" width="108rpx" height="108rpx" />
|
||||
<button open-type="contact" bindcontact="handleContact" session-from="sessionFrom" class="service-btn">
|
||||
</button>
|
||||
</view>
|
||||
<HomeNavCard></HomeNavCard>
|
||||
<HomeNoticeBar :text="notice" />
|
||||
<Statistics :statNum="statNum"/>
|
||||
<Statistics :statNum="statNum" />
|
||||
<view class="show-and-search">
|
||||
<view class="show-tab list-tab" :class="{ 'tab-activate': chooseIndex === 0 }" @click="this.chooseIndex=0">
|
||||
<text>店铺列表</text>
|
||||
@@ -46,7 +41,7 @@
|
||||
notice: [],
|
||||
chooseIndex: 0,
|
||||
statNum: {},
|
||||
swiperList:[]
|
||||
swiperList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -56,18 +51,18 @@
|
||||
this.open()
|
||||
},
|
||||
methods: {
|
||||
getBanner(){
|
||||
this.$api.getBanner().then(res=>{
|
||||
this.swiperList = res.data.data.map(item=>this.$api.imgUrl+item.img)
|
||||
getBanner() {
|
||||
this.$api.getBanner().then(res => {
|
||||
this.swiperList = res.data.data.map(item => this.$api.imgUrl + item.img)
|
||||
})
|
||||
},
|
||||
getNotice(){
|
||||
this.$api.getHotInfo().then(res=>{
|
||||
this.notice = res.data.data.map(item=>item.title)
|
||||
getNotice() {
|
||||
this.$api.getHotInfo().then(res => {
|
||||
this.notice = res.data.data.map(item => item.title)
|
||||
})
|
||||
},
|
||||
getStat(){
|
||||
this.$api.getStat().then(res=>{
|
||||
getStat() {
|
||||
this.$api.getStat().then(res => {
|
||||
this.statNum = res.data.data
|
||||
console.log(res.data.data);
|
||||
})
|
||||
@@ -95,6 +90,8 @@
|
||||
success(res) {
|
||||
console.log('res.latitude', res.latitude);
|
||||
console.log('res.longitude', res.longitude);
|
||||
uni.setStorageSync('latitude', res.latitude);
|
||||
uni.setStorageSync('longitude', res.longitude);
|
||||
qqmapsdk.reverseGeocoder({
|
||||
location: {
|
||||
latitude: res.latitude,
|
||||
@@ -106,7 +103,7 @@
|
||||
console.log(re.result.ad_info.district);
|
||||
let city = re.result.ad_info.city
|
||||
let district = re.result.ad_info.district
|
||||
console.log('city-code',re.result.ad_info.city_code.substring(3));
|
||||
console.log('city-code', re.result.ad_info.city_code.substring(3));
|
||||
uni.setStorageSync('city_code', re.result.ad_info.city_code.substring(3));
|
||||
uni.setStorageSync('city', city.slice(0, 2));
|
||||
uni.setStorageSync('district', district);
|
||||
@@ -127,11 +124,11 @@
|
||||
open() {
|
||||
var that = this
|
||||
uni.getSetting({
|
||||
success: function (res) {
|
||||
if (res.authSetting['scope.userFuzzyLocation']) {
|
||||
console.log('用户已经授权定位权限');
|
||||
} else {
|
||||
console.log('用户未授权定位权限');
|
||||
success: function(res) {
|
||||
if (res.authSetting['scope.userFuzzyLocation']) {
|
||||
console.log('用户已经授权定位权限');
|
||||
} else {
|
||||
console.log('用户未授权定位权限');
|
||||
uni.authorize({
|
||||
scope: 'scope.userFuzzyLocation',
|
||||
success: function() {
|
||||
@@ -161,8 +158,8 @@
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -176,11 +173,13 @@
|
||||
|
||||
.home-content {
|
||||
margin: 0 10px;
|
||||
|
||||
.service {
|
||||
position: fixed;
|
||||
right: 17rpx;
|
||||
top: 1109rpx;
|
||||
z-index: 1;
|
||||
|
||||
.service-btn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -189,6 +188,7 @@
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
}
|
||||
|
||||
.service-btn::after {
|
||||
border: none;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user