更新地图选择

This commit is contained in:
weipengfei 2023-11-24 18:46:37 +08:00
parent 102ee13e26
commit 167354a8da
6 changed files with 1059 additions and 971 deletions

View File

@ -14,7 +14,7 @@
</view>
<view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="place_wrapper flex_a_c" @click="changeMap">
<view class="iconfont icon-weizhi"></view>
<view class="town_name">{{street||'定位中' }}</view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop"
@ -618,6 +618,27 @@
}
// console.log(that.userInfoData);
});
},
//
changeMap(){
uni.navigateTo({
url: `/pages/select_address/select_address_n`,
success:()=> {
uni.$once('changeAddress', (e)=>{
// this.street_id = e.street.code;
// this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.$bus.$emit('value-updated', e.street.name + ',' + e.street.code);
})
}
})
}
}
};

View File

@ -30,7 +30,7 @@
</view>
<view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="place_wrapper flex_a_c" @click="changeMap">
<view class="iconfont icon-weizhi"></view>
<view class="town_name">{{ street||'定位中' }}</view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop" color="#fff"></uni-icons></view>
@ -846,6 +846,27 @@ export default {
}
}
// #endif
},
//
changeMap(){
uni.navigateTo({
url: `/pages/select_address/select_address_n`,
success:()=> {
uni.$once('changeAddress', (e)=>{
// this.street_id = e.street.code;
// this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.$bus.$emit('value-updated', e.street.name + ',' + e.street.code);
})
}
})
}
}
}

View File

@ -808,8 +808,14 @@
uni.$once('changeAddress', (e)=>{
this.street_id = e.street.code;
this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.getStoreList(true);
})
}

View File

@ -810,8 +810,14 @@
uni.$once('changeAddress', (e)=>{
this.street_id = e.street.code;
this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.getStoreList(true);
})
}

View File

@ -879,8 +879,14 @@
uni.$once('changeAddress', (e)=>{
this.street_id = e.street.code;
this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.storeMerchantList();
})
}

View File

@ -20,10 +20,11 @@
<view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb">
<view class="place_wrapper flex_a_c" @click="selectLocation">
<view class="place_wrapper flex_a_c" @click="changeMap">
<view class="iconfont icon-weizhi"></view>
<view class="town_name">{{street||'定位中' }}</view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop" color="#fff"></uni-icons></view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop"
color="#fff"></uni-icons></view>
</view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view>
@ -86,8 +87,7 @@
</view>
<view class="list-con">
<view class="list-con-left"
@tap="navgo('/pages/nongKe/specialty/index?type_code=TypeFamousSpecialties')">
<view class="list-con-left" @tap="navgo('/pages/nongKe/specialty/index?type_code=TypeFamousSpecialties')">
<!-- <view class="list-con-title">
<view class="con-titlea">
名优特产
@ -111,8 +111,7 @@
</view> -->
<image src="@/static/images/f7.png" mode="aspectFit"></image>
</view>
<view class="con-right"
@click="navgo('/pages/nongKe/tourism/index?type_code=TypeFeaturedCultural')">
<view class="con-right" @click="navgo('/pages/nongKe/tourism/index?type_code=TypeFeaturedCultural')">
<!-- <view class="list-con-title">
<view class="con-titlea">
特色文旅
@ -277,8 +276,7 @@
this.Area()
uni.stopPullDownRefresh()
},
onShow() {
},
onShow() {},
onLoad() {
this.Area()
// this.selfLocation()
@ -303,8 +301,7 @@
this.list(false, this.street_id);
this.productList2 = [];
}, 50)
}
else if (this.productList2.length > 0) {
} else if (this.productList2.length > 0) {
setTimeout(() => {
this.list2(false, '');
}, 50)
@ -639,8 +636,7 @@
icon: 'none'
})
})
}
else uni.getLocation({
} else uni.getLocation({
type: 'wgs84',
timeout: '10',
success: (res) => {
@ -693,7 +689,33 @@
}
});
},
//
changeMap() {
uni.navigateTo({
url: `/pages/select_address/select_address_n`,
success: () => {
uni.$once('changeAddress', (e) => {
this.street_id = e.street.code;
this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude;
this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.loadend = false;
this.loadend2 = false;
this.$set(this.where, 'page', 1)
this.$set(this.where2, 'page', 1)
this.$set(this, 'productList', []);
this.list(true, this.street_id)
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
})
}
})
}
}
@ -769,6 +791,7 @@
font-size: 20rpx;
color: #5a5a5a;
}
.locationx {
color: #000;
position: absolute;
@ -1154,18 +1177,22 @@
.goodslist {
margin: 0 auto;
width: 725rpx;
.no-more {
text-align: center;
padding-top: 18rpx;
}
.pictrue_tips {
color: $uni-nothing-text;
}
.common-hd {
display: flex;
align-items: center;
justify-content: center;
height: 118rpx;
.title {
padding: 0 80rpx;
font-size: 34rpx;
@ -1178,6 +1205,7 @@
}
}
}
.rotate-box {
transform: rotate(0deg);
transition: transform .5s ease-out;