更新地图选择

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>
<view class="" v-if="!isFshow"> <view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb"> <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="iconfont icon-weizhi"></view>
<view class="town_name">{{street||'定位中' }}</view> <view class="town_name">{{street||'定位中' }}</view>
<view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop" <view class="town_name rotate-box" @click.stop="getPositionFn()"><uni-icons type="loop"
@ -618,6 +618,27 @@
} }
// console.log(that.userInfoData); // 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>
<view class="" v-if="!isFshow"> <view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb"> <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="iconfont icon-weizhi"></view>
<view class="town_name">{{ street||'定位中' }}</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>
@ -846,6 +846,27 @@ export default {
} }
} }
// #endif // #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)=>{ uni.$once('changeAddress', (e)=>{
this.street_id = e.street.code; this.street_id = e.street.code;
this.street = e.street.name; this.street = e.street.name;
if (e.longitude) {
this.longitude = e.longitude; this.longitude = e.longitude;
this.latitude = e.latitude; this.latitude = e.latitude;
this.$store.commit('setLocation', {
lat: e.longitude,
long: e.latitude,
});
}
this.getStoreList(true); this.getStoreList(true);
}) })
} }

View File

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

View File

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

View File

@ -20,10 +20,11 @@
<view class="" v-if="!isFshow"> <view class="" v-if="!isFshow">
<view class="site-box1 flex_a_c_j_sb"> <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="iconfont icon-weizhi"></view>
<view class="town_name">{{street||'定位中' }}</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> </view>
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none"> <navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" style="color:#fff;"> </view> <view class="iconfont icon-xiaoxi" style="color:#fff;"> </view>
@ -86,8 +87,7 @@
</view> </view>
<view class="list-con"> <view class="list-con">
<view class="list-con-left" <view class="list-con-left" @tap="navgo('/pages/nongKe/specialty/index?type_code=TypeFamousSpecialties')">
@tap="navgo('/pages/nongKe/specialty/index?type_code=TypeFamousSpecialties')">
<!-- <view class="list-con-title"> <!-- <view class="list-con-title">
<view class="con-titlea"> <view class="con-titlea">
名优特产 名优特产
@ -111,8 +111,7 @@
</view> --> </view> -->
<image src="@/static/images/f7.png" mode="aspectFit"></image> <image src="@/static/images/f7.png" mode="aspectFit"></image>
</view> </view>
<view class="con-right" <view class="con-right" @click="navgo('/pages/nongKe/tourism/index?type_code=TypeFeaturedCultural')">
@click="navgo('/pages/nongKe/tourism/index?type_code=TypeFeaturedCultural')">
<!-- <view class="list-con-title"> <!-- <view class="list-con-title">
<view class="con-titlea"> <view class="con-titlea">
特色文旅 特色文旅
@ -277,8 +276,7 @@
this.Area() this.Area()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, },
onShow() { onShow() {},
},
onLoad() { onLoad() {
this.Area() this.Area()
// this.selfLocation() // this.selfLocation()
@ -303,8 +301,7 @@
this.list(false, this.street_id); this.list(false, this.street_id);
this.productList2 = []; this.productList2 = [];
}, 50) }, 50)
} } else if (this.productList2.length > 0) {
else if (this.productList2.length > 0) {
setTimeout(() => { setTimeout(() => {
this.list2(false, ''); this.list2(false, '');
}, 50) }, 50)
@ -639,8 +636,7 @@
icon: 'none' icon: 'none'
}) })
}) })
} } else uni.getLocation({
else uni.getLocation({
type: 'wgs84', type: 'wgs84',
timeout: '10', timeout: '10',
success: (res) => { 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; font-size: 20rpx;
color: #5a5a5a; color: #5a5a5a;
} }
.locationx { .locationx {
color: #000; color: #000;
position: absolute; position: absolute;
@ -1154,18 +1177,22 @@
.goodslist { .goodslist {
margin: 0 auto; margin: 0 auto;
width: 725rpx; width: 725rpx;
.no-more { .no-more {
text-align: center; text-align: center;
padding-top: 18rpx; padding-top: 18rpx;
} }
.pictrue_tips { .pictrue_tips {
color: $uni-nothing-text; color: $uni-nothing-text;
} }
.common-hd { .common-hd {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 118rpx; height: 118rpx;
.title { .title {
padding: 0 80rpx; padding: 0 80rpx;
font-size: 34rpx; font-size: 34rpx;
@ -1178,6 +1205,7 @@
} }
} }
} }
.rotate-box { .rotate-box {
transform: rotate(0deg); transform: rotate(0deg);
transition: transform .5s ease-out; transition: transform .5s ease-out;