@tplc/business 0.2.65 → 0.2.66

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,14 @@
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.66](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.65...v0.2.66) (2025-01-05)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * slider 改造 ([d472ee7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d472ee7a24b8539ec93defd27ab94cef14938d1f))
11
+ * 新增切换模式 ([a8849df](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/a8849df2d7ee55127f0b40c2c47f9e5c75cccab0))
12
+
5
13
  ### [0.2.65](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.52...v0.2.65) (2025-01-05)
6
14
 
7
15
  ### [0.2.64](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.63...v0.2.64) (2025-01-05)
@@ -35,14 +35,27 @@
35
35
  <lcb-product
36
36
  v-bind="{ ...attrs, form }"
37
37
  :listType="listType"
38
+ :imageWidth="imageWidth"
39
+ :imageHeight="imageHeight"
38
40
  :items="items"
41
+ :titleLineClamp="titleLineClamp"
42
+ :layoutType="layoutType"
39
43
  v-if="$slots.item"
40
44
  >
41
45
  <template #item="{ item }">
42
46
  <slot name="item" :item="item"></slot>
43
47
  </template>
44
48
  </lcb-product>
45
- <lcb-product v-bind="{ ...attrs, form }" :listType="listType" :items="items" v-else />
49
+ <lcb-product
50
+ v-bind="{ ...attrs, form }"
51
+ :imageWidth="imageWidth"
52
+ :listType="listType"
53
+ :items="items"
54
+ :imageHeight="imageHeight"
55
+ :layoutType="layoutType"
56
+ :titleLineClamp="titleLineClamp"
57
+ v-else
58
+ />
46
59
  </template>
47
60
  </FilterList>
48
61
  <lcb-map v-else-if="mode === 'map'" v-bind="{ ...info.listInfo, ...attrs }" />
@@ -56,7 +69,6 @@ import { getFilterDetail, LcbFilterResult } from './api'
56
69
  import FilterList from './components/FilterList/index.vue'
57
70
  import FilterView from './components/FilterView/index.vue'
58
71
  import { LcbListProps } from './types'
59
- import mockData from './components/FilterList/mockData'
60
72
  import { FORM_KEY } from '../../constants'
61
73
  import './index.scss'
62
74
  const attrs = useAttrs()
