@tplc/business 0.3.68 → 0.3.70
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 +28 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +3 -1
- package/components/lcb-city-select/api/index.ts +2 -0
- package/components/lcb-city-select/components/lcb-city-letter/index.vue +2 -0
- package/components/lcb-city-select/components/lcb-city-list/index.vue +3 -3
- package/components/lcb-city-select/lcb-city-select.vue +4 -1
- package/components/lcb-home-search/lcb-home-search.vue +4 -1
- package/components/lcb-list/lcb-list.vue +0 -1
- package/hooks/useLocation.api.ts +2 -0
- package/package.json +1 -1
- package/types/components/lcb-city-select/api/index.d.ts +2 -0
- package/types/hooks/useLocation.api.d.ts +2 -0
- package/types/utils/history.d.ts +5 -0
- package/utils/history.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.70](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.66...v0.3.70) (2025-03-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
9
|
+
|
|
10
|
+
* 修改字段颜色 ([e661df9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e661df917517b5231129b428ade7fbc32208782e))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
14
|
+
|
|
15
|
+
* **release:** 0.3.67 ([a7841dd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a7841dd76cee8116f83b8a995edceffc78552507))
|
|
16
|
+
* **release:** 0.3.68 ([b9aba5e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b9aba5e9313f999bed6daccd9adcebf9231f2001))
|
|
17
|
+
* **release:** 0.3.69 ([bd4b5d7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bd4b5d79b5a2d92c4c88a42059f4bf2ef593597c))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ✨ Features | 新功能
|
|
21
|
+
|
|
22
|
+
* 修改图片策略 ([471609c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/471609ca404f2b2d9a8930fca81c2376b30a3ffa))
|
|
23
|
+
* 文字颜色改为黑色 ([ca34cf9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ca34cf962b6f9c886c0ba4bf5f8151b986908f78))
|
|
24
|
+
* 调整城市 ([0d04291](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0d0429144c4f6a468faa178513ecbda2bcc48ee9))
|
|
25
|
+
|
|
26
|
+
### [0.3.69](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.68...v0.3.69) (2025-03-05)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### ✨ Features | 新功能
|
|
30
|
+
|
|
31
|
+
* 文字颜色改为黑色 ([ca34cf9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ca34cf962b6f9c886c0ba4bf5f8151b986908f78))
|
|
32
|
+
|
|
5
33
|
### [0.3.68](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.67...v0.3.68) (2025-03-02)
|
|
6
34
|
|
|
7
35
|
|
|
@@ -46,6 +46,7 @@ import { inject, onMounted, Ref, ref, watch } from 'vue'
|
|
|
46
46
|
import { LcbCalendarSearchProps } from './types'
|
|
47
47
|
import { LcbAddress } from '../lcb-city-select/api'
|
|
48
48
|
import { FORM_KEY } from '../../constants'
|
|
49
|
+
import { getHistoryCity } from '../../utils/history'
|
|
49
50
|
defineOptions({
|
|
50
51
|
name: 'LcbCalendarSearch',
|
|
51
52
|
options: {
|
|
@@ -63,7 +64,7 @@ withDefaults(defineProps<LcbCalendarSearchProps>(), {
|
|
|
63
64
|
|
|
64
65
|
const form = inject(FORM_KEY) as Ref<Record<string, any>>
|
|
65
66
|
const addressCity = ref<LcbAddress | undefined>(
|
|
66
|
-
form.value.cityId ?
|
|
67
|
+
(form.value.cityId || form.value.areaId ? form.value : getHistoryCity()) as LcbAddress,
|
|
67
68
|
)
|
|
68
69
|
const dayRange = ref([
|
|
69
70
|
form.value.startDate ? dayjs(form.value.startDate).valueOf() : dayjs().valueOf(),
|
|
@@ -77,6 +78,7 @@ watch(
|
|
|
77
78
|
(val) => {
|
|
78
79
|
if (val) {
|
|
79
80
|
form.value.cityId = val?.cityId
|
|
81
|
+
form.value.areaId = val?.areaId
|
|
80
82
|
if (val.keywords) {
|
|
81
83
|
form.value.keywords = val.keywords
|
|
82
84
|
}
|
|
@@ -18,6 +18,7 @@ export interface ChildHotAddress {
|
|
|
18
18
|
keywords?: string
|
|
19
19
|
className?: string
|
|
20
20
|
cityId: string
|
|
21
|
+
areaId: string
|
|
21
22
|
longitude?: string
|
|
22
23
|
weightSort?: string
|
|
23
24
|
addressInfo?: string
|
|
@@ -29,6 +30,7 @@ export interface LcbAddress {
|
|
|
29
30
|
categoryName: string
|
|
30
31
|
keywords?: string
|
|
31
32
|
cityId: string
|
|
33
|
+
areaId: string
|
|
32
34
|
hotAddressId: string
|
|
33
35
|
provinceCityName: string
|
|
34
36
|
area: string
|
|
@@ -92,11 +92,13 @@ const locationAddress = computed<HotAddress[]>(() => {
|
|
|
92
92
|
{
|
|
93
93
|
addr: props.location.haveNotCityName || props.location.cityName,
|
|
94
94
|
cityId: props.location.haveNotCityId || props.location.cityId,
|
|
95
|
+
areaId: props.location.areaId,
|
|
95
96
|
icon: 'location',
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
addr: props.location.haveNotAddressInfo || props.location.addressInfo,
|
|
99
100
|
cityId: props.location.haveNotCityId || props.location.cityId,
|
|
101
|
+
areaId: props.location.areaId,
|
|
100
102
|
className: 'w-25',
|
|
101
103
|
},
|
|
102
104
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="p-3 box-border h-full overflow-y-auto pt-0">
|
|
3
|
-
<view v-for="item in list" :key="item.cityId" @click="onItemClick(item)">
|
|
3
|
+
<view v-for="item in list" :key="item.areaId || item.cityId" @click="onItemClick(item)">
|
|
4
4
|
<view class="flex mt-3">
|
|
5
5
|
<view class="tag">{{ item.categoryName }}</view>
|
|
6
6
|
<view class="content">
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<view class="flex gap-2 flex-wrap">
|
|
19
19
|
<view
|
|
20
20
|
v-for="item in historyList"
|
|
21
|
-
:key="item.cityId"
|
|
21
|
+
:key="item.areaId || item.cityId"
|
|
22
22
|
@click="emits('click', item)"
|
|
23
23
|
class="history-tag"
|
|
24
24
|
>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup lang="ts">
|
|
41
|
-
import { inject, Ref
|
|
41
|
+
import { inject, Ref } from 'vue'
|
|
42
42
|
import { LcbAddress } from '../../api'
|
|
43
43
|
import { LcbCityListProps } from './types'
|
|
44
44
|
|
|
@@ -65,6 +65,7 @@ import LcbCityLetter from './components/lcb-city-letter/index.vue'
|
|
|
65
65
|
import LcbCityList from './components/lcb-city-list/index.vue'
|
|
66
66
|
import { LcbCitySelectProps } from './types'
|
|
67
67
|
import { debounce } from '@tplc/wot/components/common/util'
|
|
68
|
+
import { setHistoryCity } from '../../utils/history'
|
|
68
69
|
defineOptions({
|
|
69
70
|
name: 'LcbCitySelect',
|
|
70
71
|
options: {
|
|
@@ -103,6 +104,7 @@ const onAddressClick = (item: LcbAddress) => {
|
|
|
103
104
|
// url: `/pages/residentialHotel/index?${qs.stringify(item)}`,
|
|
104
105
|
// })
|
|
105
106
|
// }
|
|
107
|
+
setHistoryCity(item as ChildHotAddress)
|
|
106
108
|
onCancel()
|
|
107
109
|
show.value = false
|
|
108
110
|
}
|
|
@@ -112,8 +114,9 @@ watch(
|
|
|
112
114
|
if (val && !modelValue.value) {
|
|
113
115
|
modelValue.value = {
|
|
114
116
|
addressInfo: val.addressInfo,
|
|
115
|
-
addr: val.cityName,
|
|
117
|
+
addr: val.showName || val.cityName,
|
|
116
118
|
cityId: val.cityId,
|
|
119
|
+
areaId: val.areaId,
|
|
117
120
|
} as ChildHotAddress
|
|
118
121
|
}
|
|
119
122
|
},
|
|
@@ -113,10 +113,11 @@ import useLocation from '../../hooks/useLocation'
|
|
|
113
113
|
import { useTranslate } from '@tplc/wot'
|
|
114
114
|
import { ChildHotAddress } from '../lcb-city-select/api'
|
|
115
115
|
import { stringify } from 'qs'
|
|
116
|
+
import { getHistoryCity } from '../../utils/history'
|
|
116
117
|
const dayRange = ref([dayjs().valueOf(), dayjs().add(1, 'day').valueOf()])
|
|
117
118
|
const { translate } = useTranslate()
|
|
118
119
|
const { getLocation, userLocation, locationIng } = useLocation()
|
|
119
|
-
const addressCity = ref<ChildHotAddress>()
|
|
120
|
+
const addressCity = ref<ChildHotAddress | undefined>(getHistoryCity())
|
|
120
121
|
getLocation()
|
|
121
122
|
const nightCount = computed(() => {
|
|
122
123
|
return dayjs(dayRange.value[1]).diff(dayRange.value[0], 'day')
|
|
@@ -144,6 +145,7 @@ const form = reactive({
|
|
|
144
145
|
startDate: '',
|
|
145
146
|
endDate: '',
|
|
146
147
|
cityId: '',
|
|
148
|
+
areaId: '',
|
|
147
149
|
addr: '',
|
|
148
150
|
cityName: '',
|
|
149
151
|
})
|
|
@@ -174,6 +176,7 @@ watchEffect(() => {
|
|
|
174
176
|
watchEffect(() => {
|
|
175
177
|
if (addressCity.value) {
|
|
176
178
|
form.cityId = addressCity.value.cityId
|
|
179
|
+
form.areaId = addressCity.value.areaId
|
|
177
180
|
form.addr = addressCity.value.addr
|
|
178
181
|
if (addressCity.value.keywords) {
|
|
179
182
|
form.keywords = addressCity.value.keywords
|
|
@@ -81,7 +81,6 @@ defineOptions({
|
|
|
81
81
|
const titleObj = ref<Record<string, any>>({})
|
|
82
82
|
const form = inject<Ref<Record<string, any>>>(FORM_KEY)
|
|
83
83
|
const props = withDefaults(defineProps<LcbListProps>(), {
|
|
84
|
-
pageFilterType: 'hotelTravelFilter',
|
|
85
84
|
borderRadius: 12,
|
|
86
85
|
styleMode: 'default',
|
|
87
86
|
listType: 'list',
|
package/hooks/useLocation.api.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export interface UserLocation {
|
|
2
2
|
addressInfo: string
|
|
3
3
|
cityId: string
|
|
4
|
+
areaId: string
|
|
4
5
|
cityName: string
|
|
5
6
|
haveNotCityId: string
|
|
6
7
|
haveNotCityName: string
|
|
7
8
|
haveNotAddressInfo: string
|
|
8
9
|
haveNotTip: string
|
|
10
|
+
showName: string
|
|
9
11
|
}
|
|
10
12
|
export const getUserLocation = (data: { userLongitude: string; userLatitude: string }) =>
|
|
11
13
|
uni.$lcb.http.post<UserLocation>('/hotAddress/userLocation', data)
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ export interface ChildHotAddress {
|
|
|
17
17
|
keywords?: string
|
|
18
18
|
className?: string
|
|
19
19
|
cityId: string
|
|
20
|
+
areaId: string
|
|
20
21
|
longitude?: string
|
|
21
22
|
weightSort?: string
|
|
22
23
|
addressInfo?: string
|
|
@@ -28,6 +29,7 @@ export interface LcbAddress {
|
|
|
28
29
|
categoryName: string
|
|
29
30
|
keywords?: string
|
|
30
31
|
cityId: string
|
|
32
|
+
areaId: string
|
|
31
33
|
hotAddressId: string
|
|
32
34
|
provinceCityName: string
|
|
33
35
|
area: string
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export interface UserLocation {
|
|
2
2
|
addressInfo: string
|
|
3
3
|
cityId: string
|
|
4
|
+
areaId: string
|
|
4
5
|
cityName: string
|
|
5
6
|
haveNotCityId: string
|
|
6
7
|
haveNotCityName: string
|
|
7
8
|
haveNotAddressInfo: string
|
|
8
9
|
haveNotTip: string
|
|
10
|
+
showName: string
|
|
9
11
|
}
|
|
10
12
|
export declare const getUserLocation: (data: {
|
|
11
13
|
userLongitude: string
|
package/utils/history.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChildHotAddress } from '../components/lcb-city-select/api'
|
|
2
|
+
|
|
3
|
+
/** 设置城市历史记录 */
|
|
4
|
+
export const setHistoryCity = (address: ChildHotAddress) => {
|
|
5
|
+
uni.setStorageSync('cityHistory', {
|
|
6
|
+
address,
|
|
7
|
+
time: new Date().getTime(),
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** 获取城市历史记录如果超过3天就不使用历史 */
|
|
12
|
+
export const getHistoryCity = () => {
|
|
13
|
+
const history = uni.getStorageSync('cityHistory')
|
|
14
|
+
if (history && new Date().getTime() - history.time < 3 * 24 * 60 * 60 * 1000) {
|
|
15
|
+
return history.address as ChildHotAddress
|
|
16
|
+
}
|
|
17
|
+
}
|