@tplc/business 0.2.68 → 0.2.69
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 +7 -0
- package/components/lcb-list/lcb-list.vue +7 -2
- package/components/lcb-product/lcb-product.vue +22 -7
- package/components/lcb-product/types.ts +5 -1
- package/package.json +1 -1
- package/types/components/lcb-product/lcb-product.vue.d.ts +18 -18
- package/types/components/lcb-product/types.d.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.69](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.68...v0.2.69) (2025-01-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* product 属性新增 ([7f27bc5](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7f27bc5e8fd88f25a8af1b54f4834ddc5c41e20f))
|
|
11
|
+
|
|
5
12
|
### [0.2.68](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.67...v0.2.68) (2025-01-05)
|
|
6
13
|
|
|
7
14
|
### [0.2.67](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.66...v0.2.67) (2025-01-05)
|
|
@@ -32,12 +32,17 @@
|
|
|
32
32
|
>
|
|
33
33
|
<slot name="list" :items="items" v-if="$slots.list" />
|
|
34
34
|
<template v-else>
|
|
35
|
-
<lcb-product
|
|
35
|
+
<lcb-product
|
|
36
|
+
v-bind="{ ...$props, ...attrs, form }"
|
|
37
|
+
:items="items"
|
|
38
|
+
filterList
|
|
39
|
+
v-if="$slots.item"
|
|
40
|
+
>
|
|
36
41
|
<template #item="{ item }">
|
|
37
42
|
<slot name="item" :item="item"></slot>
|
|
38
43
|
</template>
|
|
39
44
|
</lcb-product>
|
|
40
|
-
<lcb-product v-bind="{ ...$props, ...attrs, form }" :items="items" v-else />
|
|
45
|
+
<lcb-product v-bind="{ ...$props, ...attrs, form }" filterList :items="items" v-else />
|
|
41
46
|
</template>
|
|
42
47
|
</FilterList>
|
|
43
48
|
<lcb-map v-else-if="mode === 'map'" v-bind="{ ...info.listInfo, ...$props, ...attrs }" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, useAttrs, watch } from 'vue'
|
|
2
|
+
import { ref, useAttrs, watch, computed } from 'vue'
|
|
3
3
|
import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
|
|
4
4
|
import { LcbProductProps } from './types'
|
|
5
5
|
import { transformValueUnit } from '../../utils/transform'
|
|
@@ -15,13 +15,13 @@ defineOptions({
|
|
|
15
15
|
},
|
|
16
16
|
})
|
|
17
17
|
const attrs = useAttrs()
|
|
18
|
+
const list = ref<Record<string, any>[]>([])
|
|
18
19
|
const props = withDefaults(defineProps<LcbProductProps>(), {
|
|
19
20
|
listType: 'list',
|
|
20
|
-
items: [],
|
|
21
21
|
imageWidth: 200,
|
|
22
22
|
imageHeight: 250,
|
|
23
23
|
titleLineClamp: 2,
|
|
24
|
-
}
|
|
24
|
+
})
|
|
25
25
|
defineSlots<{
|
|
26
26
|
item(props: { item: any }): any
|
|
27
27
|
}>()
|
|
@@ -32,6 +32,21 @@ watch(
|
|
|
32
32
|
},
|
|
33
33
|
{ deep: true },
|
|
34
34
|
)
|
|
35
|
+
const getData = async () => {
|
|
36
|
+
if (props.filterList) return
|
|
37
|
+
if (props.items?.length) {
|
|
38
|
+
const { data } = await uni.$lcb.http.post('/productInfo/filteredPage', {
|
|
39
|
+
productIdList: props.items.map((item) => item.productId),
|
|
40
|
+
})
|
|
41
|
+
list.value = data as Record<string, any>[]
|
|
42
|
+
} else {
|
|
43
|
+
list.value = []
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
watch(() => props.items, getData, { immediate: true, deep: true })
|
|
47
|
+
const renderList = computed(() => {
|
|
48
|
+
return props.filterList ? props.items : list.value
|
|
49
|
+
})
|
|
35
50
|
</script>
|
|
36
51
|
|
|
37
52
|
<template>
|
|
@@ -39,7 +54,7 @@ watch(
|
|
|
39
54
|
<!-- 单列 -->
|
|
40
55
|
<view class="flex flex-col gap-2 p-3" v-if="listType === 'list'">
|
|
41
56
|
<lcb-action-view
|
|
42
|
-
v-for="(item, index) in
|
|
57
|
+
v-for="(item, index) in renderList"
|
|
43
58
|
:key="`${item?.productId}:${index}`"
|
|
44
59
|
v-bind="item.link"
|
|
45
60
|
>
|
|
@@ -71,7 +86,7 @@ watch(
|
|
|
71
86
|
<!-- 双列 -->
|
|
72
87
|
<view class="grid p-3 grid-cols-2 gap-2 box-border" v-if="listType === 'grid'">
|
|
73
88
|
<lcb-action-view
|
|
74
|
-
v-for="(item, index) in
|
|
89
|
+
v-for="(item, index) in renderList"
|
|
75
90
|
:key="`${item?.productId}:${index}`"
|
|
76
91
|
v-bind="item.link"
|
|
77
92
|
>
|
|
@@ -103,7 +118,7 @@ watch(
|
|
|
103
118
|
</view>
|
|
104
119
|
|
|
105
120
|
<view class="lcb-product-waterfall">
|
|
106
|
-
<u-waterfall :modelValue="
|
|
121
|
+
<u-waterfall :modelValue="renderList" v-if="listType === 'waterfall'" ref="uWaterfallRef">
|
|
107
122
|
<template #left="{ leftList: list }">
|
|
108
123
|
<view class="flex flex-col gap-3">
|
|
109
124
|
<lcb-action-view
|
|
@@ -174,7 +189,7 @@ watch(
|
|
|
174
189
|
<scroll-view v-if="listType == 'horizontal'" scroll-x>
|
|
175
190
|
<view class="p-3 whitespace-nowrap overflow-x-auto">
|
|
176
191
|
<view
|
|
177
|
-
v-for="(item, index) in
|
|
192
|
+
v-for="(item, index) in renderList"
|
|
178
193
|
:key="`${item?.productId}:${index}`"
|
|
179
194
|
class="inline-block"
|
|
180
195
|
:style="{
|
|
@@ -6,11 +6,15 @@ export interface LcbProductProps {
|
|
|
6
6
|
imageRadius?: number
|
|
7
7
|
borderRadius?: number
|
|
8
8
|
itemWidth?: number // 列表项宽度
|
|
9
|
-
items?:
|
|
9
|
+
items?: {
|
|
10
|
+
productId: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
}[]
|
|
10
13
|
form?: Record<string, any>
|
|
11
14
|
layoutType?: 'vertical' | 'horizontal' // 布局方式
|
|
12
15
|
titleLineClamp?: number
|
|
13
16
|
coverImgStyle?: Record<string, any>
|
|
17
|
+
filterList?: boolean
|
|
14
18
|
renderItemAbsoluteConfigLayout?: {
|
|
15
19
|
dataset?: Record<string, any>
|
|
16
20
|
blocks: any[]
|
package/package.json
CHANGED
|
@@ -5,7 +5,15 @@ declare function __VLS_template(): Readonly<{
|
|
|
5
5
|
item(props: { item: any }): any
|
|
6
6
|
}
|
|
7
7
|
declare const __VLS_component: import('vue').DefineComponent<
|
|
8
|
-
__VLS_WithDefaults<
|
|
8
|
+
__VLS_WithDefaults<
|
|
9
|
+
__VLS_TypePropsToOption<LcbProductProps>,
|
|
10
|
+
{
|
|
11
|
+
listType: string
|
|
12
|
+
imageWidth: number
|
|
13
|
+
imageHeight: number
|
|
14
|
+
titleLineClamp: number
|
|
15
|
+
}
|
|
16
|
+
>,
|
|
9
17
|
{},
|
|
10
18
|
unknown,
|
|
11
19
|
{},
|
|
@@ -17,30 +25,22 @@ declare const __VLS_component: import('vue').DefineComponent<
|
|
|
17
25
|
import('vue').PublicProps,
|
|
18
26
|
Readonly<
|
|
19
27
|
import('vue').ExtractPropTypes<
|
|
20
|
-
__VLS_WithDefaults<
|
|
28
|
+
__VLS_WithDefaults<
|
|
29
|
+
__VLS_TypePropsToOption<LcbProductProps>,
|
|
30
|
+
{
|
|
31
|
+
listType: string
|
|
32
|
+
imageWidth: number
|
|
33
|
+
imageHeight: number
|
|
34
|
+
titleLineClamp: number
|
|
35
|
+
}
|
|
36
|
+
>
|
|
21
37
|
>
|
|
22
38
|
>,
|
|
23
39
|
{
|
|
24
|
-
form: Record<string, any>
|
|
25
|
-
imageRadius: number
|
|
26
|
-
items: Record<string, any>[]
|
|
27
40
|
imageWidth: number
|
|
28
|
-
borderRadius: number
|
|
29
41
|
imageHeight: number
|
|
30
42
|
listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
|
|
31
43
|
titleLineClamp: number
|
|
32
|
-
layoutType: 'vertical' | 'horizontal'
|
|
33
|
-
itemWidth: number
|
|
34
|
-
coverImgStyle: Record<string, any>
|
|
35
|
-
renderItemAbsoluteConfigLayout: {
|
|
36
|
-
dataset?: Record<string, any>
|
|
37
|
-
blocks: any[]
|
|
38
|
-
canvas: {
|
|
39
|
-
width: number
|
|
40
|
-
height: number
|
|
41
|
-
backgroundColor?: string
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
44
|
},
|
|
45
45
|
{}
|
|
46
46
|
>
|
|
@@ -5,11 +5,15 @@ export interface LcbProductProps {
|
|
|
5
5
|
imageRadius?: number
|
|
6
6
|
borderRadius?: number
|
|
7
7
|
itemWidth?: number
|
|
8
|
-
items?:
|
|
8
|
+
items?: {
|
|
9
|
+
productId: string
|
|
10
|
+
[key: string]: any
|
|
11
|
+
}[]
|
|
9
12
|
form?: Record<string, any>
|
|
10
13
|
layoutType?: 'vertical' | 'horizontal'
|
|
11
14
|
titleLineClamp?: number
|
|
12
15
|
coverImgStyle?: Record<string, any>
|
|
16
|
+
filterList?: boolean
|
|
13
17
|
renderItemAbsoluteConfigLayout?: {
|
|
14
18
|
dataset?: Record<string, any>
|
|
15
19
|
blocks: any[]
|