@tplc/business 0.7.56 → 0.7.58

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,38 @@
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.58](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.57...v0.7.58) (2026-01-09)
6
+
7
+
8
+ ### 🐛 Bug Fixes | Bug 修复
9
+
10
+ * **lcb-wrapper-list:** update dynamicScope handling and improve page limit configuration ([871bd0d](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/871bd0dae7c499bd184b7fcfc1b09ecae4553d22))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * **lcb-product-item, lcb-tabs, wd-img, wd-tab:** enhance component functionality with new computed properties and style adjustments ([45f0e74](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/45f0e749af0ae4425588b6e5ec44eac8c4a61b6a))
16
+ * **lcb-title:** add moreFontWeight prop to customize font weight ([882ca54](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/882ca542b69a87852b136839997ab6b35c687744))
17
+ * **lcb-title:** introduce moreFontWeight prop for enhanced font weight customization ([c67c765](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c67c76567c4bea97920e5e440914cce5022db0f7))
18
+
19
+ ### [0.7.57](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.55...v0.7.57) (2026-01-09)
20
+
21
+
22
+ ### ✨ Features | 新功能
23
+
24
+ * **lcb-tabs:** add defaultIndex prop to tabs components and update useSyncForm to accept visibleScope ([d46356f](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d46356f58a2c8b8f035a036d53e39fee0de9e69d))
25
+ * **lcb-wrapper-list:** enhance data handling by adding dynamicScope support and improving form synchronization ([48a562c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/48a562c69d1037073b1bff62b4491959c0ac5ea0))
26
+
27
+
28
+ ### 🚀 Chore | 构建/工程依赖/工具
29
+
30
+ * **release:** 0.7.56 ([1b2216c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1b2216c1e81bdf60b85b9c179f614bb37c0588e5))
31
+
32
+
33
+ ### 🐛 Bug Fixes | Bug 修复
34
+
35
+ * **lcb-tabs:** update currentTab initialization to use item name based on defaultIndex ([aad2d22](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/aad2d22403c8c3ee8987fcdeb153f4637c9594a0))
36
+
5
37
  ### [0.7.56](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.54...v0.7.56) (2026-01-08)
6
38
 
7
39
 
package/action.d.ts CHANGED
@@ -23,8 +23,8 @@ export interface DataSource {
23
23
  requestInfo?: {
24
24
  requestUrl: string
25
25
  requestParams: string
26
- dynamicScope?: string
27
26
  }
27
+ dynamicScope?: string
28
28
  /** 动态key */
29
29
  dependKey?: string
30
30
  }
@@ -3,7 +3,7 @@ import { computed, provide, useAttrs } from 'vue'
3
3
  import { LcbProductItemProps } from './types'
4
4
  import ItemValue from './components/ItemValue.vue'
5
5
  import { transformValueUnit } from '../../utils/transform'
