@tplc/business 0.2.37 → 0.2.38

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 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.38](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.47...v0.2.38) (2024-12-26)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 图片支持渐进式 ([08523e0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/08523e0eb244da1da3b46dca4d999360600edcf5))
11
+
5
12
  ### [0.2.37](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.31...v0.2.37) (2024-12-26)
6
13
 
7
14
 
@@ -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 v-bind="{ ...attrs }" :listType="listType" :items="items" v-if="$slots.item">
35
+ <lcb-product
36
+ v-bind="{ ...attrs, form }"
37
+ :listType="listType"
38
+ :items="items"
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="{ ...attrs }" :listType="listType" :items="items" v-else></lcb-product>
45
+ <lcb-product v-bind="{ ...attrs, form }" :listType="listType" :items="items" v-else />
41
46
  </template>
42
47
  </FilterList>
43
48
  </template>
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
- import { computed, useAttrs } from 'vue'
2
+ import { ref, useAttrs, watch } from 'vue'
3
3
  import UWaterfall from 'uview-plus/components/u-waterfall/u-waterfall.vue'
4
4
  import { LcbProductProps } from './types'
5
5
 
6
6
  const attrs = useAttrs()
7
+ const uWaterfallRef = ref()
7
8
  defineOptions({
8
9
  name: 'LcbProduct',
9
10
  options: {
@@ -22,6 +23,13 @@ const props = withDefaults(defineProps<LcbProductProps>(), {
22
23
  defineSlots<{
23
24
  item(props: { item: any }): any
24
25
  }>()
26
+ watch(
27
+ () => props.form,
28
+ () => {
29
+ uWaterfallRef.value?.clear?.()
30
+ },
31
+ { deep: true },
32
+ )
25
33
  </script>
26
34
 
27
35
  <template>
@@ -51,33 +59,7 @@ defineSlots<{
51
59
  borderRadius: imageRadius ? `${imageRadius}rpx` : undefined,
52
60
  ...(attrs?.coverImgStyle ?? {}),
53
61
  }"
54
- >
55
- <!-- <template #itemTopSection>
56
- <view class="min-w-10 min-h-10 bg-red-500/50"></view>
57
- </template>
58
- <template #itemBottomSection>
59
- <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
60
- </template>
61
- <template #itemLeftSection>
62
- <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
63
- </template>
64
- <template #itemRightSection>
65
- <view class="min-w-10 min-h-10 bg-green-500/50"></view>
66
- </template> -->
67
-
68
- <!-- <template #imageSection>
69
- <view class="min-w-5 min-h-5 bg-yellow-400 right-1 top-1 absolute z-10"></view>
70
- </template>
71
-
72
- <template #itemSection>
73
- <view class="min-w-10 min-h-10 bg-blue-500/50 right-0 top-0 absolute z-10"></view>
74
- </template>
75
- <template #contentSection>
76
- <view
77
- class="min-w-15 min-h-15 bg-gray-500/20 right-10 top-10 absolute z-10 rounded-full"
78
- ></view>
79
- </template> -->
80
- </lcb-product-item>
62
+ ></lcb-product-item>
81
63
  </slot>
82
64
  </lcb-action-view>
83
65
  </view>
@@ -105,142 +87,83 @@ defineSlots<{
105
87
  height: imageHeight ?? `${imageHeightPercent}%`,
106
88
  ...(attrs?.coverImgStyle ?? {}),
107
89
  }"
108
- >
109
- <!-- <template #itemTopSection>
110
- <view class="min-w-10 min-h-10 bg-red-500/50"></view>
111
- </template>
112
- <template #itemBottomSection>
113
- <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
114
- </template>
115
- <template #itemLeftSection>
116
- <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
117
- </template>
118
- <template #itemRightSection>
119
- <view class="min-w-10 min-h-10 bg-green-500/50"></view>
120
- </template> -->
121
- </lcb-product-item>
90
+ ></lcb-product-item>
122
91
  </slot>
123
92
  </view>
124
93
  </view>
125
94
  </view>
126
95
  </view>
127
96
 
128
- <u-waterfall :modelValue="items" v-if="listType === 'waterfall'" class="flex gap-3 p-3">
129
- <template #left="{ leftList: list }">
130
- <view class="flex flex-col gap-3">
131
- <view
132
- v-for="(item, index) in list"
133
- :key="`${item?.productId}:${index}`"
134
- class="rounded overflow-hidden"
135
- >
136
- <slot name="item" :item="item">
137
- <lcb-absolute-config-layout
138
- v-if="renderItemAbsoluteConfigLayout"
139
- :blocks="renderItemAbsoluteConfigLayout?.blocks"
140
- :canvas="renderItemAbsoluteConfigLayout?.canvas"
141
- :dataset="{
142
- ...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
143
- ...item,
144
- }"
145
- />
146
- <lcb-product-item
147
- v-else
148
- v-bind="{ ...item, ...attrs }"
149
- layoutType="vertical"
150
- tag-overflow-wrap
151
- :title-line-clamp="2"
152
- >
153
- <template #coverImg="{ value }">
154
- <image :src="value" class="w-full" mode="widthFix" />
155
- </template>
156
- <!-- <template #itemTopSection>
157
- <view class="min-w-10 min-h-10 bg-red-500/50"></view>
158
- </template>
159
- <template #itemBottomSection>
160
- <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
161
- </template>
162
- <template #itemLeftSection>
163
- <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
164
- </template>
165
- <template #itemRightSection>
166
- <view class="min-w-10 min-h-10 bg-green-500/50"></view>
167
- </template> -->
168
-
169
- <!-- <template #imageSection>
170
- <view class="min-w-5 min-h-5 bg-yellow-400 right-1 top-1 absolute z-10"></view>
171
- </template>
172
-
173
- <template #itemSection>
174
- <view class="min-w-10 min-h-10 bg-blue-500/50 right-0 top-0 absolute z-10"></view>
175
- </template>
176
- <template #contentSection>
177
- <view
178
- class="min-w-15 min-h-15 bg-gray-500/20 right-10 top-10 absolute z-10 rounded-full"
179
- ></view>
180
- </template> -->
181
- </lcb-product-item>
182
- </slot>
97
+ <view class="lcb-product-waterfall">
98
+ <u-waterfall :modelValue="items" v-if="listType === 'waterfall'" ref="uWaterfallRef">
99
+ <template #left="{ leftList: list }">
100
+ <view class="flex flex-col gap-3">
101
+ <lcb-action-view
102
+ v-for="(item, index) in list"
103
+ :key="`${item?.productId}:${index}`"
104
+ custom-class="!rounded !overflow-hidden"
105
+ v-bind="item.link"
106
+ >
107
+ <slot name="item" :item="item">
108
+ <lcb-absolute-config-layout
109
+ v-if="renderItemAbsoluteConfigLayout"
110
+ :blocks="renderItemAbsoluteConfigLayout?.blocks"
111
+ :canvas="renderItemAbsoluteConfigLayout?.canvas"
112
+ :dataset="{
113
+ ...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
114
+ ...item,
115
+ }"
116
+ />
117
+ <lcb-product-item
118
+ v-else
119
+ v-bind="{ ...item, ...attrs }"
120
+ layoutType="vertical"
121
+ tag-overflow-wrap
122
+ :title-line-clamp="2"
123
+ >
124
+ <template #coverImg="{ value }">
125
+ <image :src="value" class="w-full" mode="widthFix" />
126
+ </template>
127
+ </lcb-product-item>
128
+ </slot>
129
+ </lcb-action-view>
183
130
  </view>
184
- </view>
185
- </template>
186
- <template #right="{ rightList: list }">
187
- <view class="flex flex-col gap-3">
188
- <view
189
- v-for="(item, index) in list"
190
- :key="`${item?.productId}:${index}`"
191
- class="rounded overflow-hidden"
192
- >
193
- <slot name="item" :item="item">
194
- <lcb-absolute-config-layout
195
- v-if="renderItemAbsoluteConfigLayout"
196
- :blocks="renderItemAbsoluteConfigLayout?.blocks"
197
- :canvas="renderItemAbsoluteConfigLayout?.canvas"
198
- :dataset="{
199
- ...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
200
- ...item,
201
- }"
202
- />
203
- <lcb-product-item
204
- v-else
205
- v-bind="{ ...item, ...attrs }"
206
- layoutType="vertical"
207
- tag-overflow-wrap
208
- :title-line-clamp="2"
209
- >
210
- <template #coverImg="{ value }">
211
- <image :src="value" class="w-full" mode="widthFix" />
212
- </template>
213
- <!-- <template #itemTopSection>
214
- <view class="min-w-10 min-h-10 bg-red-500/50"></view>
215
- </template>
216
- <template #itemBottomSection>
217
- <view class="min-w-10 min-h-10 bg-yellow-500/50"></view>
218
- </template>
219
- <template #itemLeftSection>
220
- <view class="min-w-10 min-h-10 bg-blue-500/50"></view>
221
- </template>
222
- <template #itemRightSection>
223
- <view class="min-w-10 min-h-10 bg-green-500/50"></view>
224
- </template> -->
225
-
226
- <!-- <template #imageSection>
227
- <view class="min-w-5 min-h-5 bg-yellow-400 right-1 top-1 absolute z-10"></view>
228
- </template>
229
-
230
- <template #itemSection>
231
- <view class="min-w-10 min-h-10 bg-blue-500/50 right-0 top-0 absolute z-10"></view>
232
- </template>
233
- <template #contentSection>
234
- <view
235
- class="min-w-15 min-h-15 bg-gray-500/20 right-10 top-10 absolute z-10 rounded-full"
236
- ></view>
237
- </template> -->
238
- </lcb-product-item>
239
- </slot>
131
+ </template>
132
+ <template #right="{ rightList: list }">
133
+ <view class="flex flex-col gap-3">
134
+ <lcb-action-view
135
+ v-for="(item, index) in list"
136
+ :key="`${item?.productId}:${index}`"
137
+ custom-class="!rounded !overflow-hidden"
138
+ v-bind="item.link"
139
+ >
140
+ <slot name="item" :item="item">
141
+ <lcb-absolute-config-layout
142
+ v-if="renderItemAbsoluteConfigLayout"
143
+ :blocks="renderItemAbsoluteConfigLayout?.blocks"
144
+ :canvas="renderItemAbsoluteConfigLayout?.canvas"
145
+ :dataset="{
146
+ ...(renderItemAbsoluteConfigLayout?.dataset ?? {}),
147
+ ...item,
148
+ }"
149
+ />
150
+ <lcb-product-item
151
+ v-else
152
+ v-bind="{ ...item, ...attrs }"
153
+ layoutType="vertical"
154
+ tag-overflow-wrap
155
+ :title-line-clamp="2"
156
+ >
157
+ <template #coverImg="{ value }">
158
+ <image :src="value" class="w-full" mode="widthFix" />
159
+ </template>
160
+ </lcb-product-item>
161
+ </slot>
162
+ </lcb-action-view>
240
163
  </view>
241
- </view>
242
- </template>
243
- </u-waterfall>
164
+ </template>
165
+ </u-waterfall>
166
+ </view>
244
167
 
245
168
  <scroll-view v-if="listType == 'horizontal'" scroll-x>
246
169
  <view class="p-2 flex gap-2 whitespace-nowrap overflow-auto flex-nowrap">
@@ -267,4 +190,12 @@ defineSlots<{
267
190
  </lcb-block>
268
191
  </template>
269
192
 
270
- <style lang="scss" scoped></style>
193
+ <style lang="scss" scoped>
194
+ .lcb-product-waterfall {
195
+ :deep(.u-waterfall) {
196
+ display: flex;
197
+ gap: 24rpx;
198
+ padding: 24rpx;
199
+ }
200
+ }
201
+ </style>
@@ -8,6 +8,7 @@ export interface LcbProductProps {
8
8
  imageRadius?: number
9
9
  itemHeight?: number // 列表项高度
10
10
  items?: Record<string, any>[]
11
+ form?: Record<string, any>
11
12
  renderItemAbsoluteConfigLayout?: {
12
13
  dataset?: Record<string, any>
13
14
  blocks: any[]
@@ -16,7 +16,6 @@ defineOptions({
16
16
  },
17
17
  })
18
18
  const props = withDefaults(defineProps<LcbRichTextProps>(), {})
19
- console.log('props', props)
20
19
  </script>
21
20
 
22
21
  <style lang="scss" scoped></style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "peerDependencies": {
13
13
  "vue": ">=3.2.47",
14
- "@tplc/wot": "0.1.46"
14
+ "@tplc/wot": "0.1.47"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -21,6 +21,7 @@ declare const __VLS_component: import('vue').DefineComponent<
21
21
  >
22
22
  >,
23
23
  {
24
+ form: Record<string, any>
24
25
  imageRadius: number
25
26
  items: Record<string, any>[]
26
27
  imageWidth: number
@@ -7,6 +7,7 @@ export interface LcbProductProps {
7
7
  imageRadius?: number
8
8
  itemHeight?: number
9
9
  items?: Record<string, any>[]
10
+ form?: Record<string, any>
10
11
  renderItemAbsoluteConfigLayout?: {
11
12
  dataset?: Record<string, any>
12
13
  blocks: any[]