gxd-uni-library-editx 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/mixins/locationMixins.js +31 -4
package/package.json
CHANGED
|
@@ -13,6 +13,13 @@ export default {
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
|
|
16
|
+
destroyed() {
|
|
17
|
+
if(this.timeoutLocationTime) {
|
|
18
|
+
clearTimeout(this.timeoutLocationTime)
|
|
19
|
+
this.timeoutLocationTime = null;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
|
|
16
23
|
methods: {
|
|
17
24
|
...mapActions(['getAllCityList']),
|
|
18
25
|
...mapActions('wxAuthorize', [
|
|
@@ -22,7 +29,13 @@ export default {
|
|
|
22
29
|
|
|
23
30
|
async getCityInfoByLocation(options, cb) {
|
|
24
31
|
try {
|
|
32
|
+
this.$xdLog.setProject('Layout.getCity.start.open.in', {
|
|
33
|
+
time: new Date().getTime(),
|
|
34
|
+
timeString: new Date().toLocaleString(),
|
|
35
|
+
...options
|
|
36
|
+
});
|
|
25
37
|
let locationInfo = await this.getLoadingCityInfoByLocationLv4(options);
|
|
38
|
+
storage.set('aaa_Layout.getCity.done',locationInfo)
|
|
26
39
|
this.$xdLog.setProject('Layout.getCity.done', {
|
|
27
40
|
time: new Date().getTime(),
|
|
28
41
|
timeString: new Date().toLocaleString(),
|
|
@@ -30,6 +43,7 @@ export default {
|
|
|
30
43
|
});
|
|
31
44
|
cb(locationInfo);
|
|
32
45
|
} catch (e) {
|
|
46
|
+
storage.set('aaa_Layout.getCity.fail',1)
|
|
33
47
|
this.$xdLog.setProject('Layout.getCity.fail', {
|
|
34
48
|
time: new Date().getTime(),
|
|
35
49
|
timeString: new Date().toLocaleString(),
|
|
@@ -39,8 +53,10 @@ export default {
|
|
|
39
53
|
}
|
|
40
54
|
},
|
|
41
55
|
|
|
42
|
-
setDefaultCityData(defaultCity){
|
|
43
|
-
|
|
56
|
+
setDefaultCityData(defaultCity, local){
|
|
57
|
+
if(!defaultCity.isDefault){
|
|
58
|
+
storage.set(this.currentLocationCity, defaultCity, .5);
|
|
59
|
+
}
|
|
44
60
|
//用户首次定位成功设置系统自动给用户选中一个城市
|
|
45
61
|
if (!storage.get(this.useSelectCity)) {
|
|
46
62
|
this.setCityInfo(defaultCity)
|
|
@@ -58,10 +74,16 @@ export default {
|
|
|
58
74
|
});
|
|
59
75
|
this.locationStatus = true;
|
|
60
76
|
this.timeoutLocationStatus = true;
|
|
61
|
-
},
|
|
77
|
+
}, 10000)
|
|
62
78
|
},
|
|
63
79
|
|
|
64
80
|
handleLocationDone(location) {
|
|
81
|
+
this.$xdLog.setProject('Layout.getCity.start', {
|
|
82
|
+
time: new Date().getTime(),
|
|
83
|
+
timeString: new Date().toLocaleString(),
|
|
84
|
+
statue:this.locationStatus,
|
|
85
|
+
...location
|
|
86
|
+
});
|
|
65
87
|
|
|
66
88
|
//从缓存定位到的城市
|
|
67
89
|
if(storage.get(this.currentLocationCity)) {
|
|
@@ -70,6 +92,11 @@ export default {
|
|
|
70
92
|
}
|
|
71
93
|
|
|
72
94
|
//通过接口获取定位城市信息
|
|
95
|
+
this.$xdLog.setProject('Layout.getCity.start.send', {
|
|
96
|
+
time: new Date().getTime(),
|
|
97
|
+
timeString: new Date().toLocaleString(),
|
|
98
|
+
});
|
|
99
|
+
|
|
73
100
|
this.getCityInfoByLocation(location, (res)=>{
|
|
74
101
|
if (this.timeoutLocationStatus) return;
|
|
75
102
|
this.setDefaultCityData(res.data);
|
|
@@ -77,12 +104,12 @@ export default {
|
|
|
77
104
|
time: new Date().getTime(),
|
|
78
105
|
timeString: new Date().toLocaleString(),
|
|
79
106
|
});
|
|
80
|
-
|
|
81
107
|
if(this.timeoutLocationTime) {
|
|
82
108
|
clearTimeout(this.timeoutLocationTime);
|
|
83
109
|
this.timeoutLocationTime = null;
|
|
84
110
|
this.timeoutLocationStatus = false;
|
|
85
111
|
}
|
|
112
|
+
|
|
86
113
|
this.locationStatus = true;
|
|
87
114
|
});
|
|
88
115
|
|