|
|
@@ -402,11 +402,10 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
// 授权
|
|
|
getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.getLocation();
|
|
|
- });
|
|
|
+ this.getLocation();
|
|
|
});
|
|
|
// 获取会员属性
|
|
|
this.getStoreCategoryList();
|
|
|
@@ -435,19 +434,25 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
initData() {
|
|
|
- getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 }).then((res) => {
|
|
|
- if (res.status == 0 && res.result) {
|
|
|
- let result = res.result;
|
|
|
- this.fromData.cityNameOld = result.ad_info.city;
|
|
|
- this.fromData.districtNameOld = result.ad_info.district;
|
|
|
- let addresses = result.formatted_addresses; // 描述性地址
|
|
|
- if (addresses) {
|
|
|
- this.fromData.addressLine = addresses.recommend;
|
|
|
- localStorage.setItem('locationRemark', addresses.recommend);
|
|
|
+ getGeocoder({ latitude: this.location.lat1, longitude: this.location.lon1 })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status == 0 && res.result) {
|
|
|
+ let result = res.result;
|
|
|
+ this.fromData.cityNameOld = result.ad_info.city;
|
|
|
+ this.fromData.districtNameOld = result.ad_info.district;
|
|
|
+ let addresses = result.formatted_addresses; // 描述性地址
|
|
|
+ if (addresses) {
|
|
|
+ this.fromData.addressLine = addresses.recommend;
|
|
|
+ localStorage.setItem('locationRemark', addresses.recommend);
|
|
|
+ }
|
|
|
+ // this.beforeAddFn();
|
|
|
+ } else {
|
|
|
+ this.toastLoading().clear();
|
|
|
}
|
|
|
- // this.beforeAddFn();
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ });
|
|
|
},
|
|
|
moreTypeShowfn() {
|
|
|
this.chainsData = [];
|