供应页面获取默认的云仓
This commit is contained in:
parent
1539e07755
commit
597531d9fe
@ -124,6 +124,7 @@
|
||||
this.street_id = LOCA.address_reference.town.id
|
||||
this.getCloudShopMerId(this.street_id)
|
||||
this.town = LOCA.address_component.street ?? ''
|
||||
this.currentLocation()
|
||||
},
|
||||
onShow() {},
|
||||
computed: mapGetters(['location']),
|
||||
@ -134,6 +135,36 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
currentLocation() {
|
||||
let self = this
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: (res) => {
|
||||
let latitude, longitude;
|
||||
latitude = res.latitude.toString();
|
||||
longitude = res.longitude.toString();
|
||||
this.latitude = res.latitude
|
||||
this.longitude = res.longitude
|
||||
getGeocoder({
|
||||
lat: latitude,
|
||||
long: longitude
|
||||
}).then(res => {
|
||||
this.locationArr = res.data
|
||||
this.locationArr.location_name = res.data.address_component.street
|
||||
get_cloud_shop(res.data.address_reference.town.id).then(re => {
|
||||
if(re.data.mer_id){
|
||||
this.mer_id = re.data.mer_id
|
||||
}
|
||||
})
|
||||
}).catch(err => Toast(err))
|
||||
|
||||
},
|
||||
fail: (err) => {
|
||||
Toast(err)
|
||||
},
|
||||
});
|
||||
|
||||
},
|
||||
selectPlce(e) {
|
||||
console.log("e", e);
|
||||
this.street_id = e.value[1].code
|
||||
|
Loading…
x
Reference in New Issue
Block a user