@tplc/business 0.4.95 → 0.4.97

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,41 @@
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.4.97](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.96...v0.4.97) (2025-05-07)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.96 ([bca9fb3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bca9fb32bf0d24a014144be1f022d198c4affa30))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * area 支持 key ([dfded5b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/dfded5bbf79cf894c5815cadb76509c0def5b736))
16
+ * 新增数据 ([abab3d2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/abab3d2467b033132fbd06819f9c17dbeaa5d1bb))
17
+
18
+ ### [0.4.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.95...v0.4.96) (2025-05-07)
19
+ ### [0.4.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.92...v0.4.96) (2025-05-06)
20
+
21
+
22
+ ### ✨ Features | 新功能
23
+
24
+ * 字段key变更 ([d2f8ab8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d2f8ab85bf972f508ca06f047cb1285402186ad3))
25
+ * 富文本 空 p -> br ([0e27a84](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/0e27a84230204572d3bac780b99751d5a440720b))
26
+ * 新增数据 ([d5bec0e](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d5bec0eadb0854d2145ab9aa032c0cc558b1ef11))
27
+
28
+
29
+ ### 🐛 Bug Fixes | Bug 修复
30
+
31
+ * 修复字段没显示 ([bebd4aa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/bebd4aacaa7d13054e9567c63e2f482ed6b95622))
32
+
33
+
34
+ ### 🚀 Chore | 构建/工程依赖/工具
35
+
36
+ * **release:** 0.4.93 ([fad4ad4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fad4ad4076fbe37da6068583b8c94353d2204d03))
37
+ * **release:** 0.4.94 ([be392f6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/be392f6898ea078ab01ec0c46a622c5f577bb62a))
38
+ * **release:** 0.4.95 ([2c9c520](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2c9c5205f2307491341b69a6bbd42e5d03f1ec3e))
39
+
5
40
  ### [0.4.95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.94...v0.4.95) (2025-05-06)
6
41
 
7
42
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <lcb-block v-bind="$props">
2
+ <lcb-block v-bind="$props" v-if="showArea">
3
3
  <view
4
4
  class="h-full"
5
5
  :style="{
@@ -28,6 +28,7 @@
28
28
  import { computed } from 'vue'
29
29
  import { LcbAreaProps } from './types'
30
30
  import { transformValueUnit } from '@tplc/business/utils/transform'
