@tplc/business 0.7.41 → 0.7.43

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,35 @@
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.7.43](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.24...v0.7.43) (2026-01-04)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * **lcb-product-item, wd-img:** add titleOnImg prop to lcb-product-item and retain showMenuByLongpress in wd-img component ([3e40709](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/3e40709a04a4f7a7a8ab680d44eee7cfe27dab00))
11
+
12
+ ### [0.7.42](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.23...v0.7.42) (2026-01-04)
13
+
14
+
15
+ ### 💄 Styles | 风格
16
+
17
+ * Change padding-left of wd-select-picker label to 22rpx for improved layout consistency ([9d3c8e0](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/9d3c8e0799c0dca0ad414e4150d637fcd8b8ddad))
18
+
19
+
20
+ ### 🚀 Chore | 构建/工程依赖/工具
21
+
22
+ * **release:** 0.7.38 ([d034457](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d034457193dc731be1e53ae0fddae99b5e7add5a))
23
+ * **release:** 0.7.39 ([2215b79](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2215b799dfc33cf4036b92463d3414b76b948604))
24
+ * **release:** 0.7.40 ([184c675](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/184c675d9f8a6125f64f68679adb7df4fb2f525e))
25
+ * **release:** 0.7.41 ([e0b7505](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/e0b7505542e670c735b41089cc4cb7619649a315))
26
+
27
+
28
+ ### ✨ Features | 新功能
29
+
30
+ * **lcb-image, lcb-product-item, wd-img:** add showMenuByLongpress prop for long press menu functionality in WeChat Mini Program ([033f73c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/033f73c2dcf09fc4369986d25ee05385f9f78f94))
31
+ * **lcb-nav:** refactor lcb-nav component to use lcb-action-view for action rendering and add actionViewProps to ICapsule interface ([20f911f](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/20f911f2ed5db75ecbd7a7a58afdf2498f600b37))
32
+ * **utils:** update getSharePath to accept optional parameters for enhanced functionality ([c3c5fb3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c3c5fb36cbd7f97958d274820f7751ff4bb58ba7))
33
+
5
34
  ### [0.7.41](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.40...v0.7.41) (2026-01-03)
6
35
 
7
36
  ### [0.7.40](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.39...v0.7.40) (2026-01-03)
@@ -28,6 +28,7 @@
28
28
  :width="`${styleGroup == 3 ? transformValueUnit(imageSize) : '100%'}`"
29
29
  :src="item.url"
30
30
  :enable-preview="enablePreview"
31
+ :show-menu-by-longpress="showMenuByLongpress"
31
32
  :mode="imageHeight ? 'aspectFill' : 'widthFix'"
32
33
  :height="imageHeight ? transformValueUnit(imageHeight) : imagesHeight[index] || 'auto'"
33
34
  custom-class="overflow-hidden block"
