diff --git a/pages/supply_chains/supply_chains.vue b/pages/supply_chains/supply_chains.vue index 3035111..97e4d37 100644 --- a/pages/supply_chains/supply_chains.vue +++ b/pages/supply_chains/supply_chains.vue @@ -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