@tplc/business 0.5.74 → 0.5.76

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.5.76](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.75...v0.5.76) (2025-12-05)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 动态样式 ([85a6aa5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/85a6aa5f60780d6c9e11e12fa7686cab958084cb))
11
+
12
+ ### [0.5.75](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.69...v0.5.75) (2025-12-04)
13
+
14
+
15
+ ### 🚀 Chore | 构建/工程依赖/工具
16
+
17
+ * **release:** 0.5.70 ([ddb4aa7](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/ddb4aa75c0df558b1290688ffec4940945818728))
18
+ * **release:** 0.5.71 ([19eaaaa](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/19eaaaaa86929f3f8285b095fb86d93f44fdd6de))
19
+ * **release:** 0.5.72 ([4d02488](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/4d02488b574dd3ef9f2d5c4ae0e144cb827343ef))
20
+ * **release:** 0.5.73 ([2fe2b89](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2fe2b89e772cee7ebba9ed6511445b3ee6816d95))
21
+ * **release:** 0.5.74 ([d8437e5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d8437e5530795738e68fdd951da94573a6efe5ba))
22
+
23
+
24
+ ### 🐛 Bug Fixes | Bug 修复
25
+
26
+ * action str ([a5b5ea7](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/a5b5ea77527c84904dfca663923b69ede964ae35))
27
+ * area child width ([c97b8a6](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c97b8a6992daf9b07d722a2f46eaf182eb69e1be))
28
+
29
+
30
+ ### ✨ Features | 新功能
31
+
32
+ * 兼容h5 ([a4bf8f6](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/a4bf8f60cda7afb3bcf3e8b3a99641c3b0c2e0f9))
33
+ * 支持自适应 ([8cf03cc](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8cf03cc6397ad85ff1d3938d60b769fc2f0d50ac))
34
+ * 支持请求 ([5baa8a3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5baa8a36802f0f1140d5794050f5a48b3c43128b))
35
+ * 调整布局 ([2011392](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2011392224dc40ab6f7a7dae9f0a4d88a3d882dd))
36
+
5
37
  ### [0.5.74](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.73...v0.5.74) (2025-12-04)
6
38
 
7
39
 
package/action.d.ts CHANGED
@@ -110,3 +110,8 @@ export interface TextRenderViewItem {
110
110
  }[]
111
111
  style?: Record<string, any>
112
112
  }
113
+
114
+ export interface DynamicOptions {
115
+ keyFrom?: 'user' | 'context'
116
+ dynamicKey?: string
117
+ }
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <lcb-action-view v-bind="action" v-if="showArea">
3
- <lcb-block v-bind="$props">
2
+ <lcb-block v-bind="$props" v-if="showArea">
3
+ <lcb-action-view v-bind="action">
4
4
  <view
5
5
  :style="{
6
6
  display: display,
@@ -8,7 +8,7 @@
8
8
  overflowX: scrollX ? 'auto' : 'initial',
9
9
  ...innerStyle,
10
10
  }"
11
- class="h-ful"
11
+ class="h-full"
12
12
  >
13
13
  <view
14
14
  v-for="(item, index) in list"
@@ -22,8 +22,8 @@
22
22
  <slot :item="item" />
23
23
  </view>
24
24
  </view>
25
- </lcb-block>
26
- </lcb-action-view>
25
+ </lcb-action-view>
26
+ </lcb-block>
27
27
  </template>
28
28
 
29
29
  <script setup lang="ts">
