@tplc/business 0.2.49 → 0.2.51
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 +27 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +4 -13
- package/components/lcb-city-select/lcb-city-select.vue +0 -1
- package/components/lcb-home-search/lcb-home-search.vue +6 -3
- package/hooks/useLocation.ts +6 -7
- package/package.json +1 -1
- package/types/hooks/useLocation.d.ts +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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.2.51](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.50...v0.2.51) (2025-01-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.2.47 ([47cc32b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/47cc32b906ccffb611a235174e92f6abc7a3f3da))
|
|
11
|
+
* **release:** 0.2.48 ([a5124e2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a5124e26342e7b2f597f1f3e187841fd975b5467))
|
|
12
|
+
* **release:** 0.2.49 ([0cf9dae](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0cf9dae889de78c64ac86bfc538a07dcce46ce39))
|
|
13
|
+
* **release:** 0.2.50 ([61b87b8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/61b87b87b7630c164c5603e2dfb98c393de7c744))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
* home-search cityName ([265572a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/265572a3c7b2dc5a9ff203129551df0ec2a6dd20))
|
|
19
|
+
* sheet city-select 调整底部 ([e048be0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e048be0036c72a7648a8434bdfa66fd570df3bf4))
|
|
20
|
+
* 修复问题 ([2c67644](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2c67644cc03e4f88b8e0f5aac2f8837c9317f7ec))
|
|
21
|
+
* 修复问题 ([1c9f269](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1c9f269c95b79e67abeec8af5b309d765069fd3a))
|
|
22
|
+
* 修改打包方式 ([9580a78](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9580a789d427c2db7e07c493c36f7f03258d1462))
|
|
23
|
+
* 处理地址字段切换 ([27dd10e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27dd10e9d609b88560dcb6671503035199e30d08))
|
|
24
|
+
|
|
25
|
+
### [0.2.50](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.49...v0.2.50) (2025-01-01)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### ✨ Features | 新功能
|
|
29
|
+
|
|
30
|
+
* 处理地址字段切换 ([27dd10e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/27dd10e9d609b88560dcb6671503035199e30d08))
|
|
31
|
+
|
|
5
32
|
### [0.2.49](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.48...v0.2.49) (2025-01-01)
|
|
6
33
|
|
|
7
34
|
|
|
@@ -71,28 +71,19 @@ const { getLocation, userLocation } = useLocation()
|
|
|
71
71
|
watch(
|
|
72
72
|
() => addressCity.value,
|
|
73
73
|
(val) => {
|
|
74
|
-
form
|
|
75
|
-
...form!.value,
|
|
76
|
-
cityId: val?.cityId,
|
|
77
|
-
}
|
|
74
|
+
if (val) form.value.cityId = val?.cityId
|
|
78
75
|
},
|
|
79
76
|
)
|
|
80
77
|
watch(
|
|
81
78
|
() => dayRange.value,
|
|
82
79
|
(val) => {
|
|
83
|
-
form
|
|
84
|
-
|
|
85
|
-
startDate: dayjs(val[0]).format('YYYY-MM-DD'),
|
|
86
|
-
endDate: dayjs(val[1]).format('YYYY-MM-DD'),
|
|
87
|
-
}
|
|
80
|
+
form.value.startDate = dayjs(val[0]).format('YYYY-MM-DD')
|
|
81
|
+
form.value.endDate = dayjs(val[1]).format('YYYY-MM-DD')
|
|
88
82
|
},
|
|
89
83
|
)
|
|
90
84
|
getLocation()
|
|
91
85
|
const onSearch = (e) => {
|
|
92
|
-
form.value =
|
|
93
|
-
...form.value,
|
|
94
|
-
keywords: e.detail.value,
|
|
95
|
-
}
|
|
86
|
+
form.value.keywords = e.target.value
|
|
96
87
|
}
|
|
97
88
|
</script>
|
|
98
89
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
:placeholder="placeholder"
|
|
53
53
|
v-model="form.keywords"
|
|
54
54
|
/>
|
|
55
|
-
<view class="justify-center flex flex-col items-center" @click="getLocation">
|
|
55
|
+
<view class="justify-center flex flex-col items-center" @click="getLocation(true)">
|
|
56
56
|
<wd-loading size="30rpx" v-if="locationIng" />
|
|
57
57
|
<img
|
|
58
58
|
class="w-30rpx h-30rpx"
|
|
@@ -144,7 +144,9 @@ const form = reactive({
|
|
|
144
144
|
keywords: '',
|
|
145
145
|
startDate: '',
|
|
146
146
|
endDate: '',
|
|
147
|
-
|
|
147
|
+
cityId: '',
|
|
148
|
+
addr: '',
|
|
149
|
+
cityName: '',
|
|
148
150
|
})
|
|
149
151
|
|
|
150
152
|
// 今天 明天 后天 周...
|
|
@@ -172,7 +174,8 @@ watchEffect(() => {
|
|
|
172
174
|
|
|
173
175
|
watchEffect(() => {
|
|
174
176
|
if (addressCity.value) {
|
|
175
|
-
form.
|
|
177
|
+
form.cityId = addressCity.value.cityId
|
|
178
|
+
form.addr = addressCity.value.addr
|
|
176
179
|
}
|
|
177
180
|
})
|
|
178
181
|
</script>
|
package/hooks/useLocation.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useTranslate } from '@tplc/wot'
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { getUserLocation, UserLocation } from './useLocation.api'
|
|
4
|
-
|
|
4
|
+
const currentLocation = ref<UserLocation>()
|
|
5
5
|
const useLocation = () => {
|
|
6
6
|
const { translate } = useTranslate()
|
|
7
|
-
const userLocation = ref<UserLocation>()
|
|
7
|
+
const userLocation = ref<UserLocation | undefined>(currentLocation.value)
|
|
8
8
|
// 正在获取经纬度
|
|
9
9
|
const locationIng = ref(false)
|
|
10
10
|
// 检查用户是否授权定位
|
|
@@ -41,22 +41,22 @@ const useLocation = () => {
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const getLocation = async () => {
|
|
44
|
+
const getLocation = async (force = false) => {
|
|
45
|
+
// 如果不是force并且当前位置有值,则不刷新
|
|
46
|
+
if (!force && currentLocation.value) return
|
|
45
47
|
if ((await checkLocationPermission()) !== false) {
|
|
46
48
|
locationIng.value = true
|
|
47
|
-
console.log('开始获取位置信息')
|
|
48
49
|
uni.getLocation({
|
|
49
50
|
// type: 'gcj02',
|
|
50
51
|
// type: 'wgs84',
|
|
51
52
|
success: function (res) {
|
|
52
|
-
console.log('当前位置的经度:' + res.longitude)
|
|
53
|
-
console.log('当前位置的纬度:' + res.latitude)
|
|
54
53
|
getUserLocation({
|
|
55
54
|
userLongitude: res.longitude.toString(),
|
|
56
55
|
userLatitude: res.latitude.toString(),
|
|
57
56
|
})
|
|
58
57
|
.then((res) => {
|
|
59
58
|
userLocation.value = res.data
|
|
59
|
+
currentLocation.value = res.data
|
|
60
60
|
})
|
|
61
61
|
.finally(() => {
|
|
62
62
|
locationIng.value = false
|
|
@@ -68,7 +68,6 @@ const useLocation = () => {
|
|
|
68
68
|
},
|
|
69
69
|
})
|
|
70
70
|
} else {
|
|
71
|
-
console.log('开始获取位2置信息')
|
|
72
71
|
navigateToSettings()
|
|
73
72
|
}
|
|
74
73
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { UserLocation } from './useLocation.api'
|
|
2
1
|
declare const useLocation: () => {
|
|
3
|
-
getLocation: () => Promise<void>
|
|
2
|
+
getLocation: (force?: boolean) => Promise<void>
|
|
4
3
|
locationIng: import('vue').Ref<boolean>
|
|
5
|
-
userLocation: import('vue').Ref<
|
|
4
|
+
userLocation: import('vue').Ref<
|
|
5
|
+
| {
|
|
6
|
+
addressInfo: string
|
|
7
|
+
cityId: string
|
|
8
|
+
cityName: string
|
|
9
|
+
}
|
|
10
|
+
| undefined
|
|
11
|
+
>
|
|
6
12
|
}
|
|
7
13
|
export default useLocation
|