31
+ import { get } from 'lodash-es'
31
32
  defineOptions({
32
33
  name: 'LcbArea',
33
34
  options: {
@@ -66,6 +67,16 @@ const getStyle = (index: number) => {
66
67
  flexShrink: props.display === 'flex' ? (props.flexShrink ?? 1) : undefined,
67
68
  }
68
69
  }
70
+
71
+ const showArea = computed(() => {
72
+ if (props.dependKey) {
73
+ const userStore = uni.$lcb.userStore?.()
74
+ return props.reverse
75
+ ? !get(userStore?.userInfo, props.dependKey)
76
+ : Boolean(get(userStore?.userInfo, props.dependKey))
77
+ }
78
+ return true
79
+ })
69
80
  </script>
70
81
 
71
82
  <style lang="scss" scoped>
@@ -17,4 +17,7 @@ export interface LcbAreaProps extends LcbBlockProps {
17
17
  }[]
18
18
  flexShrink?: number
19
19
  overflowX?: 'hidden' | 'initial' | 'auto'
20
+ dependKey?: string
21
+ keyFromUser?: boolean
22
+ reverse?: boolean
20
23
  }
@@ -97,6 +97,7 @@ import { ActionView } from '../../action'
97
97
  import { transformValueUnit } from '../../utils/transform'
98
98
  import { LcbImgNavProps } from './types'
99
99
  import { PAGE_PROVIDE_KEY } from '../../constants'
100
+ import { get } from 'lodash-es'
100
101
  const emits = defineEmits(['click'])
101
102
  const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
102
103
  const userStore = uni.$lcb.userStore?.()
@@ -140,12 +141,12 @@ const renderItems = computed(() => {
140
141
  if (item.dependKey) {
141
142
  if (item.keyFromUser) {
142
143
  return props.reverse
143
- ? !userStore?.userInfo?.[item.dependKey]
144
- : Boolean(userStore?.userInfo?.[item.dependKey])
144
+ ? !get(userStore?.userInfo, item.dependKey)
145
+ : Boolean(get(userStore?.userInfo, item.dependKey))
145
146
  } else {
146
147
  return props.reverse
147
- ? !pageInfo.value?.[item.dependKey]
148
- : Boolean(pageInfo.value?.[item.dependKey])
148
+ ? !get(pageInfo.value, item.dependKey)
149
+ : Boolean(get(pageInfo.value, item.dependKey))
149
150
  }
150
151
  }
151
152
  return true
@@ -54,7 +54,7 @@ const props = withDefaults(defineProps<LcbProductItemProps>(), {
54
54
  shadowColor: '#D6D7DA',
55
55
  blurSize: 5,
56
56
  })
57
- const attrs = useAttrs()
57
+ const attrs = useAttrs() as Record<string, any>
58
58
  provide('lcb-product-item-props', props)
59
59
  provide('lcb-product-item-attrs', attrs)
60
60
 
@@ -119,7 +119,7 @@ const itemStyle = computed(() => {
119
119
  <ItemValue
120
120
  v-if="!!$slots?.['coverImg']"
121
121
  prop="coverImg"
122
- customClass=" bg-gray-100 rounded-sm overflow-hidden relative"
122
+ customClass=" bg-gray-100 rounded-sm overflow-hidden relative image-view"
123
123
  >
124
124
  <template #default>
125
125
  <slot name="coverImgSection" />
@@ -131,13 +131,18 @@ const itemStyle = computed(() => {
131
131
  <ItemValue
132
132
  v-else
133
133
  prop="coverImg"
134
- customClass=" bg-gray-100 rounded-sm overflow-hidden relative"
134
+ customClass=" bg-gray-100 rounded-sm overflow-hidden relative image-view"
135
135
  >
136
136
  <template #default>
137
137
  <slot name="coverImgSection" />
138
138
  </template>
139
139
  </ItemValue>
140
- <view class="flex flex-col flex-1 text-26rpx overflow-hidden relative">
140
+ <view
141
+ class="flex flex-col flex-1 text-26rpx overflow-hidden relative"
142
+ :class="{
143
+ grayscale: attrs.rightBottomFlag,
144
+ }"
145
+ >
141
146
  <slot name="contentSection" />
142
147
  <view class="flex flex-col gap-[5px] overflow-hidden">
143
148
  <view>
@@ -243,6 +248,15 @@ const itemStyle = computed(() => {
243
248
  <slot name="itemRightSection" />
244
249
  </view>
245
250
  <slot name="itemBottomSection" />
251
+ <view
252
+ v-if="attrs.rightBottomIcon && attrs.rightBottomFlag"
253
+ class="absolute bottom-7 right-3 z-1"
254
+ >
255
+ <wd-img :src="attrs.rightBottomIcon" width="120rpx" mode="widthFix" />
256
+ </view>
257
+ <view v-if="attrs.rightTopIcon && attrs.rightTopFlag" class="absolute top-0 right-0 z-1">
258
+ <wd-img :src="attrs.rightTopIcon" width="120rpx" mode="widthFix" />
259
+ </view>
246
260
  </view>
247
261
 
248
262
  <!-- 竖向布局 -->
@@ -273,7 +287,12 @@ const itemStyle = computed(() => {
273
287
  <slot name="coverImgSection" />
274
288
  </template>
275
289
  </ItemValue>
276
- <view class="p-2 flex flex-col flex-1 text-26rpx overflow-hidden relative">
290
+ <view
291
+ class="p-2 flex flex-col flex-1 text-26rpx overflow-hidden relative"
292
+ :class="{
293
+ grayscale: attrs.rightBottomFlag,
294
+ }"
295
+ >
277
296
  <slot name="contentSection" />
278
297
  <view class="flex flex-col gap-[5px] overflow-hidden">
279
298
  <view>
@@ -365,7 +384,14 @@ const itemStyle = computed(() => {
365
384
  <slot name="itemBottomSection" />
366
385
  </view>
367
386
  <slot name="itemRightSection" />
387
+ <view
388
+ v-if="attrs.rightBottomIcon && attrs.rightBottomFlag"
389
+ class="absolute bottom-7 right-3 z-1"
390
+ >
391
+ <wd-img :src="attrs.rightBottomIcon" width="120rpx" mode="widthFix" />
392
+ </view>
393
+ <view v-if="attrs.rightTopIcon && attrs.rightTopFlag" class="absolute top-0 right-0 z-1">
394
+ <wd-img :src="attrs.rightTopIcon" width="120rpx" mode="widthFix" />
395
+ </view>
368
396
  </view>
369
397
  </template>
370
-
371
- <style lang="scss" scoped></style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.95",
3
+ "version": "0.4.97",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -17,4 +17,7 @@ export interface LcbAreaProps extends LcbBlockProps {
17
17
  }[]
18
18
  flexShrink?: number
19
19
  overflowX?: 'hidden' | 'initial' | 'auto'
20
+ dependKey?: string
21
+ keyFromUser?: boolean
22
+ reverse?: boolean
20
23
  }
@@ -60,8 +60,8 @@ declare const _default: import('vue').DefineComponent<
60
60
  {
61
61
  title: string
62
62
  fontWeight: number
63
- styleGroup: 1 | 2 | 3 | 4
64
63
  keyFromUser: boolean
64
+ styleGroup: 1 | 2 | 3 | 4
65
65
  back: boolean
66
66
  textSize: number
67
67
  topStyle: 1 | 2