@tplc/business 0.2.56 → 0.2.58
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 +21 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +6 -1
- package/components/lcb-city-select/api/index.ts +7 -5
- package/components/lcb-city-select/components/lcb-city-letter/index.vue +20 -23
- package/components/lcb-city-select/components/lcb-city-list/index.vue +14 -16
- package/components/lcb-city-select/lcb-city-select.vue +20 -8
- package/components/lcb-home-search/lcb-home-search.vue +3 -0
- package/package.json +1 -1
- package/types/components/lcb-city-select/api/index.d.ts +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
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.58](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.57...v0.2.58) (2025-01-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* 调整地图搜索 ([d8fe5fd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d8fe5fd3bd08e68cf39f76ca19e2419c6d747608))
|
|
11
|
+
|
|
12
|
+
### [0.2.57](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.55...v0.2.57) (2025-01-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
16
|
+
|
|
17
|
+
* **release:** 0.2.56 ([5a16720](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5a16720b5e8f56f3f79a99d97d61af22f8fc6c65))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ✨ Features | 新功能
|
|
21
|
+
|
|
22
|
+
* nav 如果页面俩层以上支持home ([0d9607a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0d9607aab7406ec0baeefd00b6434ba53d2ff11d))
|
|
23
|
+
* 修改city选择字段 ([f07078f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f07078fe0ad2bd0f7406202ab784a2714838ac02))
|
|
24
|
+
* 城市回显 ([2ae514e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2ae514e8ba68fdceacf4ef3f2db66fe733ed97fc))
|
|
25
|
+
|
|
5
26
|
### [0.2.56](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.53...v0.2.56) (2025-01-03)
|
|
6
27
|
|
|
7
28
|
|
|
@@ -71,7 +71,12 @@ const { getLocation, userLocation } = useLocation()
|
|
|
71
71
|
watch(
|
|
72
72
|
() => addressCity.value,
|
|
73
73
|
(val) => {
|
|
74
|
-
if (val)
|
|
74
|
+
if (val) {
|
|
75
|
+
form.value.cityId = val?.cityId
|
|
76
|
+
if (val.keywords) {
|
|
77
|
+
form.value.keywords = val.keywords
|
|
78
|
+
}
|
|
79
|
+
}
|
|
75
80
|
},
|
|
76
81
|
)
|
|
77
82
|
watch(
|
|
@@ -7,18 +7,19 @@ export interface HotAddress {
|
|
|
7
7
|
|
|
8
8
|
export interface ChildHotAddress {
|
|
9
9
|
addr: string
|
|
10
|
-
addrFlag
|
|
11
|
-
area
|
|
12
|
-
categoryName
|
|
10
|
+
addrFlag?: boolean
|
|
11
|
+
area?: string
|
|
12
|
+
categoryName?: string
|
|
13
13
|
createDate?: string
|
|
14
|
-
hotAddressId
|
|
14
|
+
hotAddressId?: string
|
|
15
15
|
icon?: string
|
|
16
16
|
lastModifyDate?: string
|
|
17
17
|
latitude?: string
|
|
18
|
+
keywords?: string
|
|
18
19
|
className?: string
|
|
19
20
|
cityId: string
|
|
20
21
|
longitude?: string
|
|
21
|
-
weightSort
|
|
22
|
+
weightSort?: string
|
|
22
23
|
addressInfo?: string
|
|
23
24
|
}
|
|
24
25
|
export const getHotAddress = () => uni.$lcb.http.post<HotAddress[]>('/hotAddress/categoryList', {})
|
|
@@ -26,6 +27,7 @@ export interface LcbAddress {
|
|
|
26
27
|
addr: string
|
|
27
28
|
addrFlag: boolean
|
|
28
29
|
categoryName: string
|
|
30
|
+
keywords?: string
|
|
29
31
|
cityId: string
|
|
30
32
|
hotAddressId: string
|
|
31
33
|
provinceCityName: string
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
<view
|
|
27
27
|
class="flex justify-center items-center address-tag"
|
|
28
28
|
:class="{
|
|
29
|
-
'current-address':
|
|
29
|
+
'current-address':
|
|
30
|
+
modelValue &&
|
|
31
|
+
`${modelValue.addr},${modelValue.keywords}` === `${city.addr},${city.keywords}`,
|
|
30
32
|
[city.className || '']: true,
|
|
31
33
|
}"
|
|
32
34
|
v-for="city in item.childHotAddress"
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
>
|
|
38
40
|
<view class="tag-view">
|
|
39
41
|
<wd-icon v-if="city.icon" :name="city.icon" class="mr-0.5" />
|
|
40
|
-
{{ city.addr }}
|
|
42
|
+
{{ city.keywords ? `${city.keywords},` : '' }} {{ city.addr }}
|
|
41
43
|
</view>
|
|
42
44
|
</view>
|
|
43
45
|
</view>
|
|
@@ -55,8 +57,8 @@
|
|
|
55
57
|
|
|
56
58
|
<script setup lang="ts">
|
|
57
59
|
import { LcbCitySelectProps } from '../../../lcb-city-select/types'
|
|
58
|
-
import { ChildHotAddress, getHotAddress, HotAddress } from '../../api'
|
|
59
|
-
import { computed, onMounted,
|
|
60
|
+
import { ChildHotAddress, getHotAddress, HotAddress, LcbAddress } from '../../api'
|
|
61
|
+
import { computed, inject, onMounted, Ref, ref } from 'vue'
|
|
60
62
|
|
|
61
63
|
defineOptions({
|
|
62
64
|
name: 'LcbCityLetter',
|
|
@@ -70,7 +72,7 @@ const props = withDefaults(defineProps<LcbCitySelectProps>(), {})
|
|
|
70
72
|
const indexBarRef = ref<{ scrollToIndex: (index: string) => void }>()
|
|
71
73
|
const addressRef = ref<HotAddress[]>([])
|
|
72
74
|
const letterList = ref<string[]>([])
|
|
73
|
-
const
|
|
75
|
+
const historyList = inject('lcb-city-history') as Ref<LcbAddress[]>
|
|
74
76
|
const modelValue = defineModel<ChildHotAddress>()
|
|
75
77
|
onMounted(async () => {
|
|
76
78
|
const { data } = await getHotAddress()
|
|
@@ -78,7 +80,6 @@ onMounted(async () => {
|
|
|
78
80
|
.filter((v) => !v.categoryName.includes('热门'))
|
|
79
81
|
.map((item) => item.categoryName)
|
|
80
82
|
addressRef.value = data
|
|
81
|
-
historyAddress.value = JSON.parse(uni.getStorageSync('historyAddress') || '[]')
|
|
82
83
|
})
|
|
83
84
|
const locationAddress = computed<HotAddress[]>(() => {
|
|
84
85
|
return props.location
|
|
@@ -104,25 +105,18 @@ const locationAddress = computed<HotAddress[]>(() => {
|
|
|
104
105
|
: []
|
|
105
106
|
})
|
|
106
107
|
|
|
107
|
-
const
|
|
108
|
-
return
|
|
108
|
+
const historyLetter = computed<HotAddress[]>(() => {
|
|
109
|
+
return historyList.value.length
|
|
109
110
|
? [
|
|
110
111
|
{
|
|
111
112
|
categoryName: '历史',
|
|
112
113
|
hint: '历史选择',
|
|
113
|
-
childHotAddress:
|
|
114
|
+
childHotAddress: historyList.value,
|
|
114
115
|
},
|
|
115
116
|
]
|
|
116
117
|
: []
|
|
117
118
|
})
|
|
118
|
-
|
|
119
|
-
() => historyAddress.value,
|
|
120
|
-
(val) => {
|
|
121
|
-
if (val.length) {
|
|
122
|
-
uni.setStorageSync('historyAddress', JSON.stringify(val))
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
)
|
|
119
|
+
|
|
126
120
|
const onAddrClick = (city: ChildHotAddress, letter = false) => {
|
|
127
121
|
if (letter) {
|
|
128
122
|
indexBarRef.value?.scrollToIndex(city.addr)
|
|
@@ -133,11 +127,14 @@ const onAddrClick = (city: ChildHotAddress, letter = false) => {
|
|
|
133
127
|
className: '',
|
|
134
128
|
}
|
|
135
129
|
modelValue.value = currentCity
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
historyList.value = historyList.value.filter(
|
|
131
|
+
(historyItem) =>
|
|
132
|
+
`${historyItem.keywords},${historyItem.addr}` !== `${city.keywords},${city.addr}`,
|
|
133
|
+
)
|
|
134
|
+
if (historyList.value.length === 8) {
|
|
135
|
+
historyList.value = [currentCity as unknown as LcbAddress, ...historyList.value.slice(0, 7)]
|
|
139
136
|
} else {
|
|
140
|
-
|
|
137
|
+
historyList.value = [currentCity as unknown as LcbAddress, ...historyList.value]
|
|
141
138
|
}
|
|
142
139
|
}
|
|
143
140
|
const indexBars = computed<HotAddress[]>(() => {
|
|
@@ -154,7 +151,7 @@ const indexBars = computed<HotAddress[]>(() => {
|
|
|
154
151
|
},
|
|
155
152
|
] as HotAddress[])
|
|
156
153
|
: ([] as HotAddress[])
|
|
157
|
-
return [...locationAddress.value, ...
|
|
154
|
+
return [...locationAddress.value, ...historyLetter.value, ...letters, ...addressRef.value]
|
|
158
155
|
})
|
|
159
156
|
</script>
|
|
160
157
|
<style lang="scss" scoped>
|
|
@@ -162,7 +159,7 @@ const indexBars = computed<HotAddress[]>(() => {
|
|
|
162
159
|
|
|
163
160
|
.address-tag {
|
|
164
161
|
background: #f7f7f7;
|
|
165
|
-
height:
|
|
162
|
+
height: 70rpx;
|
|
166
163
|
padding: 0rpx 16rpx;
|
|
167
164
|
box-sizing: border-box;
|
|
168
165
|
border-radius: 10rpx;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="p-3 box-border h-full overflow-y-auto">
|
|
2
|
+
<view class="p-3 box-border h-full overflow-y-auto pt-0">
|
|
3
3
|
<view v-for="item in list" :key="item.cityId" @click="onItemClick(item)">
|
|
4
|
-
<view class="flex">
|
|
4
|
+
<view class="flex mt-3">
|
|
5
5
|
<view class="tag">{{ item.categoryName }}</view>
|
|
6
6
|
<view class="content">
|
|
7
|
-
<rich-text :nodes="getText(item.
|
|
7
|
+
<rich-text :nodes="getText(item.keywords || '-')" />
|
|
8
8
|
<view>{{ item.provinceCityName || item.area }}</view>
|
|
9
9
|
</view>
|
|
10
10
|
</view>
|
|
11
11
|
</view>
|
|
12
|
-
<view v-if="!list.length">
|
|
12
|
+
<view v-if="!list.length" class="mt-3">
|
|
13
13
|
<view v-if="historyList.length">
|
|
14
14
|
<view class="flex justify-between items-center">
|
|
15
15
|
<view class="text-28rpx text-#333 font-500x">历史搜索</view>
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
@click="emits('click', item)"
|
|
23
23
|
class="history-tag"
|
|
24
24
|
>
|
|
25
|
-
{{ item.
|
|
26
|
-
{{ item.
|
|
25
|
+
{{ item.keywords ? `${item.keywords},` : '' }}
|
|
26
|
+
{{ item.addr }}
|
|
27
27
|
</view>
|
|
28
28
|
</view>
|
|
29
29
|
</view>
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
40
|
<script setup lang="ts">
|
|
41
|
+
import { inject, Ref, ref } from 'vue'
|
|
41
42
|
import { LcbAddress } from '../../api'
|
|
42
43
|
import { LcbCityListProps } from './types'
|
|
43
|
-
import { ref } from 'vue'
|
|
44
44
|
|
|
45
45
|
defineOptions({
|
|
46
46
|
name: 'LcbCityList',
|
|
@@ -51,25 +51,23 @@ defineOptions({
|
|
|
51
51
|
},
|
|
52
52
|
})
|
|
53
53
|
const emits = defineEmits(['click'])
|
|
54
|
-
const historyList =
|
|
54
|
+
const historyList = inject('lcb-city-history') as Ref<LcbAddress[]>
|
|
55
55
|
const props = withDefaults(defineProps<LcbCityListProps>(), {})
|
|
56
56
|
const getText = (text: string) => {
|
|
57
|
-
const str = text.replace(props.keyword, `<div class="text-
|
|
57
|
+
const str = text.replace(props.keyword, `<div class="text-primary">${props.keyword}</div>`)
|
|
58
58
|
return `<div class="flex">${str}</div>`
|
|
59
59
|
}
|
|
60
60
|
const onItemClick = (item: LcbAddress) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
61
|
+
const addr = `${item.keywords},${item.addr}`
|
|
62
|
+
historyList.value = historyList.value.filter(
|
|
63
|
+
(historyItem) => `${historyItem.keywords},${historyItem.addr}` !== addr,
|
|
64
|
+
)
|
|
66
65
|
historyList.value.unshift(item)
|
|
67
|
-
uni.setStorageSync('lcb_city_select_history', historyList.value)
|
|
68
66
|
emits('click', item)
|
|
69
67
|
}
|
|
70
68
|
const onClear = () => {
|
|
71
69
|
historyList.value = []
|
|
72
|
-
uni.removeStorageSync('
|
|
70
|
+
uni.removeStorageSync('historyAddress')
|
|
73
71
|
}
|
|
74
72
|
</script>
|
|
75
73
|
<style lang="scss" scoped>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<script setup lang="ts">
|
|
60
|
-
import { ref, watch } from 'vue'
|
|
60
|
+
import { ref, watch, provide } from 'vue'
|
|
61
61
|
import { ChildHotAddress, getAddressList, LcbAddress } from './api'
|
|
62
62
|
import LcbCityLetter from './components/lcb-city-letter/index.vue'
|
|
63
63
|
import LcbCityList from './components/lcb-city-list/index.vue'
|
|
@@ -75,6 +75,8 @@ defineOptions({
|
|
|
75
75
|
const props = withDefaults(defineProps<LcbCitySelectProps>(), {
|
|
76
76
|
placeholder: '搜索城市/区域/景点',
|
|
77
77
|
})
|
|
78
|
+
const historyList = ref<LcbAddress[]>(uni.getStorageSync('historyAddress') || [])
|
|
79
|
+
provide('lcb-city-history', historyList)
|
|
78
80
|
const modelValue = defineModel<ChildHotAddress>()
|
|
79
81
|
const isOver = ref(false)
|
|
80
82
|
const searchValue = ref('')
|
|
@@ -93,13 +95,13 @@ const onCancel = () => {
|
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
const onAddressClick = (item: LcbAddress) => {
|
|
96
|
-
if (item.addrFlag) {
|
|
97
|
-
|
|
98
|
-
} else {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
98
|
+
// if (item.addrFlag) {
|
|
99
|
+
modelValue.value = item as ChildHotAddress
|
|
100
|
+
// } else {
|
|
101
|
+
// uni.navigateTo({
|
|
102
|
+
// url: `/pages/residentialHotel/index?${qs.stringify(item)}`,
|
|
103
|
+
// })
|
|
104
|
+
// }
|
|
103
105
|
onCancel()
|
|
104
106
|
show.value = false
|
|
105
107
|
}
|
|
@@ -150,6 +152,16 @@ const search = debounce(async () => {
|
|
|
150
152
|
const { data } = await getAddressList(searchValue.value)
|
|
151
153
|
lcbAddress.value = data
|
|
152
154
|
}, 200)
|
|
155
|
+
|
|
156
|
+
watch(
|
|
157
|
+
() => historyList.value,
|
|
158
|
+
(val) => {
|
|
159
|
+
uni.setStorageSync('historyAddress', val)
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
deep: true,
|
|
163
|
+
},
|
|
164
|
+
)
|
|
153
165
|
</script>
|
|
154
166
|
|
|
155
167
|
<style lang="scss" scoped>
|
package/package.json
CHANGED
|
@@ -6,18 +6,19 @@ export interface HotAddress {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ChildHotAddress {
|
|
8
8
|
addr: string
|
|
9
|
-
addrFlag
|
|
10
|
-
area
|
|
11
|
-
categoryName
|
|
9
|
+
addrFlag?: boolean
|
|
10
|
+
area?: string
|
|
11
|
+
categoryName?: string
|
|
12
12
|
createDate?: string
|
|
13
|
-
hotAddressId
|
|
13
|
+
hotAddressId?: string
|
|
14
14
|
icon?: string
|
|
15
15
|
lastModifyDate?: string
|
|
16
16
|
latitude?: string
|
|
17
|
+
keywords?: string
|
|
17
18
|
className?: string
|
|
18
19
|
cityId: string
|
|
19
20
|
longitude?: string
|
|
20
|
-
weightSort
|
|
21
|
+
weightSort?: string
|
|
21
22
|
addressInfo?: string
|
|
22
23
|
}
|
|
23
24
|
export declare const getHotAddress: () => Promise<import('../../../action').IResData<HotAddress[]>>
|
|
@@ -25,6 +26,7 @@ export interface LcbAddress {
|
|
|
25
26
|
addr: string
|
|
26
27
|
addrFlag: boolean
|
|
27
28
|
categoryName: string
|
|
29
|
+
keywords?: string
|
|
28
30
|
cityId: string
|
|
29
31
|
hotAddressId: string
|
|
30
32
|
provinceCityName: string
|