diff --git a/config/app.js b/config/app.js
index de0c7f8..9bfd4f2 100644
--- a/config/app.js
+++ b/config/app.js
@@ -10,8 +10,8 @@ let httpApiFour
let httpApiFive
// 在打包之前请检查当前环境是否正确
-// const env = 'dev'; // 开发
-const env = 'prod'; // 生产
+const env = 'dev'; // 开发
+// const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {
diff --git a/pages/gather/gather.vue b/pages/gather/gather.vue
index 827e325..ea5cd3e 100644
--- a/pages/gather/gather.vue
+++ b/pages/gather/gather.vue
@@ -16,7 +16,8 @@
- {{ street }}
+ {{street||'定位中' }}
+
@@ -65,7 +66,11 @@
-
+
+ 位置权限使用说明
+ 用于向你推荐最近门店
+ x
+
@@ -162,6 +162,7 @@
位置权限使用说明
用于向你推荐最近门店
+ x
@@ -369,6 +370,8 @@ export default {
},
methods: {
getPositionFn() {
+ this.street = '定位中'
+ this.$store.commit('setLocation', {lat: null, long: null})
uni.removeStorageSync('RejectTarget')
this.selfLocation()
@@ -673,6 +676,8 @@ export default {
},
selfLocation() {
+ console.log(uni.getStorageSync('RejectTarget'), 6666, uni.getStorageSync('RejectTarget'));
+ if (uni.getStorageSync('RejectTarget')) return;
if (uni.getStorageSync('loction') == true) {
this.isshow = false
@@ -680,18 +685,47 @@ export default {
this.isshow = true
uni.setStorageSync('loction', true);
}
- console.log(uni.getStorageSync('RejectTarget'), 6666)
-
- if (uni.getStorageSync('RejectTarget')) return
- uni.getLocation({
+ if(this.$store.state.storage.location.lat){
+ console.log('定位失败');
+ this.isshow = false
+ let latitude, longitude;
+ latitude = this.$store.state.storage.location.lat.toString();
+ longitude = this.$store.state.storage.location.long.toString();
+ getGeocoder({
+ lat: latitude,
+ long: longitude
+ }).then(res => {
+ console.log(res);
+ let town = res.data.address_reference.town.title
+ let street_id = res.data.address_reference.town.id
+ this.street = res.data.address_reference.town.title
+ this.$nextTick(() => {
+ this.$bus.$emit('value-updated', this.street + ',' +
+ street_id);
+
+ })
+ }).catch(err => {
+ console.log(err);
+ this.isshow = false
+ uni.showToast({
+ title: err,
+ icon: 'none'
+ })
+ })
+ }
+ else uni.getLocation({
type: 'wgs84',
timeout: '1000',
success: (res) => {
-
+ console.log('定位成功', res);
this.isshow = false
let latitude, longitude;
latitude = res.latitude.toString();
longitude = res.longitude.toString();
+ this.$store.commit('setLocation', {
+ lat: res.latitude.toFixed(6),
+ long: res.longitude.toFixed(6),
+ });
getGeocoder({
lat: latitude,
long: longitude
@@ -699,8 +733,7 @@ export default {
let town = res.data.address_reference.town.title
let street_id = res.data.address_reference.town.id
- this.street = res.data.address_component.street
-
+ this.street = res.data.address_reference.town.title
this.$nextTick(() => {
this.$bus.$emit('value-updated', this.street + ',' +
street_id);
@@ -712,13 +745,16 @@ export default {
title: err,
icon: 'none'
})
+ this.street = '定位失败'
})
},
fail: (err) => {
- // console.log("决绝")
+ console.log(err);
uni.setStorageSync("RejectTarget", true)
this.isshow = false
-
+ this.street = '定位失败'
+ Toast('定位失败,请检查定位权限是否开启')
+
}
});
},
@@ -857,6 +893,13 @@ page {
font-size: 20rpx;
color: #5a5a5a;
}
+
+ .locationx{
+ color: #000;
+ position: absolute;
+ top: 10rpx;
+ right: 20rpx;
+ }
}
.Circle_friends {
@@ -1386,4 +1429,12 @@ page {
}
}
}
+.rotate-box {
+ transform: rotate(0deg);
+ transition: transform .5s ease-out;
+}
+
+.rotate-box:active {
+ transform: rotate(360deg);
+}
diff --git a/pages/supply_chains/supply_chains.vue b/pages/supply_chains/supply_chains.vue
index d461c46..4afe60e 100644
--- a/pages/supply_chains/supply_chains.vue
+++ b/pages/supply_chains/supply_chains.vue
@@ -22,7 +22,8 @@
- {{street}}
+ {{street||'定位中' }}
+
@@ -153,8 +154,9 @@
- 位置权限使用说明
- 用于向你推荐最近门店
+ 位置权限使用说明
+ 用于向你推荐最近门店
+ x