@tplc/business 0.2.55 → 0.2.57
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 +30 -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-home-search/lcb-home-search.vue +3 -0
- package/components/lcb-nav/lcb-nav.vue +15 -3
- package/package.json +1 -1
- package/types/components/lcb-city-select/api/index.d.ts +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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.57](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.55...v0.2.57) (2025-01-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.2.56 ([5a16720](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5a16720b5e8f56f3f79a99d97d61af22f8fc6c65))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ✨ Features | 新功能
|
|
14
|
+
|
|
15
|
+
* nav 如果页面俩层以上支持home ([0d9607a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0d9607aab7406ec0baeefd00b6434ba53d2ff11d))
|
|
16
|
+
* 修改city选择字段 ([f07078f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f07078fe0ad2bd0f7406202ab784a2714838ac02))
|
|
17
|
+
* 城市回显 ([2ae514e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2ae514e8ba68fdceacf4ef3f2db66fe733ed97fc))
|
|
18
|
+
|
|
19
|
+
### [0.2.56](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.53...v0.2.56) (2025-01-03)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
23
|
+
|
|
24
|
+
* **release:** 0.2.54 ([0e50489](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0e5048983ebc7b98802b57fbf7b0abe128567206))
|
|
25
|
+
* **release:** 0.2.55 ([8639fd2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8639fd2ccd4611729f3d84b8c008a76b700320ac))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### ✨ Features | 新功能
|
|
29
|
+
|
|
30
|
+
* nav 如果页面俩层以上支持home ([0d9607a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0d9607aab7406ec0baeefd00b6434ba53d2ff11d))
|
|
31
|
+
* 修改city选择字段 ([f07078f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f07078fe0ad2bd0f7406202ab784a2714838ac02))
|
|
32
|
+
* 图片尺寸 ([1450d12](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/1450d126ee919f47df16f74dd4d170ef30c38e32))
|
|
33
|
+
* 城市选择显示详细地址信息 ([e81331f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e81331f9b303d14468cb659a1b8b7cf16b299dc9))
|
|
34
|
+
|
|
5
35
|
### [0.2.55](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.54...v0.2.55) (2025-01-02)
|
|
6
36
|
|
|
7
37
|
### [0.2.54](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.50...v0.2.54) (2025-01-02)
|
|
@@ -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>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<view class="navbar-left z-1">
|
|
28
28
|
<!-- 返回按钮 -->
|
|
29
29
|
<view
|
|
30
|
-
v-if="styleGroup === 3 && capsuleList.length"
|
|
30
|
+
v-if="(styleGroup === 3 || moreThanTwoPages()) && capsuleList.length"
|
|
31
31
|
class="navbar-capsule flex justify-center items-center"
|
|
32
32
|
:class="[capsuleMode]"
|
|
33
33
|
>
|
|
@@ -132,6 +132,11 @@ const isLastPage = () => {
|
|
|
132
132
|
const pages = getCurrentPages()
|
|
133
133
|
return pages.length === 1
|
|
134
134
|
}
|
|
135
|
+
// 超过俩个页面
|
|
136
|
+
const moreThanTwoPages = () => {
|
|
137
|
+
const pages = getCurrentPages()
|
|
138
|
+
return pages.length > 2
|
|
139
|
+
}
|
|
135
140
|
|
|
136
141
|
// 透明度
|
|
137
142
|
const navbarBgOpacity = computed(() => {
|
|
@@ -170,6 +175,13 @@ const capsuleList = computed(() => {
|
|
|
170
175
|
action: 'back',
|
|
171
176
|
})
|
|
172
177
|
}
|
|
178
|
+
/** 如果超过俩个的层级的话并且支持返回 */
|
|
179
|
+
if (moreThanTwoPages()) {
|
|
180
|
+
list.push({
|
|
181
|
+
icon: 'home',
|
|
182
|
+
action: 'home',
|
|
183
|
+
})
|
|
184
|
+
}
|
|
173
185
|
|
|
174
186
|
return [...list, ...(props.capsules || [])] as ICapsule[]
|
|
175
187
|
})
|
|
@@ -297,8 +309,8 @@ const toBack = () => {
|
|
|
297
309
|
}
|
|
298
310
|
|
|
299
311
|
.dark {
|
|
300
|
-
border-color: rgba(255, 255, 255, 0.25);
|
|
301
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
312
|
+
border-color: rgba(255, 255, 255, 0.25) !important;
|
|
313
|
+
background-color: rgba(0, 0, 0, 0.15) !important;
|
|
302
314
|
color: #fff;
|
|
303
315
|
> view {
|
|
304
316
|
position: relative;
|
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
|