@@ -130,7 +130,11 @@ const showArea = computed(() => {
130
130
 
131
131
  <style lang="scss" scoped>
132
132
  .slot-wrapper {
133
- :deep(> *) {
133
+ :deep(> view) {
134
+ width: 100%;
135
+ height: auto;
136
+ }
137
+ :deep(> button) {
134
138
  width: 100%;
135
139
  height: auto;
136
140
  }
@@ -18,6 +18,7 @@
18
18
  margin: `${transformValueUnit(floatUp ? -floatUp : marginTop || 0)} ${transformValueUnit(marginRight || marginHorizontal || 0)} ${transformValueUnit(marginBottom || 0)} ${transformValueUnit(marginLeft || marginHorizontal || 0)}`,
19
19
  ...customStyle,
20
20
  ...getFlexStyle(align),
21
+ ...getInnerStyle,
21
22
  }"
22
23
  class="box-border overflow-hidden relative"
23
24
  :class="customClass"
@@ -29,7 +30,9 @@
29
30
  <script setup lang="ts">
30
31
  import { LcbBlockInnerProps } from './types'
31
32
  import { transformValueUnit, getFlexStyle } from '../../utils/transform'
32
- import { computed } from 'vue'
33
+ import { computed, inject, Ref } from 'vue'
34
+ import { PAGE_PROVIDE_KEY } from '../../constants'
35
+ import { get } from 'lodash-es'
33
36
  defineOptions({
34
37
  name: 'LcbBlock',
35
38
  options: {
@@ -47,6 +50,8 @@ const props = withDefaults(defineProps<LcbBlockInnerProps>(), {
47
50
  fontSize: 24,
48
51
  position: 'relative',
49
52
  })
53
+ const pageInfo = inject(PAGE_PROVIDE_KEY) as Ref<Record<string, any>>
54
+ const userStore = uni.$lcb.userStore?.()
50
55
  // 透明度+颜色
51
56
  const innerBackgroundColor = computed(() => {
52
57
  if (!props.backgroundColor) return ''
@@ -55,4 +60,25 @@ const innerBackgroundColor = computed(() => {
55
60
  }
56
61
  return props.backgroundColor
57
62
  })
63
+
64
+ const getInnerStyle = computed(() => {
65
+ const innerStyle = Object.keys(props.dynamicStyleOptions).reduce(
66
+ (acc, key) => {
67
+ const currentOptions = props.dynamicStyleOptions[key]
68
+ if (key) {
69
+ const data = get(
70
+ currentOptions.keyFrom === 'user' ? userStore?.userInfo : pageInfo.value,
71
+ currentOptions.dynamicKey,
72
+ )
73
+ if (data) {
74
+ acc[key] = data
75
+ }
76
+ }
77
+
78
+ return acc
79
+ },
80
+ {} as Record<string, string>,
81
+ )
82
+ return innerStyle
83
+ })
58
84
  </script>
@@ -1,3 +1,4 @@
1
+ import { DynamicOptions } from 'action'
1
2
  import { StyleValue } from 'vue'
2
3
 
3
4
  export interface LcbBlockProps {
@@ -55,6 +56,9 @@ export interface LcbBlockProps {
55
56
  | 'bottom-left'
56
57
  | 'bottom-center'
57
58
  | 'bottom-right'
59
+
60
+ // 动态样式集合
61
+ dynamicStyleOptions?: Record<string, DynamicOptions>
58
62
  }
59
63
  export interface LcbBlockInnerProps extends LcbBlockProps {
60
64
  [key: string]: any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.5.74",
3
+ "version": "0.5.76",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,3 +1,4 @@
1
+ import { DynamicOptions } from 'action'
1
2
  export interface LcbBlockProps {
2
3
  /** 左右外距 */
3
4
  marginHorizontal?: number
@@ -53,6 +54,7 @@ export interface LcbBlockProps {
53
54
  | 'bottom-left'
54
55
  | 'bottom-center'
55
56
  | 'bottom-right'
57
+ dynamicStyleOptions?: Record<string, DynamicOptions>
56
58
  }
57
59
  export interface LcbBlockInnerProps extends LcbBlockProps {
58
60
  [key: string]: any
@@ -65,6 +65,7 @@ declare const __VLS_component: import('vue').DefineComponent<
65
65
  | 'bottom-left'
66
66
  | 'bottom-center'
67
67
  | 'bottom-right'
68
+ dynamicStyleOptions: Record<string, import('../../action').DynamicOptions>
68
69
  gap: number
69
70
  imageWidth: number
70
71
  borderRadius: number