@tplc/business 0.3.40 → 0.3.41
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.3.41](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.40...v0.3.41) (2025-02-12)
|
|
6
|
+
|
|
5
7
|
### [0.3.40](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.39...v0.3.40) (2025-02-12)
|
|
6
8
|
|
|
7
9
|
### [0.3.39](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.38...v0.3.39) (2025-02-12)
|
|
@@ -77,24 +77,15 @@ watch(
|
|
|
77
77
|
(val) => {
|
|
78
78
|
if (val) {
|
|
79
79
|
form.value.cityId = val?.cityId
|
|
80
|
+
form.value.userLatitude = userLatLon.value?.latitude
|
|
81
|
+
form.value.userLongitude = userLatLon.value?.longitude
|
|
80
82
|
if (val.keywords) {
|
|
81
83
|
form.value.keywords = val.keywords
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
},
|
|
85
87
|
)
|
|
86
|
-
|
|
87
|
-
() => userLatLon.value,
|
|
88
|
-
(val) => {
|
|
89
|
-
if (!val) return
|
|
90
|
-
form.value.userLatitude = val.latitude
|
|
91
|
-
form.value.userLongitude = val.longitude
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
immediate: true,
|
|
95
|
-
deep: true,
|
|
96
|
-
},
|
|
97
|
-
)
|
|
88
|
+
|
|
98
89
|
watch(
|
|
99
90
|
() => dayRange.value,
|
|
100
91
|
(val) => {
|
package/hooks/useLocation.ts
CHANGED
|
@@ -5,8 +5,6 @@ const currentLocation = ref<UserLocation>()
|
|
|
5
5
|
const currentUserLatLon = ref<UniApp.GetLocationSuccess>()
|
|
6
6
|
const useLocation = () => {
|
|
7
7
|
const { translate } = useTranslate()
|
|
8
|
-
const userLocation = ref(currentLocation.value)
|
|
9
|
-
const userLatLon = ref(currentUserLatLon.value)
|
|
10
8
|
// 正在获取经纬度
|
|
11
9
|
const locationIng = ref(false)
|
|
12
10
|
// 检查用户是否授权定位
|
|
@@ -58,13 +56,12 @@ const useLocation = () => {
|
|
|
58
56
|
// type: 'gcj02',
|
|
59
57
|
// type: 'wgs84',
|
|
60
58
|
success: function (res) {
|
|
61
|
-
|
|
59
|
+
currentUserLatLon.value = res
|
|
62
60
|
getUserLocation({
|
|
63
61
|
userLongitude: res.longitude.toString(),
|
|
64
62
|
userLatitude: res.latitude.toString(),
|
|
65
63
|
})
|
|
66
64
|
.then((res) => {
|
|
67
|
-
userLocation.value = res.data
|
|
68
65
|
currentLocation.value = res.data
|
|
69
66
|
})
|
|
70
67
|
.finally(() => {
|
|
@@ -80,7 +77,7 @@ const useLocation = () => {
|
|
|
80
77
|
navigateToSettings()
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
|
-
return { getLocation, locationIng, userLocation, userLatLon }
|
|
80
|
+
return { getLocation, locationIng, userLocation: currentLocation, userLatLon: currentUserLatLon }
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
export default useLocation
|
package/package.json
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
+
import { UserLocation } from './useLocation.api'
|
|
1
2
|
declare const useLocation: () => {
|
|
2
3
|
getLocation: (force?: boolean) => Promise<void>
|
|
3
4
|
locationIng: import('vue').Ref<boolean>
|
|
4
|
-
userLocation: import('vue').Ref<
|
|
5
|
-
|
|
6
|
-
addressInfo: string
|
|
7
|
-
cityId: string
|
|
8
|
-
cityName: string
|
|
9
|
-
haveNotCityId: string
|
|
10
|
-
haveNotCityName: string
|
|
11
|
-
haveNotAddressInfo: string
|
|
12
|
-
haveNotTip: string
|
|
13
|
-
}
|
|
14
|
-
| undefined
|
|
15
|
-
>
|
|
16
|
-
userLatLon: import('vue').Ref<
|
|
17
|
-
| {
|
|
18
|
-
latitude: number
|
|
19
|
-
longitude: number
|
|
20
|
-
speed: number
|
|
21
|
-
accuracy: number
|
|
22
|
-
altitude: number
|
|
23
|
-
verticalAccuracy: number
|
|
24
|
-
horizontalAccuracy: number
|
|
25
|
-
address?: any
|
|
26
|
-
errMsg?: string | undefined
|
|
27
|
-
}
|
|
28
|
-
| undefined
|
|
29
|
-
>
|
|
5
|
+
userLocation: import('vue').Ref<UserLocation | undefined>
|
|
6
|
+
userLatLon: import('vue').Ref<UniApp.GetLocationSuccess | undefined>
|
|
30
7
|
}
|
|
31
8
|
export default useLocation
|