@tplc/business 0.2.74 → 0.2.75
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-list/components/FilterList/index.vue +1 -0
- package/components/lcb-product/lcb-product.vue +41 -25
- package/components/lcb-product/types.ts +1 -0
- package/package.json +1 -1
- package/types/components/lcb-product/lcb-product.vue.d.ts +3 -0
- package/types/components/lcb-product/types.d.ts +1 -0
- package/types/utils/utils.d.ts +8 -0
- package/utils/utils.ts +11 -0
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.75](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.69...v0.2.75) (2025-01-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
9
|
+
|
|
10
|
+
* **release:** 0.2.70 ([25208a1](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/25208a1b7c62cf86be34fc10284f8bcbf53fa660))
|
|
11
|
+
* **release:** 0.2.71 ([6e5b105](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6e5b105c4781e0fabbdae76fcfc1a45afc8e8e58))
|
|
12
|
+
* **release:** 0.2.72 ([01d5635](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/01d5635a74cb249bf9224d5e2f87f1b696976454))
|
|
13
|
+
* **release:** 0.2.73 ([fe1c4d4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fe1c4d436f577a5e6d476c1d72968bfd7e6d5b05))
|
|
14
|
+
* **release:** 0.2.74 ([4685a29](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4685a2978cfc39f834ad286c3a6fd19a943ca828))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ✨ Features | 新功能
|
|
18
|
+
|
|
19
|
+
* product组件切换为接口 ([520f1ca](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/520f1cad1ce517ee9de12845a513678396039e43))
|
|
20
|
+
* 兼容地图 ([b189928](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b18992884c5e1a6dce947c5f7dbbb6750f5dfb5f))
|
|
21
|
+
* 加载更多 ([ae2ba8b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ae2ba8b24334aa2f1bb82c6a702cc72bb16beee1))
|
|
22
|
+
* 处理瀑布流刷新 ([d76fb08](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d76fb088eb287f0a88dfc029f7b9bb287a2b5cd8))
|
|
23
|
+
* 新增types ([b4ceffd](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b4ceffdb507c04888370ca4ca0a523d528429a49))
|
|
24
|
+
* 瀑布流 ([a5334a0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a5334a02c4cc3cbecf5822534fabfb899d166f35))
|
|
25
|
+
|
|
5
26
|
### [0.2.74](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.73...v0.2.74) (2025-01-06)
|
|
6
27
|
|
|
7
28
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, useAttrs, watch,
|
|
2
|
+
import { ref, useAttrs, watch, watchEffect } from 'vue'
|
|
3
3
|
import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
|
|
4
|
-
import ULazyLoad from 'uview-plus/components/u-lazy-load/u-lazy-load.vue'
|
|
5
4
|
import { LcbProductProps } from './types'
|
|
6
5
|
import { transformValueUnit } from '../../utils/transform'
|
|
7
|
-
import {
|
|
6
|
+
import { calculateImageHeight } from '../../utils/utils'
|
|
8
7
|
|
|
9
8
|
const uWaterfallRef = ref()
|
|
10
9
|
defineOptions({
|
|
@@ -22,8 +21,10 @@ const props = withDefaults(defineProps<LcbProductProps>(), {
|
|
|
22
21
|
imageWidth: 200,
|
|
23
22
|
imageHeight: 250,
|
|
24
23
|
titleLineClamp: 2,
|
|
24
|
+
column: 2,
|
|
25
25
|
})
|
|
26
26
|
const renderList = ref<Record<string, any>[]>([])
|
|
27
|
+
const screenWidth = uni.getSystemInfoSync().screenWidth
|
|
27
28
|
watchEffect(() => {
|
|
28
29
|
if (!props.filterList) return
|
|
29
30
|
renderList.value = props.items as Record<string, any>[]
|
|
@@ -34,8 +35,10 @@ defineSlots<{
|
|
|
34
35
|
watch(
|
|
35
36
|
() => props.form,
|
|
36
37
|
() => {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
if (props.listType === 'waterfall') {
|
|
39
|
+
renderList.value = []
|
|
40
|
+
uWaterfallRef.value?.clear?.()
|
|
41
|
+
}
|
|
39
42
|
},
|
|
40
43
|
{ deep: true },
|
|
41
44
|
)
|
|
@@ -52,11 +55,13 @@ const getData = async () => {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
watch(() => props.items, getData, { immediate: true, deep: true })
|
|
55
|
-
|
|
58
|
+
const columnWidth = (screenWidth - 12 * (1 + props.column)) / 2
|
|
56
59
|
defineExpose({
|
|
57
60
|
clear: () => {
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
if (props.listType === 'waterfall') {
|
|
62
|
+
renderList.value = []
|
|
63
|
+
uWaterfallRef.value?.clear?.()
|
|
64
|
+
}
|
|
60
65
|
},
|
|
61
66
|
})
|
|
62
67
|
</script>
|
|
@@ -130,9 +135,9 @@ defineExpose({
|
|
|
130
135
|
</view>
|
|
131
136
|
|
|
132
137
|
<view class="lcb-product-waterfall" v-else-if="listType === 'waterfall'">
|
|
133
|
-
<u-waterfall :modelValue="renderList" ref="uWaterfallRef">
|
|
138
|
+
<u-waterfall :addTime="0" :modelValue="renderList" ref="uWaterfallRef">
|
|
134
139
|
<template #left="{ leftList: list }">
|
|
135
|
-
<view class="flex flex-col gap-
|
|
140
|
+
<view class="flex flex-col gap-12px">
|
|
136
141
|
<lcb-action-view
|
|
137
142
|
v-for="(item, index) in list"
|
|
138
143
|
:key="`${item?.productId}:${index}`"
|
|
@@ -157,14 +162,19 @@ defineExpose({
|
|
|
157
162
|
v-else
|
|
158
163
|
>
|
|
159
164
|
<template #coverImg="{ value }">
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
:
|
|
165
|
-
:
|
|
165
|
+
<wd-img
|
|
166
|
+
:src="value"
|
|
167
|
+
width="100%"
|
|
168
|
+
mode="aspectFill"
|
|
169
|
+
:lazyPlaceWidth="columnWidth"
|
|
170
|
+
:height="
|
|
171
|
+
calculateImageHeight(
|
|
172
|
+
screenWidth,
|
|
173
|
+
item.coverImgProps?.[0]?.height,
|
|
174
|
+
item.coverImgProps?.[0]?.width,
|
|
175
|
+
)
|
|
176
|
+
"
|
|
166
177
|
/>
|
|
167
|
-
<!-- <wd-img :src="value" width="100%" lazyPlaceWidth="250" height="auto" mode="widthFix" /> -->
|
|
168
178
|
</template>
|
|
169
179
|
</lcb-product-item>
|
|
170
180
|
</slot>
|
|
@@ -196,12 +206,18 @@ defineExpose({
|
|
|
196
206
|
tag-overflow-wrap
|
|
197
207
|
>
|
|
198
208
|
<template #coverImg="{ value }">
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
:
|
|
203
|
-
|
|
204
|
-
:
|
|
209
|
+
<wd-img
|
|
210
|
+
:src="value"
|
|
211
|
+
width="100%"
|
|
212
|
+
:lazyPlaceWidth="columnWidth"
|
|
213
|
+
mode="aspectFill"
|
|
214
|
+
:height="
|
|
215
|
+
calculateImageHeight(
|
|
216
|
+
screenWidth,
|
|
217
|
+
item.coverImgProps?.[0]?.height,
|
|
218
|
+
item.coverImgProps?.[0]?.width,
|
|
219
|
+
)
|
|
220
|
+
"
|
|
205
221
|
/>
|
|
206
222
|
</template>
|
|
207
223
|
</lcb-product-item>
|
|
@@ -257,8 +273,8 @@ defineExpose({
|
|
|
257
273
|
.lcb-product-waterfall {
|
|
258
274
|
:deep(.u-waterfall) {
|
|
259
275
|
display: flex;
|
|
260
|
-
gap:
|
|
261
|
-
padding:
|
|
276
|
+
gap: 12px;
|
|
277
|
+
padding: 12px;
|
|
262
278
|
}
|
|
263
279
|
}
|
|
264
280
|
</style>
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
12
12
|
imageWidth: number
|
|
13
13
|
imageHeight: number
|
|
14
14
|
titleLineClamp: number
|
|
15
|
+
column: number
|
|
15
16
|
}
|
|
16
17
|
>,
|
|
17
18
|
{
|
|
@@ -34,6 +35,7 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
34
35
|
imageWidth: number
|
|
35
36
|
imageHeight: number
|
|
36
37
|
titleLineClamp: number
|
|
38
|
+
column: number
|
|
37
39
|
}
|
|
38
40
|
>
|
|
39
41
|
>
|
|
@@ -41,6 +43,7 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
41
43
|
{
|
|
42
44
|
imageWidth: number
|
|
43
45
|
imageHeight: number
|
|
46
|
+
column: number
|
|
44
47
|
listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
|
|
45
48
|
titleLineClamp: number
|
|
46
49
|
},
|
package/types/utils/utils.d.ts
CHANGED
|
@@ -6,3 +6,11 @@ export declare const getPageOptions: () => Record<string, any>
|
|
|
6
6
|
export declare const getFinalUrl: (url: string, urlParams?: string) => string
|
|
7
7
|
export declare const onPageScrollSelector: (selector: string) => void
|
|
8
8
|
export declare const getPreviewImageUrl: (url: string, width?: number) => string
|
|
9
|
+
/** 根据屏幕宽度 图片高度宽度比例 列数与 间隙宽度 计算图片高度 */
|
|
10
|
+
export declare const calculateImageHeight: (
|
|
11
|
+
screenWidth: number,
|
|
12
|
+
imageHeight?: number,
|
|
13
|
+
imageWidth?: number,
|
|
14
|
+
column?: number,
|
|
15
|
+
gap?: number,
|
|
16
|
+
) => number
|
package/utils/utils.ts
CHANGED
|
@@ -51,3 +51,14 @@ export const getPreviewImageUrl = (url: string, width = 200) => {
|
|
|
51
51
|
: `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`
|
|
52
52
|
return `${url}${width > 0 ? suffix : ''}`
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
/** 根据屏幕宽度 图片高度宽度比例 列数与 间隙宽度 计算图片高度 */
|
|
56
|
+
export const calculateImageHeight = (
|
|
57
|
+
screenWidth: number,
|
|
58
|
+
imageHeight = 176,
|
|
59
|
+
imageWidth = 240,
|
|
60
|
+
column = 2,
|
|
61
|
+
gap = 12,
|
|
62
|
+
) => {
|
|
63
|
+
return ((screenWidth - gap * (2 + column - 1)) / 2) * (imageHeight / imageWidth)
|
|
64
|
+
}
|