@tplc/business 0.4.18 → 0.4.20
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 +16 -0
- package/components/lcb-calendar-search/lcb-calendar-search.vue +20 -6
- package/components/lcb-city-select/lcb-city-select.vue +23 -7
- package/components/lcb-list/components/FilterList/index.vue +8 -4
- package/components/lcb-search/components/SearchList/index.vue +17 -3
- package/components/lcb-search/lcb-search.vue +107 -67
- package/package.json +1 -1
- package/types/components/lcb-search/components/SearchList/index.vue.d.ts +21 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
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.4.20](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.19...v0.4.20) (2025-03-26)
|
|
6
|
+
|
|
7
|
+
### [0.4.19](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.16...v0.4.19) (2025-03-26)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
11
|
+
|
|
12
|
+
* **release:** 0.4.17 ([ce6bc59](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ce6bc595a36d996eeed159f9782bcb9cbd4f68b7))
|
|
13
|
+
* **release:** 0.4.18 ([62dd680](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/62dd6803d3965fbd1cad206f3528063992a94103))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
* 同步字段 ([706fd2b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/706fd2bbd2f52f6e3e1c4d994e099fc64631d998))
|
|
19
|
+
* 新增provinceId ([c3651bf](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c3651bf906a82f19b3ced7d6d4279d54e6a073c2))
|
|
20
|
+
|
|
5
21
|
### [0.4.18](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.17...v0.4.18) (2025-03-25)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
class="flex flex-1 text-[var(--content-color)] rounded-16rpx bg-#F5F5F7 h-78rpx flex items-center px-3 text-[28rpx]"
|
|
5
5
|
>
|
|
6
6
|
<lcb-city-select :location="userLocation" v-model="addressCity">
|
|
7
|
-
<view
|
|
7
|
+
<view
|
|
8
|
+
class="max-w-13 truncate"
|
|
9
|
+
:style="{
|
|
10
|
+
fontSize: (addressCity?.addressName?.length || 0) > 3 ? '20rpx' : '28rpx',
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
{{ addressCity?.addressName || '全国' }}
|
|
14
|
+
</view>
|
|
8
15
|
</lcb-city-select>
|
|
9
16
|
<view class="v-line"></view>
|
|
10
17
|
<lcb-calendar v-model="dayRange">
|
|
@@ -21,8 +28,8 @@
|
|
|
21
28
|
</lcb-calendar>
|
|
22
29
|
|
|
23
30
|
<view class="v-line"></view>
|
|
24
|
-
<view class="flex-1 flex items-center gap-2">
|
|
25
|
-
<wd-icon name="
|
|
31
|
+
<view class="flex-1 flex items-center gap-2 w-0">
|
|
32
|
+
<wd-icon name="sousuo_search" class-prefix="lcb" size="38rpx" color="#999999" />
|
|
26
33
|
<input
|
|
27
34
|
class="text-[var(--content-color)]"
|
|
28
35
|
:placeholder="placeholder"
|
|
@@ -34,10 +41,11 @@
|
|
|
34
41
|
<lcb-action-view
|
|
35
42
|
v-else
|
|
36
43
|
v-bind="inputLink"
|
|
37
|
-
custom-class="!w-full"
|
|
44
|
+
custom-class="!w-full !truncate !pr-2"
|
|
38
45
|
:customStyle="{
|
|
39
46
|
color: form.keywords ? 'var(--content-color)' : '#969696',
|
|
40
47
|
}"
|
|
48
|
+
:url-params="urlParams"
|
|
41
49
|
>
|
|
42
50
|
{{ form.keywords || placeholder }}
|
|
43
51
|
</lcb-action-view>
|
|
@@ -53,7 +61,7 @@
|
|
|
53
61
|
import { useTranslate } from '@tplc/wot'
|
|
54
62
|
import dayjs from 'dayjs/esm'
|
|
55
63
|
import useLocation from '../../hooks/useLocation'
|
|
56
|
-
import { inject, onMounted, Ref, ref, watch } from 'vue'
|
|
64
|
+
import { computed, inject, onMounted, Ref, ref, watch } from 'vue'
|
|
57
65
|
import { LcbCalendarSearchProps } from './types'
|
|
58
66
|
import { LcbAddress } from '../lcb-city-select/api'
|
|
59
67
|
import { FORM_KEY } from '../../constants'
|
|
@@ -76,7 +84,13 @@ withDefaults(defineProps<LcbCalendarSearchProps>(), {
|
|
|
76
84
|
icon: 'search',
|
|
77
85
|
mode: 'search',
|
|
78
86
|
})
|
|
79
|
-
|
|
87
|
+
const urlParams = computed(() => {
|
|
88
|
+
return stringify({
|
|
89
|
+
startDate: form.value.startDate,
|
|
90
|
+
endDate: form.value.endDate,
|
|
91
|
+
keywords: form.value.keywords,
|
|
92
|
+
})
|
|
93
|
+
})
|
|
80
94
|
const form = inject(FORM_KEY) as Ref<Record<string, any>>
|
|
81
95
|
const addressCity = ref<LcbAddress | undefined>(
|
|
82
96
|
(form.value.cityId || form.value.areaId || form.value.provinceId
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<script setup lang="ts">
|
|
62
|
-
import { ref, watch, provide } from 'vue'
|
|
62
|
+
import { ref, watch, provide, onMounted, onUnmounted } from 'vue'
|
|
63
63
|
import { ChildHotAddress, getAddressList, LcbAddress } from './api'
|
|
64
64
|
import LcbCityLetter from './components/lcb-city-letter/index.vue'
|
|
65
65
|
import LcbCityList from './components/lcb-city-list/index.vue'
|
|
@@ -97,13 +97,7 @@ const onCancel = () => {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
const onAddressClick = (item: LcbAddress) => {
|
|
100
|
-
// if (item.addrFlag) {
|
|
101
100
|
modelValue.value = item as ChildHotAddress
|
|
102
|
-
// } else {
|
|
103
|
-
// uni.navigateTo({
|
|
104
|
-
// url: `/pages/residentialHotel/index?${qs.stringify(item)}`,
|
|
105
|
-
// })
|
|
106
|
-
// }
|
|
107
101
|
onCancel()
|
|
108
102
|
show.value = false
|
|
109
103
|
}
|
|
@@ -133,6 +127,16 @@ watch(
|
|
|
133
127
|
},
|
|
134
128
|
)
|
|
135
129
|
|
|
130
|
+
watch(
|
|
131
|
+
() => modelValue.value,
|
|
132
|
+
() => {
|
|
133
|
+
uni.$emit('lcb-city-select-change', modelValue.value)
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
immediate: true,
|
|
137
|
+
},
|
|
138
|
+
)
|
|
139
|
+
|
|
136
140
|
watch(
|
|
137
141
|
() => show.value,
|
|
138
142
|
(val) => {
|
|
@@ -167,6 +171,18 @@ watch(
|
|
|
167
171
|
deep: true,
|
|
168
172
|
},
|
|
169
173
|
)
|
|
174
|
+
|
|
175
|
+
const onSelectChange = (val: ChildHotAddress) => {
|
|
176
|
+
if (JSON.stringify(val) !== JSON.stringify(modelValue.value)) {
|
|
177
|
+
modelValue.value = val
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
onMounted(() => {
|
|
181
|
+
uni.$on('lcb-city-select-change', onSelectChange)
|
|
182
|
+
})
|
|
183
|
+
onUnmounted(() => {
|
|
184
|
+
uni.$off('lcb-city-select-change', onSelectChange)
|
|
185
|
+
})
|
|
170
186
|
</script>
|
|
171
187
|
|
|
172
188
|
<style lang="scss" scoped>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
|
-
import { inject, Ref, ref, watch, watchEffect, onMounted } from 'vue'
|
|
20
|
+
import { inject, Ref, ref, watch, watchEffect, onMounted, onUnmounted } from 'vue'
|
|
21
21
|
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging'
|
|
22
22
|
import { FORM_KEY } from '../../../../constants'
|
|
23
23
|
import { getCurrentPage } from '../../../../utils/utils'
|
|
@@ -77,10 +77,14 @@ const onRefresh = async () => {
|
|
|
77
77
|
refreshed.value = true
|
|
78
78
|
emits('refresh')
|
|
79
79
|
}
|
|
80
|
+
const onReload = () => {
|
|
81
|
+
paging.value?.reload()
|
|
82
|
+
}
|
|
80
83
|
onMounted(() => {
|
|
81
|
-
uni.$on(`${getCurrentPage().fullPath}_reload`,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
uni.$on(`${getCurrentPage().fullPath}_reload`, onReload)
|
|
85
|
+
})
|
|
86
|
+
onUnmounted(() => {
|
|
87
|
+
uni.$off(`${getCurrentPage().fullPath}_reload`, onReload)
|
|
84
88
|
})
|
|
85
89
|
</script>
|
|
86
90
|
<style lang="scss" scoped>
|
|
@@ -19,10 +19,13 @@
|
|
|
19
19
|
:key="index"
|
|
20
20
|
@click="handleSelect(item)"
|
|
21
21
|
>
|
|
22
|
-
<img
|
|
22
|
+
<wd-img
|
|
23
23
|
:src="item.productTypeIcon"
|
|
24
24
|
v-if="item.productTypeIcon"
|
|
25
|
-
|
|
25
|
+
height="auto"
|
|
26
|
+
width="28rpx"
|
|
27
|
+
custom-class="mt-1 mr-2"
|
|
28
|
+
mode="widthFix"
|
|
26
29
|
/>
|
|
27
30
|
<view class="w-full">
|
|
28
31
|
<view class="flex items-center">
|
|
@@ -36,7 +39,14 @@
|
|
|
36
39
|
{{ textPart.text }}
|
|
37
40
|
</text>
|
|
38
41
|
</view>
|
|
39
|
-
<img
|
|
42
|
+
<wd-img
|
|
43
|
+
:src="item.titleIcon"
|
|
44
|
+
v-if="item.titleIcon"
|
|
45
|
+
height="24rpx"
|
|
46
|
+
width="24rpx"
|
|
47
|
+
custom-class="ml-1"
|
|
48
|
+
mode="aspectFill"
|
|
49
|
+
/>
|
|
40
50
|
</view>
|
|
41
51
|
<view v-if="item.price">
|
|
42
52
|
<text class="font-600 text-primary text-3.5">¥{{ item.price }}</text>
|
|
@@ -149,6 +159,10 @@ const highlightText = (text: string) => {
|
|
|
149
159
|
|
|
150
160
|
return parts
|
|
151
161
|
}
|
|
162
|
+
|
|
163
|
+
defineExpose({
|
|
164
|
+
getList: () => dataList.value,
|
|
165
|
+
})
|
|
152
166
|
</script>
|
|
153
167
|
<style lang="scss" scoped>
|
|
154
168
|
.border-b {
|
|
@@ -1,76 +1,107 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<view
|
|
10
|
-
class="flex items-center"
|
|
11
|
-
:style="{
|
|
12
|
-
gap: transformValueUnit(gap),
|
|
2
|
+
<view class="flex w-full items-center">
|
|
3
|
+
<lcb-block
|
|
4
|
+
v-bind="$props"
|
|
5
|
+
customClass="border-solid"
|
|
6
|
+
:customStyle="{
|
|
7
|
+
borderWidth: `${borderWidth}px`,
|
|
8
|
+
flex: 1,
|
|
13
9
|
}"
|
|
14
10
|
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<view
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
<view
|
|
12
|
+
class="flex items-center"
|
|
13
|
+
:style="{
|
|
14
|
+
gap: transformValueUnit(gap),
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<!-- v-if="city" -->
|
|
18
|
+
<lcb-city-select :location="userLocation" v-model="addressCity" v-if="city">
|
|
19
|
+
<view class="flex items-center h-full gap-1">
|
|
20
|
+
<wd-icon
|
|
21
|
+
name="location"
|
|
22
|
+
:size="transformValueUnit(cityIconSize)"
|
|
23
|
+
:color="cityIconColor"
|
|
24
|
+
/>
|
|
25
|
+
<view
|
|
26
|
+
class="max-w-13 truncate"
|
|
27
|
+
:style="{
|
|
28
|
+
color: cityColor,
|
|
29
|
+
fontSize:
|
|
30
|
+
(addressCity?.addressName?.length || 0) > 3
|
|
31
|
+
? transformValueUnit(citySize - 8)
|
|
32
|
+
: transformValueUnit(citySize),
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
{{ addressCity?.addressName || '全国' }}
|
|
36
|
+
</view>
|
|
37
|
+
<view
|
|
38
|
+
:style="{
|
|
39
|
+
backgroundColor: lineColor,
|
|
40
|
+
width: transformValueUnit(lineWidth),
|
|
41
|
+
margin: `0 ${transformValueUnit(linePadding)}`,
|
|
42
|
+
height: transformValueUnit(lineHeight),
|
|
43
|
+
}"
|
|
44
|
+
></view>
|
|
31
45
|
</view>
|
|
32
|
-
|
|
46
|
+
</lcb-city-select>
|
|
47
|
+
|
|
48
|
+
<lcb-icon
|
|
49
|
+
v-if="icon || url"
|
|
50
|
+
:url="url"
|
|
51
|
+
:size="iconSize"
|
|
52
|
+
:color="iconColor"
|
|
53
|
+
:icon="icon"
|
|
54
|
+
class-prefix="lcb"
|
|
55
|
+
:iconType="iconType"
|
|
56
|
+
/>
|
|
57
|
+
<view v-if="mode === 'search'" class="flex-1 flex items-center">
|
|
58
|
+
<input
|
|
59
|
+
class="search-input"
|
|
33
60
|
:style="{
|
|
34
|
-
|
|
35
|
-
width: transformValueUnit(lineWidth),
|
|
36
|
-
margin: `0 ${transformValueUnit(linePadding)}`,
|
|
37
|
-
height: transformValueUnit(lineHeight),
|
|
61
|
+
fontSize: transformValueUnit(fontSize),
|
|
38
62
|
}"
|
|
39
|
-
|
|
63
|
+
confirm-type="search"
|
|
64
|
+
:placeholder="placeholder"
|
|
65
|
+
v-model="form.keywords"
|
|
66
|
+
@confirm="onSearch"
|
|
67
|
+
focus
|
|
68
|
+
/>
|
|
69
|
+
<wd-icon
|
|
70
|
+
name="close-circle"
|
|
71
|
+
:size="iconSize"
|
|
72
|
+
:color="iconColor"
|
|
73
|
+
v-if="form.keywords"
|
|
74
|
+
@click="form.keywords = ''"
|
|
75
|
+
/>
|
|
40
76
|
</view>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
:style="{
|
|
56
|
-
fontSize: transformValueUnit(fontSize),
|
|
57
|
-
}"
|
|
58
|
-
confirm-type="search"
|
|
59
|
-
:placeholder="placeholder"
|
|
60
|
-
@confirm="onSearch"
|
|
61
|
-
/>
|
|
62
|
-
<lcb-action-view v-bind="link" :urlParams="stringify(addressCity)" v-else>
|
|
63
|
-
{{ placeholder }}
|
|
64
|
-
</lcb-action-view>
|
|
77
|
+
<lcb-action-view v-bind="link" :urlParams="stringify(addressCity)" v-else>
|
|
78
|
+
{{ placeholder }}
|
|
79
|
+
</lcb-action-view>
|
|
80
|
+
</view>
|
|
81
|
+
</lcb-block>
|
|
82
|
+
<view
|
|
83
|
+
class="mr-3"
|
|
84
|
+
@click="onCancel"
|
|
85
|
+
v-if="mode === 'search'"
|
|
86
|
+
:style="{
|
|
87
|
+
fontSize: transformValueUnit(fontSize),
|
|
88
|
+
}"
|
|
89
|
+
>
|
|
90
|
+
取消
|
|
65
91
|
</view>
|
|
66
|
-
</
|
|
92
|
+
</view>
|
|
67
93
|
<view id="searchPagingTop"></view>
|
|
68
94
|
<view
|
|
69
95
|
class="fixed left-0 w-full z-1 bg-white"
|
|
70
96
|
:style="{ height: height, top: top }"
|
|
71
|
-
v-if="form?.keywords && productTypeList"
|
|
97
|
+
v-if="form?.keywords && productTypeList && top"
|
|
72
98
|
>
|
|
73
|
-
<lcb-search-list
|
|
99
|
+
<lcb-search-list
|
|
100
|
+
:productTypeList="productTypeList"
|
|
101
|
+
@select="onSelect"
|
|
102
|
+
:height="height"
|
|
103
|
+
ref="searchListRef"
|
|
104
|
+
/>
|
|
74
105
|
</view>
|
|
75
106
|
<lcb-search-history
|
|
76
107
|
:historyKey="historyKey"
|
|
@@ -87,7 +118,7 @@ import { ChildHotAddress } from '../lcb-city-select/api'
|
|
|
87
118
|
import useLocation from '../../hooks/useLocation'
|
|
88
119
|
import { getHistoryCity } from '../../utils/history'
|
|
89
120
|
import { parse, stringify } from 'qs'
|
|
90
|
-
import { inject, Ref, ref } from 'vue'
|
|
121
|
+
import { inject, Ref, ref, watchEffect } from 'vue'
|
|
91
122
|
import { FORM_KEY } from '../../constants'
|
|
92
123
|
import LcbSearchHistory from './components/SearchHistory/index.vue'
|
|
93
124
|
import LcbSearchList from './components/SearchList/index.vue'
|
|
@@ -102,7 +133,7 @@ defineOptions({
|
|
|
102
133
|
styleIsolation: 'shared',
|
|
103
134
|
},
|
|
104
135
|
})
|
|
105
|
-
withDefaults(defineProps<LcbSearchProps>(), {
|
|
136
|
+
const props = withDefaults(defineProps<LcbSearchProps>(), {
|
|
106
137
|
placeholder: '搜索',
|
|
107
138
|
iconSize: '16',
|
|
108
139
|
borderWidth: 1,
|
|
@@ -127,17 +158,20 @@ withDefaults(defineProps<LcbSearchProps>(), {
|
|
|
127
158
|
fontSize: 24,
|
|
128
159
|
})
|
|
129
160
|
const searchHistoryRef = ref<InstanceType<typeof LcbSearchHistory>>()
|
|
161
|
+
const searchListRef = ref<InstanceType<typeof LcbSearchList>>()
|
|
130
162
|
const { height, top } = useAutoHeight('searchPagingTop')
|
|
131
163
|
const { getLocation, userLocation } = useLocation()
|
|
132
164
|
const addressCity = ref<ChildHotAddress | undefined>(getHistoryCity())
|
|
165
|
+
const popupProvide = inject('wd-popup', {
|
|
166
|
+
value: false,
|
|
167
|
+
})
|
|
133
168
|
getLocation()
|
|
134
|
-
const form = inject
|
|
169
|
+
const form = inject(FORM_KEY) as Ref<Record<string, any>>
|
|
135
170
|
const onSearch = async (e: { detail: { value: string } }) => {
|
|
136
|
-
|
|
137
|
-
form.value.keywords = e.detail.value
|
|
138
|
-
}
|
|
171
|
+
onSelect(searchListRef.value?.getList()?.[0])
|
|
139
172
|
}
|
|
140
|
-
const onSelect = (keyword
|
|
173
|
+
const onSelect = (keyword?: ProductInfo) => {
|
|
174
|
+
if (!keyword) return
|
|
141
175
|
searchHistoryRef.value?.saveHistory(keyword)
|
|
142
176
|
const [path, query] = keyword.link.jumpUrl.split('?')
|
|
143
177
|
let queryParams = query ? parse(query) : {}
|
|
@@ -168,6 +202,12 @@ const onSelect = (keyword: ProductInfo) => {
|
|
|
168
202
|
})
|
|
169
203
|
}
|
|
170
204
|
}
|
|
205
|
+
const onCancel = () => {
|
|
206
|
+
uni.navigateBack()
|
|
207
|
+
}
|
|
208
|
+
watchEffect(() => {
|
|
209
|
+
popupProvide.value = form.value?.keywords && props.productTypeList && top
|
|
210
|
+
})
|
|
171
211
|
</script>
|
|
172
212
|
|
|
173
213
|
<style lang="scss" scoped>
|
package/package.json
CHANGED
|
@@ -7,7 +7,27 @@ declare const _default: import('vue').DefineComponent<
|
|
|
7
7
|
type: StringConstructor
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
-
{
|
|
10
|
+
{
|
|
11
|
+
getList: () => {
|
|
12
|
+
productImg: string
|
|
13
|
+
productName: string
|
|
14
|
+
address: string
|
|
15
|
+
tags: string
|
|
16
|
+
price: number
|
|
17
|
+
priceSuffix: string
|
|
18
|
+
addressIntro: string
|
|
19
|
+
scoreAvg: number
|
|
20
|
+
productType: string
|
|
21
|
+
titleIcon: string
|
|
22
|
+
distanceTips: string
|
|
23
|
+
productTypeIcon: string
|
|
24
|
+
searchResultTips: string
|
|
25
|
+
link: {
|
|
26
|
+
jumpUrl: string
|
|
27
|
+
}
|
|
28
|
+
productInfoId: string
|
|
29
|
+
}[]
|
|
30
|
+
},
|
|
11
31
|
unknown,
|
|
12
32
|
{},
|
|
13
33
|
{},
|