6
- import { videoPreviewProps } from '@tplc/wot/types/components/wd-video-preview/types'
6
+ import { formatJson } from '../../utils/utils'
7
7
  defineOptions({
8
8
  name: 'LcbProductItem',
9
9
  options: {
@@ -192,6 +192,52 @@ const imgOverlayVisible = computed(() => {
192
192
  priceOnImgVisible.value
193
193
  )
194
194
  })
195
+
196
+ // 判断底部内容区域是否有内容需要显示
197
+ const contentAreaVisible = computed(() => {
198
+ // 产品名(如果不在图片上显示)
199
+ if (!props.titleOnImg && props.productNameVisible && props.productName) return true
200
+
201
+ // level
202
+ if (props.levelVisible && props.level && Number(props.level)) return true
203
+
204
+ // titleIcon
205
+ if (props.titleIconVisible && props.titleIcon) return true
206
+
207
+ // 评分区域
208
+ if (props.scoreAvgVisible && isNumber(props.scoreAvg)) return true
209
+ if (props.scoreTipsVisible && props.scoreTips) return true
210
+ if (props.userInteractionInfoVisible && props.userInteractionInfo) return true
211
+
212
+ // 地址(如果不在图片上显示)
213
+ if (props.addressIntroVisible && !props.addressOnImg && props.addressIntro) return true
214
+
215
+ // 副标题
216
+ if (props.subTitleVisible && props.subTitle) return true
217
+
218
+ // 标签
219
+ const tags = formatJson(props.tags as any, []) as any[]
220
+ if (props.tagsVisible && Array.isArray(tags) && tags.length > 0) return true
221
+
222
+ // 订单相关
223
+ if (props.orderSkuCountTipsVisible && props.orderSkuCountTips) return true
224
+ if (props.orderTipsVisible && props.orderTips) return true
225
+
226
+ // 距离提示
227
+ if (props.distanceTipsVisible && props.distanceTips) return true
228
+
229
+ // 价格区域(如果不在图片上显示)
230
+ if (!props.priceOnImg) {
231
+ if (props.scribePriceVisible && isNumber(props.scribePrice)) return true
232
+ if (props.priceVisible && isNumber(props.price)) return true
233
+ if (props.priceTipsVisible && props.priceTips) return true
234
+ }
235
+
236
+ // 用户信息
237
+ if (props.userInfoVisible && (props.headImg || props.userName)) return true
238
+
239
+ return false
240
+ })
195
241
  </script>
196
242
 
197
243
  <template>
@@ -388,6 +434,7 @@ const imgOverlayVisible = computed(() => {
388
434
  </template>
389
435
  </ItemValue>
390
436
  <view
437
+ v-if="contentAreaVisible"
391
438
  class="flex flex-col flex-1 text-26rpx overflow-hidden relative box-border"
392
439
  :class="{
393
440
  grayscale: attrs.rightBottomFlag,
@@ -724,6 +771,7 @@ const imgOverlayVisible = computed(() => {
724
771
  </template>
725
772
  </ItemValue>
726
773
  <view
774
+ v-if="contentAreaVisible"
727
775
  class="p-2 flex flex-col flex-1 text-26rpx overflow-hidden relative"
728
776
  :class="{
729
777
  grayscale: attrs.rightBottomFlag,
@@ -15,8 +15,9 @@
15
15
  :inactiveColor="tagTitleInactiveColor"
16
16
  :color="tagTitleActiveColor"
17
17
  v-model="currentTab"
18
+ animated
18
19
  >
19
- <wd-tab v-for="tab in items" :key="tab.name" :title="tab.title" :name="tab.name" />
20
+ <wd-tab v-for="tab in items" :key="tab.name" :title="tab.title" :name="tab.name" animated />
20
21
  </wd-tabs>
21
22
  </lcb-block>
22
23
  </template>
@@ -42,7 +43,7 @@ const props = withDefaults(defineProps<LcbTabsProps>(), {
42
43
  slidableNum: 6,
43
44
  defaultIndex: 0,
44
45
  })
45
- const currentTab = ref(props.defaultIndex)
46
+ const currentTab = ref(props.items?.[props.defaultIndex]?.name)
46
47
  const { syncForm } = useSyncForm({
47
48
  dynamicScope: props.dynamicScope,
48
49
  visibleScope: props.visibleScope,
@@ -1,72 +1,63 @@
1
1
  <template>
2
2
  <lcb-block v-bind="$props">
3
- <view
4
- :class="{
5
- 'flex flex-wrap': tagsMode === 'tiled',
6
- 'flex whitespace-nowrap overflow-x-auto': tagsMode === 'scroll',
7
- }"
8
- :style="{
9
- gap: transformValueUnit(gap),
10
- }"
3
+ <wd-tabs
4
+ custom-class="!bg-transparent"
5
+ @change="handleChange"
6
+ :lineWidth="lineWidth"
7
+ :lineHeight="lineHeight"
8
+ :slidable="slidable"
9
+ :slidableNum="slidableNum"
10
+ :itemFontSize="itemFontSize"
11
+ :activeFontSize="tabActiveFontSize"
12
+ :activeFontWeight="tabActiveFontWeight"
13
+ :itemFontWeight="tabInactiveFontWeight"
14
+ ref="tabs"
15
+ :inactiveColor="tagTitleInactiveColor"
16
+ :color="tagTitleActiveColor"
17
+ v-model="currentTab"
18
+ animated
11
19
  >
12
- <view
13
- v-for="(item, index) in items"
14
- :key="index"
15
- class="lcb-tag text-center"
16
- :class="{
17
- 'lcb-tag-active': current === index,
18
- 'inline-block': tagsMode === 'scroll',
19
- }"
20
- :style="{
21
- fontSize: transformValueUnit(itemFontSize),
22
- backgroundColor: current === index ? tagActiveColor : tagInactiveColor,
23
- color: current === index ? tagTitleActiveColor : tagTitleInactiveColor,
24
- borderRadius: transformValueUnit(tagRadius),
25
- minWidth: transformValueUnit(tagMinWidth),
26
- }"
27
- @click="handleTagClick(item.name, index)"
28
- >
29
- {{ item.title }}
30
- </view>
31
- </view>
20
+ <wd-tab v-for="tab in items" :key="tab.name" :title="tab.title" :name="tab.name" animated />
21
+ </wd-tabs>
32
22
  </lcb-block>
33
23
  </template>
34
24
 
35
25
  <script setup lang="ts">
36
- import { ref } from 'vue'
26
+ import { ref, watch } from 'vue'
37
27
  import useSyncForm from '../../../../hooks/useSyncForm'
38
- import { transformValueUnit } from '../../../../utils/transform'
39
28
  import { LcbTabsProps } from '../../types'
40
- const props = withDefaults(defineProps<LcbTabsProps>(), {
41
- tagActiveColor: 'var(--wot-color-theme)',
42
- tagInactiveColor: '#eeeeee',
43
- tagTitleActiveColor: '#ffffff',
44
- tagTitleInactiveColor: '#000000',
45
- tagRadius: 100,
46
- defaultIndex: 0,
47
- })
48
- const { syncForm } = useSyncForm({
49
- dynamicScope: props.dynamicScope,
50
- visibleScope: props.visibleScope,
51
- })
52
- const current = ref(props.defaultIndex)
53
29
  defineOptions({
54
- name: 'LcbTagsItem',
30
+ name: 'LcbTabsItem',
55
31
  options: {
56
32
  addGlobalClass: true,
57
33
  virtualHost: true,
58
34
  styleIsolation: 'shared',
59
35
  },
60
36
  })
61
- const handleTagClick = (name: string, index: number) => {
62
- current.value = index
63
- syncForm(JSON.parse(name))
37
+
38
+ const tabs = ref()
39
+ const props = withDefaults(defineProps<LcbTabsProps>(), {
40
+ lineWidth: 19,
41
+ lineHeight: 3,
42
+ slidable: 'auto',
43
+ slidableNum: 6,
44
+ defaultIndex: 0,
45
+ })
46
+ const currentTab = ref(props.items?.[props.defaultIndex]?.name)
47
+ const { syncForm } = useSyncForm({
48
+ dynamicScope: props.dynamicScope,
49
+ visibleScope: props.visibleScope,
50
+ })
51
+ const handleChange = (e: { name: string }) => {
52
+ syncForm(JSON.parse(e.name))
64
53
  }
65
- handleTagClick(props.items[current.value]?.name, current.value)
54
+ watch(
55
+ () => [props.lineWidth, props.lineHeight, props.slidable, props.slidableNum],
56
+ () => {
57
+ tabs.value.updateLineStyle(true)
58
+ },
59
+ )
60
+ syncForm(JSON.parse(currentTab.value || '{}'))
66
61
  </script>
67
62
 
68
- <style lang="scss" scoped>
69
- .lcb-tag {
70
- padding: 8rpx 32rpx;
71
- }
72
- </style>
63
+ <style lang="scss" scoped></style>
@@ -55,6 +55,7 @@
55
55
  fontSize: transformValueUnit(moreFontSize),
56
56
  color: moreColor,
57
57
  alignSelf: moreVerticalAlign,
58
+ fontWeight: moreFontWeight,
58
59
  }"
59
60
  >
60
61
  <lcb-button mode="noStyle" :text="moreText" :keyFromUser="moreKeyFromUser" />
@@ -98,6 +99,7 @@ const props = withDefaults(defineProps<LcbTitleProps>(), {
98
99
  size: '28',
99
100
  iconType: 'icon',
100
101
  iconColor: '#000',
102
+ moreFontWeight: 400,
101
103
  })
102
104
  const customStyle = computed(() => {
103
105
  return props.iconRight ? `margin-right:${transformValueUnit(props.iconRight)}` : ''
@@ -31,6 +31,7 @@ export interface LcbTitleProps
31
31
  moreText?: string
32
32
  moreVerticalAlign?: 'end' | 'center'
33
33
  moreKeyFromUser?: boolean
34
+ moreFontWeight?: number
34
35
  iconColor?: string
35
36
  iconRight?: number
36
37
  iconSize?: number
@@ -53,17 +53,16 @@ const props = withDefaults(defineProps<LcbWrapperListProps>(), {
53
53
  display: 'flex',
54
54
  flexDirection: 'column',
55
55
  pagingEnabled: false,
56
- pageLimit: 10,
57
56
  pagingUsePageScroll: true,
58
57
  })
59
58
  const { userStore, innerDynamicData } = useDynamicData()
60
- const { form } = useSyncForm({ dynamicScope: props.dataSource?.requestInfo?.dynamicScope })
59
+ const { form } = useSyncForm({ dynamicScope: props.dataSource?.dynamicScope })
61
60
  // 使用 shallowRef 优化大数组的响应式性能
62
61
  const renderList = shallowRef<unknown[]>([])
63
62
  const paging = ref()
64
63
  useZPaging(paging)
65
64
  const pageSearch = shallowRef<{ limit: number; page: number }>({
66
- limit: props.pageLimit,
65
+ limit: props.pageProps?.pageLimit || 10,
67
66
  page: 1,
68
67
  })
69
68
 
@@ -106,35 +105,24 @@ watch(
106
105
  userStore?.userInfo,
107
106
  props.pageProps?.pagingEnabled,
108
107
  props.pageProps?.pageLimit,
108
+ form.value,
109
109
  ] as const,
110
110
 
111
- async ([dataSource, dynamicData, userInfo, pagingEnabled, pageLimit = 10]) => {
111
+ async ([dataSource, dynamicData, userInfo, pagingEnabled]) => {
112
112
  if (pagingEnabled) {
113
113
  getPageData()
114
114
  return
115
115
  }
116
116
  // 防止重复请求
117
117
  let data: unknown[] = []
118
- const result = await dynamicRequest(dataSource, dynamicData, userInfo)
118
+ const result = await dynamicRequest(dataSource, dynamicData, userInfo, form.value)
119
119
  if (result) {
120
120
  data = result
121
121
  }
122
122
  // 使用 shallowRef 时需要重新赋值整个数组
123
123
  renderList.value = Array.isArray(data) ? transformStringArrayToObjectArray(data) : []
124
124
  },
125
- { immediate: true },
126
- )
127
-
128
- watch(
129
- () => form.value,
130
- () => {
131
- if (props.pageProps?.pagingEnabled) {
132
- getPageData()
133
- }
134
- },
135
- {
136
- deep: true,
137
- },
125
+ { immediate: true, deep: true },
138
126
  )
139
127
 
140
128
  // 优化:缓存 key 获取逻辑,减少属性访问
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.56",
3
+ "version": "0.7.58",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -3,11 +3,10 @@ declare const _default: import('vue').DefineComponent<
3
3
  __VLS_WithDefaults<
4
4
  __VLS_TypePropsToOption<LcbTabsProps>,
5
5
  {
6
- tagActiveColor: string
7
- tagInactiveColor: string
8
- tagTitleActiveColor: string
9
- tagTitleInactiveColor: string
10
- tagRadius: number
6
+ lineWidth: number
7
+ lineHeight: number
8
+ slidable: string
9
+ slidableNum: number
11
10
  defaultIndex: number
12
11
  }
13
12
  >,
@@ -25,23 +24,21 @@ declare const _default: import('vue').DefineComponent<
25
24
  __VLS_WithDefaults<
26
25
  __VLS_TypePropsToOption<LcbTabsProps>,
27
26
  {
28
- tagActiveColor: string
29
- tagInactiveColor: string
30
- tagTitleActiveColor: string
31
- tagTitleInactiveColor: string
32
- tagRadius: number
27
+ lineWidth: number
28
+ lineHeight: number
29
+ slidable: string
30
+ slidableNum: number
33
31
  defaultIndex: number
34
32
  }
35
33
  >
36
34
  >
37
35
  >,
38
36
  {
37
+ lineHeight: number
38
+ lineWidth: number
39
+ slidableNum: number
40
+ slidable: 'always' | 'auto'
39
41
  defaultIndex: number
40
- tagActiveColor: string
41
- tagInactiveColor: string
42
- tagTitleActiveColor: string
43
- tagTitleInactiveColor: string
44
- tagRadius: number
45
42
  },
46
43
  {}
47
44
  >
@@ -22,6 +22,7 @@ declare const _default: import('vue').DefineComponent<
22
22
  size: string
23
23
  iconType: string
24
24
  iconColor: string
25
+ moreFontWeight: number
25
26
  }
26
27
  >,
27
28
  {},
@@ -57,6 +58,7 @@ declare const _default: import('vue').DefineComponent<
57
58
  size: string
58
59
  iconType: string
59
60
  iconColor: string
61
+ moreFontWeight: number
60
62
  }
61
63
  >
62
64
  >
@@ -84,6 +86,7 @@ declare const _default: import('vue').DefineComponent<
84
86
  moreColor: string
85
87
  moreFontSize: number
86
88
  moreVerticalAlign: 'end' | 'center'
89
+ moreFontWeight: number
87
90
  iconRight: number
88
91
  },
89
92
  {}
@@ -29,6 +29,7 @@ export interface LcbTitleProps
29
29
  moreText?: string
30
30
  moreVerticalAlign?: 'end' | 'center'
31
31
  moreKeyFromUser?: boolean
32
+ moreFontWeight?: number
32
33
  iconColor?: string
33
34
  iconRight?: number
34
35
  iconSize?: number
@@ -10,7 +10,6 @@ declare const __VLS_component: import('vue').DefineComponent<
10
10
  display: string
11
11
  flexDirection: string
12
12
  pagingEnabled: boolean
13
- pageLimit: number
14
13
  pagingUsePageScroll: boolean
15
14
  }
16
15
  >,
@@ -31,7 +30,6 @@ declare const __VLS_component: import('vue').DefineComponent<
31
30
  display: string
32
31
  flexDirection: string
33
32
  pagingEnabled: boolean
34
- pageLimit: number
35
33
  pagingUsePageScroll: boolean
36
34
  }
37
35
  >