@@ -80,6 +92,8 @@ const props = withDefaults(defineProps<LcbListProps>(), {
80
92
  listType: 'list',
81
93
  isSticky: true,
82
94
  mode: 'list',
95
+ imageWidth: 250,
96
+ titleLineClamp: 2,
83
97
  // @ts-ignore
84
98
  pageListProps: () => ({
85
99
  productProps: {
@@ -6,9 +6,13 @@ export interface LcbListProps {
6
6
  pageListProps?: PageListProps
7
7
  border?: boolean
8
8
  styleMode?: 'default' | 'plain'
9
+ imageWidth?: number
10
+ imageHeight?: number
11
+ titleLineClamp?: number
9
12
  listType?: LcbProductProps['listType']
10
13
  isSticky?: boolean
11
14
  mode?: 'map' | 'list'
15
+ layoutType?: 'vertical' | 'horizontal'
12
16
  }
13
17
  export interface Option {
14
18
  label: string
@@ -2,6 +2,7 @@
2
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
+ import { transformValueUnit } from '../../utils/transform'
5
6
 
6
7
  const attrs = useAttrs()
7
8
  const uWaterfallRef = ref()
@@ -10,15 +11,16 @@ defineOptions({
10
11
  options: {
11
12
  addGlobalClass: true,
12
13
  virtualHost: true,
14
+ layoutType: 'vertical',
13
15
  styleIsolation: 'shared',
14
16
  },
15
17
  })
16
18
  const props = withDefaults(defineProps<LcbProductProps>(), {
17
19
  listType: 'list',
18
20
  items: [],
19
- imageWidthPercent: (1 / 3) * 100,
20
- imageHeightPercent: (260 / 670) * 100,
21
- itemHeight: 670,
21
+ imageWidth: 200,
22
+ imageHeight: 250,
23
+ titleLineClamp: 2,
22
24
  } as any)
23
25
  defineSlots<{
24
26
  item(props: { item: any }): any
@@ -34,6 +36,7 @@ watch(
34
36
 
35
37
  <template>
36
38
  <lcb-block v-bind="$props">
39
+ <!-- 单列 -->
37
40
  <view class="flex flex-col gap-2 p-3" v-if="listType === 'list'">
38
41
  <lcb-action-view
39
42
  v-for="(item, index) in items"
@@ -53,24 +56,27 @@ watch(
53
56
  <lcb-product-item
54
57
  v-else
55
58
  v-bind="{ ...item, ...attrs }"
59
+ :layoutType="layoutType"
56
60
  :coverImgStyle="{
57
- width: imageWidth ?? `${imageWidthPercent}%`,
58
- height: imageHeight ? `${imageHeight}rpx` : undefined,
59
- borderRadius: imageRadius ? `${imageRadius}rpx` : undefined,
61
+ width: layoutType === 'vertical' ? '100%' : transformValueUnit(imageWidth),
62
+ height: layoutType === 'vertical' ? transformValueUnit(imageHeight) : undefined,
63
+ minHeight: layoutType !== 'vertical' ? transformValueUnit(imageHeight) : undefined,
64
+ borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
60
65
  ...(attrs?.coverImgStyle ?? {}),
61
66
  }"
67
+ :titleLineClamp="titleLineClamp"
62
68
  ></lcb-product-item>
63
69
  </slot>
64
70
  </lcb-action-view>
65
71
  </view>
66
-
72
+ <!-- 双列 -->
67
73
  <view class="grid p-3 grid-cols-2 gap-2 box-border" v-if="listType === 'grid'">
68
74
  <lcb-action-view
69
75
  v-for="(item, index) in items"
70
76
  :key="`${item?.productId}:${index}`"
71
77
  v-bind="item.link"
72
78
  >
73
- <view class="rounded-md overflow-hidden" :style="{ height: `${itemHeight}rpx` }">
79
+ <view class="rounded-md overflow-hidden">
74
80
  <slot name="item" :item="item">
75
81
  <lcb-absolute-config-layout
76
82
  v-if="renderItemAbsoluteConfigLayout"
@@ -85,11 +91,13 @@ watch(
85
91
  v-else
86
92
  v-bind="{ ...item, ...attrs }"
87
93
  layoutType="vertical"
88
- className="!h-full"
89
94
  :coverImgStyle="{
90
- height: `${imageHeightPercent}%`,
95
+ width: '100%',
96
+ height: transformValueUnit(imageHeight),
97
+ borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
91
98
  ...(attrs?.coverImgStyle ?? {}),
92
99
  }"
100
+ :titleLineClamp="titleLineClamp"
93
101
  ></lcb-product-item>
94
102
  </slot>
95
103
  </view>
@@ -121,7 +129,7 @@ watch(
121
129
  v-bind="{ ...item, ...attrs }"
122
130
  layoutType="vertical"
123
131
  tag-overflow-wrap
124
- :title-line-clamp="2"
132
+ :titleLineClamp="titleLineClamp"
125
133
  >
126
134
  <template #coverImg="{ value }">
127
135
  <image :src="value" class="w-full" mode="widthFix" />
@@ -154,7 +162,7 @@ watch(
154
162
  v-bind="{ ...item, ...attrs }"
155
163
  layoutType="vertical"
156
164
  tag-overflow-wrap
157
- :title-line-clamp="2"
165
+ :titleLineClamp="titleLineClamp"
158
166
  >
159
167
  <template #coverImg="{ value }">
160
168
  <image :src="value" class="w-full" mode="widthFix" />
@@ -168,11 +176,12 @@ watch(
168
176
  </view>
169
177
 
170
178
  <scroll-view v-if="listType == 'horizontal'" scroll-x>
171
- <view class="p-2 flex gap-2 whitespace-nowrap overflow-auto flex-nowrap">
179
+ <view class="p-3 whitespace-nowrap overflow-x-auto">
172
180
  <view
173
181
  v-for="(item, index) in items"
174
182
  :key="`${item?.productId}:${index}`"
175
- class="!w-66vw flex-shrink-0"
183
+ class="inline-block"
184
+ :style="{ width: `${itemWidth}rpx`, marginLeft: index === 0 ? 0 : '24rpx' }"
176
185
  >
177
186
  <slot name="item" :item="item">
178
187
  <lcb-absolute-config-layout
@@ -184,7 +193,19 @@ watch(
184
193
  ...item,
185
194
  }"
186
195
  />
187
- <lcb-product-item v-else v-bind="item" imageClass="!w-1/2"></lcb-product-item>
196
+ <lcb-product-item
197
+ v-else
198
+ v-bind="item"
199
+ :layoutType="layoutType"
200
+ :coverImgStyle="{
201
+ width: layoutType === 'vertical' ? '100%' : transformValueUnit(imageWidth),
202
+ height: layoutType === 'vertical' ? transformValueUnit(imageHeight) : undefined,
203
+ minHeight: layoutType !== 'vertical' ? transformValueUnit(imageHeight) : undefined,
204
+ borderRadius: imageRadius ? transformValueUnit(imageRadius) : undefined,
205
+ ...(attrs?.coverImgStyle ?? {}),
206
+ }"
207
+ :titleLineClamp="titleLineClamp"
208
+ ></lcb-product-item>
188
209
  </slot>
189
210
  </view>
190
211
  </view>
@@ -1,14 +1,14 @@
1
1
  export interface LcbProductProps {
2
2
  // Define the component's prop types here
3
3
  listType?: 'list' | 'horizontal' | 'grid' | 'waterfall' // 1列表 2 左右滑动 3一行两个 4瀑布流
4
- imageWidthPercent?: number
5
- imageHeightPercent?: number
6
4
  imageWidth?: number
7
5
  imageHeight?: number
8
6
  imageRadius?: number
9
- itemHeight?: number // 列表项高度
7
+ itemWidth?: number // 列表项宽度
10
8
  items?: Record<string, any>[]
11
9
  form?: Record<string, any>
10
+ layoutType?: 'vertical' | 'horizontal' // 布局方式
11
+ titleLineClamp?: number
12
12
  renderItemAbsoluteConfigLayout?: {
13
13
  dataset?: Record<string, any>
14
14
  blocks: any[]
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { inject, computed, useAttrs } from 'vue'
2
+ import { inject, computed } from 'vue'
3
3
  import { isArray } from '@tplc/wot/components/common/util'
4
4
  import { formatJson } from '../../../utils/utils'
5
5
  defineOptions({
@@ -10,13 +10,10 @@ defineOptions({
10
10
  styleIsolation: 'shared',
11
11
  },
12
12
  })
13
- // const attrs = useAttrs()
14
13
 
15
14
  const itemProps: any = inject('lcb-product-item-props')
16
15
  const itemAttrs: any = inject('lcb-product-item-attrs')
17
16
 
18
- // console.log('itemAttrs', itemAttrs)
19
-
20
17
  const props = withDefaults(
21
18
  defineProps<{
22
19
  prop: string
@@ -143,7 +140,13 @@ const value = computed(() => {
143
140
 
144
141
  <slot :value="value" v-if="prop === 'level'" name="level">
145
142
  <view :class="className" :style="style" class="inline pl-1 relative top-[-3px]">
146
- <wd-rate :model-value="Number(value)" :num="value" readonly size="12px" space="2px" />
143
+ <wd-rate
144
+ :model-value="Number(value)"
145
+ :num="Number(value)"
146
+ readonly
147
+ size="12px"
148
+ space="2px"
149
+ />
147
150
  </view>
148
151
  </slot>
149
152
  <slot :value="value" v-if="prop === 'titleIcon'" name="titleIcon">
@@ -333,17 +336,20 @@ const value = computed(() => {
333
336
  -webkit-box-orient: vertical;
334
337
  -webkit-line-clamp: 1;
335
338
  overflow: hidden;
339
+ white-space: normal;
336
340
  }
337
341
  .line-clamp-2 {
338
342
  display: -webkit-box;
339
343
  -webkit-box-orient: vertical;
340
344
  -webkit-line-clamp: 2;
341
345
  overflow: hidden;
346
+ white-space: normal;
342
347
  }
343
348
  .line-clamp-3 {
344
349
  display: -webkit-box;
345
350
  -webkit-box-orient: vertical;
346
351
  -webkit-line-clamp: 3;
347
352
  overflow: hidden;
353
+ white-space: normal;
348
354
  }
349
355
  </style>
@@ -102,7 +102,7 @@ defineSlots<{
102
102
  <ItemValue
103
103
  v-if="!!$slots?.['coverImg']"
104
104
  prop="coverImg"
105
- customClass="w-1/3 h-[360rpx] bg-gray-100 rounded-sm overflow-hidden relative"
105
+ customClass=" bg-gray-100 rounded-sm overflow-hidden relative"
106
106
  >
107
107
  <template #default>
108
108
  <slot name="coverImgSection" />
@@ -114,7 +114,7 @@ defineSlots<{
114
114
  <ItemValue
115
115
  v-else
116
116
  prop="coverImg"
117
- customClass="w-1/3 h-[360rpx] bg-gray-100 rounded-sm overflow-hidden relative"
117
+ customClass=" bg-gray-100 rounded-sm overflow-hidden relative"
118
118
  >
119
119
  <template #default>
120
120
  <slot name="coverImgSection" />
@@ -282,33 +282,6 @@ defineSlots<{
282
282
  <view class="p-2 flex flex-col flex-1 text-26rpx overflow-hidden relative">
283
283
  <slot name="contentSection" />
284
284
  <view class="flex flex-col gap-[5px] overflow-hidden">
285
- <!-- <template
286
- v-for="propName in ['productName', 'subTitle', 'addressIntro', 'distance', 'tags']"
287
- :key="propName"
288
- >
289
- <ItemValue :prop="propName" v-if="!!$slots?.[propName]">
290
- <template #coverImg="{ value }"><slot name="coverImg" :value="value" /></template>
291
- <template #productName="{ value }"><slot name="productName" :value="value" /></template>
292
- <template #subTitle="{ value }"><slot name="subTitle" :value="value" /></template>
293
- <template #price="{ value }"><slot name="price" :value="value" /></template>
294
- <template #priceUnit="{ value }"><slot name="priceUnit" :value="value" /></template>
295
- <template #priceSuffix="{ value }">
296
- <slot name="priceSuffix" :value="value" />
297
- </template>
298
- <template #scribePrice="{ value }">
299
- <slot name="scribePrice" :value="value" />
300
- </template>
301
- <template #scribePriceUnit="{ value }">
302
- <slot name="scribePriceUnit" :value="value" />
303
- </template>
304
- <template #tags="{ value }"><slot name="tags" :value="value" /></template>
305
- <template #addressIntro="{ value }">
306
- <slot name="addressIntro" :value="value" />
307
- </template>
308
- <template #distance="{ value }"><slot name="distance" :value="value" /></template>
309
- </ItemValue>
310
- <ItemValue :prop="propName" v-else />
311
- </template> -->
312
285
  <view class="text-ellipsis line-clamp-2">
313
286
  <ItemValue prop="productName">
314
287
  <!-- <template #productName="{ value }"><slot name="productName" :value="value" /></template> -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.65",
3
+ "version": "0.2.66",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -20,12 +20,16 @@ declare const __VLS_component: import('vue').DefineComponent<
20
20
  >,
21
21
  {
22
22
  mode: 'map' | 'list'
23
+ imageWidth: number
24
+ imageHeight: number
23
25
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
24
26
  pageFilterType: string
25
27
  pageListProps: import('./components/FilterList/type').PageListProps
26
28
  border: boolean
27
29
  styleMode: 'default' | 'plain'
30
+ titleLineClamp: number
28
31
  isSticky: boolean
32
+ layoutType: 'vertical' | 'horizontal'
29
33
  },
30
34
  {}
31
35
  >
@@ -5,9 +5,13 @@ export interface LcbListProps {
5
5
  pageListProps?: PageListProps
6
6
  border?: boolean
7
7
  styleMode?: 'default' | 'plain'
8
+ imageWidth?: number
9
+ imageHeight?: number
10
+ titleLineClamp?: number
8
11
  listType?: LcbProductProps['listType']
9
12
  isSticky?: boolean
10
13
  mode?: 'map' | 'list'
14
+ layoutType?: 'vertical' | 'horizontal'
11
15
  }
12
16
  export interface Option {
13
17
  label: string
@@ -27,9 +27,9 @@ declare const __VLS_component: import('vue').DefineComponent<
27
27
  imageWidth: number
28
28
  imageHeight: number
29
29
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
30
- imageWidthPercent: number
31
- imageHeightPercent: number
32
- itemHeight: number
30
+ titleLineClamp: number
31
+ layoutType: 'vertical' | 'horizontal'
32
+ itemWidth: number
33
33
  renderItemAbsoluteConfigLayout: {
34
34
  dataset?: Record<string, any>
35
35
  blocks: any[]
@@ -1,13 +1,13 @@
1
1
  export interface LcbProductProps {
2
2
  listType?: 'list' | 'horizontal' | 'grid' | 'waterfall'
3
- imageWidthPercent?: number
4
- imageHeightPercent?: number
5
3
  imageWidth?: number
6
4
  imageHeight?: number
7
5
  imageRadius?: number
8
- itemHeight?: number
6
+ itemWidth?: number
9
7
  items?: Record<string, any>[]
10
8
  form?: Record<string, any>
9
+ layoutType?: 'vertical' | 'horizontal'
10
+ titleLineClamp?: number
11
11
  renderItemAbsoluteConfigLayout?: {
12
12
  dataset?: Record<string, any>
13
13
  blocks: any[]
@@ -153,9 +153,9 @@ declare const __VLS_component: import('vue').DefineComponent<
153
153
  >
154
154
  >,
155
155
  {
156
+ titleLineClamp: number
156
157
  layoutType: 'vertical' | 'horizontal'
157
158
  tagOverflowWrap: boolean
158
- titleLineClamp: number
159
159
  priceUnit: any
160
160
  scribePriceUnit: any
161
161
  tagType: import('@tplc/wot/components/wd-tag/types').TagType
@@ -1,70 +0,0 @@
1
- declare const _default: {
2
- code: string
3
- count: number
4
- data: {
5
- address: string
6
- agentId: string
7
- areaId: string
8
- areaName: string
9
- auditDateTime: string
10
- auditRemark: string
11
- auditStatus: number
12
- behindUnit: string
13
- bigIcon: boolean
14
- businessStatus: number
15
- cityAreaName: string
16
- cityId: string
17
- cityName: string
18
- clickCount: number
19
- collectCount: number
20
- collectFlag: boolean
21
- commentCount: number
22
- coverImg: string
23
- createDate: string
24
- distance: string
25
- hideTags: string
26
- hierarchy: number
27
- lastModifyDate: string
28
- latitude: string
29
- level: string
30
- longitude: string
31
- mapShowFlag: boolean
32
- marketingType: number
33
- merchantHeadId: string
34
- merchantId: string
35
- orderCount: number
36
- orderSkuCount: number
37
- peopleNumScope: string
38
- phone: string
39
- poiId: string
40
- poiName: string
41
- poiNameI18n: string
42
- poiType: string
43
- praiseCount: number
44
- praiseFlag: boolean
45
- price: number
46
- productId: string
47
- productName: string
48
- productNameI18n: string
49
- productType: string
50
- provinceId: string
51
- provinceName: string
52
- scribePrice: number
53
- showDateFlag: boolean
54
- startDateStr: string
55
- startTime: string
56
- status: number
57
- tags: string
58
- weightSort: string
59
- subTitle: string
60
- scoreAvg: number
61
- scoreTips: string
62
- titleIcon: string
63
- userInteractionInfo: string
64
- orderTips: string
65
- priceTips: string
66
- }[]
67
- dataClass: string
68
- traceId: string
69
- }
70
- export default _default