@@ -7,6 +7,10 @@ export interface LcbImageProps {
7
7
  imageRadius?: number
8
8
  itemPadding?: number
9
9
  enablePreview?: boolean
10
+ /**
11
+ * 开启长按图片显示识别小程序码菜单,仅在微信小程序平台有效
12
+ */
13
+ showMenuByLongpress?: boolean
10
14
  marginHorizontal?: number
11
15
  imageMargin?: number
12
16
  imageSize?: number
@@ -29,6 +29,7 @@ defineSlots<{
29
29
  subTitle(props: { value: any }): any
30
30
  price(props: { value: any }): any
31
31
  priceUnit(props: { value: any }): any
32
+ pricePrefix(props: { value: any }): any
32
33
  priceSuffix(props: { value: any }): any
33
34
  scribePrice(props: { value: any }): any
34
35
  scribePriceUnit(props: { value: any }): any
@@ -186,6 +187,7 @@ const coverImgWidth = computed(() => {
186
187
  v-if="
187
188
  itemProps.showArea &&
188
189
  !itemProps.areaOnImg &&
190
+ !itemProps.titleOnImg &&
189
191
  itemAttrs.cityArea &&
190
192
  !value.includes('(') &&
191
193
  !value.includes('(')
@@ -325,6 +327,13 @@ const coverImgWidth = computed(() => {
325
327
  </view>
326
328
  </slot>
327
329
 
330
+ <!-- 售卖价前缀 -->
331
+ <slot :value="value" v-else-if="prop === 'pricePrefix'" name="pricePrefix">
332
+ <view :class="className" :style="style" class="text-22rpx">
333
+ {{ value }}
334
+ </view>
335
+ </slot>
336
+
328
337
  <!-- 价格标签 -->
329
338
  <slot :value="value" v-else-if="prop === 'priceTips'" name="priceTips">
330
339
  <view
@@ -35,6 +35,7 @@ const props = withDefaults(defineProps<LcbProductItemProps>(), {
35
35
  distanceTipsVisible: false,
36
36
  orderSkuCountTipsVisible: false,
37
37
  priceUnitVisible: true,
38
+ pricePrefixVisible: true,
38
39
  priceSuffixVisible: true,
39
40
  scribePriceVisible: true,
40
41
  scribePriceUnitVisible: true,
@@ -61,6 +62,7 @@ const props = withDefaults(defineProps<LcbProductItemProps>(), {
61
62
  itemContentPb: 10,
62
63
  itemContentPl: 0,
63
64
  itemGap: 10,
65
+ titleOnImg: false,
64
66
  })
65
67
  const attrs = useAttrs() as Record<string, any>
66
68
  provide('lcb-product-item-props', props)
@@ -74,6 +76,7 @@ defineSlots<{
74
76
  subTitle(props: { value: any }): any
75
77
  price(props: { value: any }): any
76
78
  priceUnit(props: { value: any }): any
79
+ pricePrefix(props: { value: any }): any
77
80
  priceSuffix(props: { value: any }): any
78
81
  scribePrice(props: { value: any }): any
79
82
  scribePriceUnit(props: { value: any }): any
@@ -125,6 +128,25 @@ const itemStyle = computed(() => {
125
128
  padding: `${transformValueUnit(props.itemVerticalPadding)} ${transformValueUnit(props.itemHorizontalPadding)}`,
126
129
  }
127
130
  })
131
+
132
+ const titleOnImgMaskStyle = computed(() => {
133
+ const maskDown = 'linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 100%)'
134
+ return {
135
+ background: maskDown,
136
+ }
137
+ })
138
+
139
+ const titleOnImgTextStyle = computed(() => {
140
+ const fontSize = attrs?.productNameFontSize ? `${attrs.productNameFontSize}rpx` : ''
141
+ const fontWeight = attrs?.productNameBold === true ? 'bold' : 'normal'
142
+ const color = attrs?.productNameColor || ''
143
+ return {
144
+ fontSize,
145
+ fontWeight,
146
+ color,
147
+ ...(props.productNameStyle || {}),
148
+ }
149
+ })
128
150
  </script>
129
151
 
130
152
  <template>
@@ -146,6 +168,30 @@ const itemStyle = computed(() => {
146
168
  >
147
169
  <template #default>
148
170
  <slot name="coverImgSection" />
171
+ <view
172
+ v-if="
173
+ titleOnImg &&
174
+ productNameVisible &&
175
+ !!productName &&
176
+ !(imgBottomIcon && imgBottomIconVisible)
177
+ "
178
+ class="absolute left-0 w-full z-1 p-1 box-border text-white text-shadow-xl bottom-0"
179
+ :style="titleOnImgMaskStyle"
180
+ >
181
+ <slot name="productName" :value="productName">
182
+ <view
183
+ :class="[
184
+ productNameClass,
185
+ 'inline text-[32rpx] font-bold',
186
+ `line-clamp-${titleLineClamp}`,
187
+ 'whitespace-pre-wrap',
188
+ ]"
189
+ :style="titleOnImgTextStyle"
190
+ >
191
+ {{ productName }}
192
+ </view>
193
+ </slot>
194
+ </view>
149
195
  </template>
150
196
  <template #coverImg="{ value }">
151
197
  <slot name="coverImg" :value="value" />
@@ -158,6 +204,30 @@ const itemStyle = computed(() => {
158
204
  >
159
205
  <template #default>
160
206
  <slot name="coverImgSection" />
207
+ <view
208
+ v-if="
209
+ titleOnImg &&
210
+ productNameVisible &&
211
+ !!productName &&
212
+ !(imgBottomIcon && imgBottomIconVisible)
213
+ "
214
+ class="absolute left-0 w-full z-1 p-1 box-border text-white text-shadow-xl bottom-0"
215
+ :style="titleOnImgMaskStyle"
216
+ >
217
+ <slot name="productName" :value="productName">
218
+ <view
219
+ :class="[
220
+ productNameClass,
221
+ 'inline text-[32rpx] font-bold',
222
+ `line-clamp-${titleLineClamp}`,
223
+ 'whitespace-pre-wrap',
224
+ ]"
225
+ :style="titleOnImgTextStyle"
226
+ >
227
+ {{ productName }}
228
+ </view>
229
+ </slot>
230
+ </view>
161
231
  </template>
162
232
  </ItemValue>
163
233
  <view
@@ -176,7 +246,7 @@ const itemStyle = computed(() => {
176
246
  <slot name="contentSection" />
177
247
  <view class="flex flex-col overflow-hidden" :style="{ gap: transformValueUnit(itemGap) }">
178
248
  <view>
179
- <ItemValue prop="productName">
249
+ <ItemValue prop="productName" v-if="!titleOnImg">
180
250
  <!-- <template #productName="{ value }"><slot name="productName" :value="value" /></template> -->
181
251
  </ItemValue>
182
252
  <ItemValue prop="level">
@@ -246,7 +316,13 @@ const itemStyle = computed(() => {
246
316
  marginTop: transformValueUnit(itemGap),
247
317
  }"
248
318
  >
249
- <view class="flex gap-1 justify-end">
319
+ <view
320
+ class="flex gap-1 justify-end"
321
+ :style="{
322
+ flexFlow: !priceAlignLeft ? 'row' : 'row-reverse',
323
+ width: priceAlignLeft ? '100%' : 'auto',
324
+ }"
325
+ >
250
326
  <view
251
327
  class="flex gap-[2rpx] items-end line-through"
252
328
  v-if="scribePriceVisible && isNumber(scribePrice)"
@@ -273,11 +349,10 @@ const itemStyle = computed(() => {
273
349
  class="flex gap-[4rpx] items-end justify-end"
274
350
  v-if="priceVisible && isNumber(price)"
275
351
  >
352
+ <ItemValue prop="pricePrefix" />
276
353
  <ItemValue prop="priceUnit" />
277
- <view class="flex items-end justify-center gap-0.5">
278
- <ItemValue prop="price" />
279
- <ItemValue prop="priceSuffix" />
280
- </view>
354
+ <ItemValue prop="price" />
355
+ <ItemValue prop="priceSuffix" />
281
356
  </view>
282
357
  </view>
283
358
  <ItemValue prop="priceTips">
@@ -323,6 +398,30 @@ const itemStyle = computed(() => {
323
398
  >
324
399
  <template #default>
325
400
  <slot name="coverImgSection" />
401
+ <view
402
+ v-if="
403
+ titleOnImg &&
404
+ productNameVisible &&
405
+ !!productName &&
406
+ !(imgBottomIcon && imgBottomIconVisible)
407
+ "
408
+ class="absolute left-0 w-full z-1 p-1 box-border text-white text-shadow-xl bottom-0"
409
+ :style="titleOnImgMaskStyle"
410
+ >
411
+ <slot name="productName" :value="productName">
412
+ <view
413
+ :class="[
414
+ productNameClass,
415
+ 'inline text-[32rpx] font-bold',
416
+ `line-clamp-${titleLineClamp}`,
417
+ 'whitespace-pre-wrap',
418
+ ]"
419
+ :style="titleOnImgTextStyle"
420
+ >
421
+ {{ productName }}
422
+ </view>
423
+ </slot>
424
+ </view>
326
425
  </template>
327
426
  <template #coverImg="{ value }">
328
427
  <slot name="coverImg" :value="value" />
@@ -331,6 +430,30 @@ const itemStyle = computed(() => {
331
430
  <ItemValue v-else prop="coverImg" customClass=" bg-gray-100 overflow-hidden relative">
332
431
  <template #default>
333
432
  <slot name="coverImgSection" />
433
+ <view
434
+ v-if="
435
+ titleOnImg &&
436
+ productNameVisible &&
437
+ !!productName &&
438
+ !(imgBottomIcon && imgBottomIconVisible)
439
+ "
440
+ class="absolute left-0 w-full z-1 p-1 box-border text-white text-shadow-xl bottom-0"
441
+ :style="titleOnImgMaskStyle"
442
+ >
443
+ <slot name="productName" :value="productName">
444
+ <view
445
+ :class="[
446
+ productNameClass,
447
+ 'inline text-[32rpx] font-bold',
448
+ `line-clamp-${titleLineClamp}`,
449
+ 'whitespace-pre-wrap',
450
+ ]"
451
+ :style="titleOnImgTextStyle"
452
+ >
453
+ {{ productName }}
454
+ </view>
455
+ </slot>
456
+ </view>
334
457
  </template>
335
458
  </ItemValue>
336
459
  <view
@@ -342,7 +465,7 @@ const itemStyle = computed(() => {
342
465
  <slot name="contentSection" />
343
466
  <view class="flex flex-col overflow-hidden" :style="{ gap: transformValueUnit(itemGap) }">
344
467
  <view>
345
- <ItemValue prop="productName">
468
+ <ItemValue prop="productName" v-if="!titleOnImg">
346
469
  <!-- <template #productName="{ value }"><slot name="productName" :value="value" /></template> -->
347
470
  </ItemValue>
348
471
 
@@ -427,11 +550,10 @@ const itemStyle = computed(() => {
427
550
  <ItemValue prop="scribePriceSuffix" />
428
551
  </view>
429
552
  <view class="flex gap-0.5 items-end" v-if="priceVisible && isNumber(price)">
553
+ <ItemValue prop="pricePrefix" />
430
554
  <ItemValue prop="priceUnit" />
431
- <view class="flex items-center justify-center gap-0.5">
432
- <ItemValue prop="price" />
433
- <ItemValue prop="priceSuffix" />
434
- </view>
555
+ <ItemValue prop="price" />
556
+ <ItemValue prop="priceSuffix" />
435
557
  </view>
436
558
  </view>
437
559
  <ItemValue prop="priceTips">
@@ -30,6 +30,7 @@ export interface LcbProductItemProps {
30
30
  subTitle?: any
31
31
  price?: any
32
32
  priceUnit?: any
33
+ pricePrefix?: any
33
34
  priceSuffix?: any
34
35
  priceTips?: any
35
36
  scribePrice?: any
@@ -55,6 +56,7 @@ export interface LcbProductItemProps {
55
56
  userInfoVisible?: boolean
56
57
  priceVisible?: boolean
57
58
  priceUnitVisible?: boolean
59
+ pricePrefixVisible?: boolean
58
60
  priceSuffixVisible?: boolean
59
61
  priceTipsVisible?: boolean
60
62
  scribePriceVisible?: boolean
@@ -79,6 +81,7 @@ export interface LcbProductItemProps {
79
81
  subTitleClass?: string
80
82
  priceClass?: string
81
83
  priceUnitClass?: string
84
+ pricePrefixClass?: string
82
85
  priceSuffixClass?: string
83
86
  priceTipsClass?: string
84
87
  scribePriceClass?: string
@@ -104,6 +107,7 @@ export interface LcbProductItemProps {
104
107
  subTitleStyle?: CSSProperties
105
108
  priceStyle?: CSSProperties
106
109
  priceUnitStyle?: CSSProperties
110
+ pricePrefixStyle?: CSSProperties
107
111
  priceSuffixStyle?: CSSProperties
108
112
  priceTipsStyle?: CSSProperties
109
113
  scribePriceStyle?: CSSProperties
@@ -139,4 +143,7 @@ export interface LcbProductItemProps {
139
143
 
140
144
  // 价格居左
141
145
  priceAlignLeft?: boolean
146
+
147
+ // 标题显示在图片上
148
+ titleOnImg?: boolean
142
149
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.41",
3
+ "version": "0.7.43",
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": "1.0.23"
14
+ "@tplc/wot": "1.0.24"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -5,6 +5,10 @@ export interface LcbImageProps {
5
5
  imageRadius?: number
6
6
  itemPadding?: number
7
7
  enablePreview?: boolean
8
+ /**
9
+ * 开启长按图片显示识别小程序码菜单,仅在微信小程序平台有效
10
+ */
11
+ showMenuByLongpress?: boolean
8
12
  marginHorizontal?: number
9
13
  imageMargin?: number
10
14
  imageSize?: number
@@ -6,6 +6,7 @@ declare function __VLS_template(): Readonly<{
6
6
  subTitle(props: { value: any }): any
7
7
  price(props: { value: any }): any
8
8
  priceUnit(props: { value: any }): any
9
+ pricePrefix(props: { value: any }): any
9
10
  priceSuffix(props: { value: any }): any
10
11
  scribePrice(props: { value: any }): any
11
12
  scribePriceUnit(props: { value: any }): any
@@ -32,6 +33,7 @@ declare function __VLS_template(): Readonly<{
32
33
  subTitle(props: { value: any }): any
33
34
  price(props: { value: any }): any
34
35
  priceUnit(props: { value: any }): any
36
+ pricePrefix(props: { value: any }): any
35
37
  priceSuffix(props: { value: any }): any
36
38
  scribePrice(props: { value: any }): any
37
39
  scribePriceUnit(props: { value: any }): any
@@ -7,6 +7,7 @@ declare function __VLS_template(): Readonly<{
7
7
  subTitle(props: { value: any }): any
8
8
  price(props: { value: any }): any
9
9
  priceUnit(props: { value: any }): any
10
+ pricePrefix(props: { value: any }): any
10
11
  priceSuffix(props: { value: any }): any
11
12
  scribePrice(props: { value: any }): any
12
13
  scribePriceUnit(props: { value: any }): any
@@ -40,6 +41,7 @@ declare function __VLS_template(): Readonly<{
40
41
  subTitle(props: { value: any }): any
41
42
  price(props: { value: any }): any
42
43
  priceUnit(props: { value: any }): any
44
+ pricePrefix(props: { value: any }): any
43
45
  priceSuffix(props: { value: any }): any
44
46
  scribePrice(props: { value: any }): any
45
47
  scribePriceUnit(props: { value: any }): any
@@ -90,6 +92,7 @@ declare const __VLS_component: import('vue').DefineComponent<
90
92
  distanceTipsVisible: boolean
91
93
  orderSkuCountTipsVisible: boolean
92
94
  priceUnitVisible: boolean
95
+ pricePrefixVisible: boolean
93
96
  priceSuffixVisible: boolean
94
97
  scribePriceVisible: boolean
95
98
  scribePriceUnitVisible: boolean
@@ -116,6 +119,7 @@ declare const __VLS_component: import('vue').DefineComponent<
116
119
  itemContentPb: number
117
120
  itemContentPl: number
118
121
  itemGap: number
122
+ titleOnImg: boolean
119
123
  }
120
124
  >,
121
125
  {},
@@ -152,6 +156,7 @@ declare const __VLS_component: import('vue').DefineComponent<
152
156
  distanceTipsVisible: boolean
153
157
  orderSkuCountTipsVisible: boolean
154
158
  priceUnitVisible: boolean
159
+ pricePrefixVisible: boolean
155
160
  priceSuffixVisible: boolean
156
161
  scribePriceVisible: boolean
157
162
  scribePriceUnitVisible: boolean
@@ -178,6 +183,7 @@ declare const __VLS_component: import('vue').DefineComponent<
178
183
  itemContentPb: number
179
184
  itemContentPl: number
180
185
  itemGap: number
186
+ titleOnImg: boolean
181
187
  }
182
188
  >
183
189
  >
@@ -211,6 +217,7 @@ declare const __VLS_component: import('vue').DefineComponent<
211
217
  userInfoVisible: boolean
212
218
  priceVisible: boolean
213
219
  priceUnitVisible: boolean
220
+ pricePrefixVisible: boolean
214
221
  priceSuffixVisible: boolean
215
222
  priceTipsVisible: boolean
216
223
  scribePriceVisible: boolean
@@ -229,6 +236,7 @@ declare const __VLS_component: import('vue').DefineComponent<
229
236
  orderTipsVisible: boolean
230
237
  distanceTipsVisible: boolean
231
238
  orderSkuCountTipsVisible: boolean
239
+ titleOnImg: boolean
232
240
  },
233
241
  {}
234
242
  >
@@ -27,6 +27,7 @@ export interface LcbProductItemProps {
27
27
  subTitle?: any
28
28
  price?: any
29
29
  priceUnit?: any
30
+ pricePrefix?: any
30
31
  priceSuffix?: any
31
32
  priceTips?: any
32
33
  scribePrice?: any
@@ -51,6 +52,7 @@ export interface LcbProductItemProps {
51
52
  userInfoVisible?: boolean
52
53
  priceVisible?: boolean
53
54
  priceUnitVisible?: boolean
55
+ pricePrefixVisible?: boolean
54
56
  priceSuffixVisible?: boolean
55
57
  priceTipsVisible?: boolean
56
58
  scribePriceVisible?: boolean
@@ -74,6 +76,7 @@ export interface LcbProductItemProps {
74
76
  subTitleClass?: string
75
77
  priceClass?: string
76
78
  priceUnitClass?: string
79
+ pricePrefixClass?: string
77
80
  priceSuffixClass?: string
78
81
  priceTipsClass?: string
79
82
  scribePriceClass?: string
@@ -98,6 +101,7 @@ export interface LcbProductItemProps {
98
101
  subTitleStyle?: CSSProperties
99
102
  priceStyle?: CSSProperties
100
103
  priceUnitStyle?: CSSProperties
104
+ pricePrefixStyle?: CSSProperties
101
105
  priceSuffixStyle?: CSSProperties
102
106
  priceTipsStyle?: CSSProperties
103
107
  scribePriceStyle?: CSSProperties
@@ -130,4 +134,5 @@ export interface LcbProductItemProps {
130
134
  itemContentPb?: number
131
135
  itemContentPl?: number
132
136
  priceAlignLeft?: boolean
137
+ titleOnImg?: boolean
133
138
  }