@tplc/business 0.7.67 → 0.7.69

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.7.69](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.68...v0.7.69) (2026-01-14)
6
+
7
+ ### [0.7.68](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.27...v0.7.68) (2026-01-14)
8
+
9
+
10
+ ### ♻️ Code Refactoring | 代码重构
11
+
12
+ * **lcb-calendar-search:** streamline placeholder styling by consolidating styles into a computed property ([d02956a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d02956a41847e799fafb932413450c195c1b4b69))
13
+ * **types:** standardize type definitions and improve consistency across components ([227a8d9](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/227a8d9ee1c458f87916d28949513d68d808768c))
14
+
15
+
16
+ ### 🚀 Chore | 构建/工程依赖/工具
17
+
18
+ * **docs:** update documentation for various components and add new entries to .gitignore ([dc265e8](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/dc265e89fa9a366abb4a93095b8c0a7668e8de2a))
19
+ * **release:** 0.7.64 ([52d9fb9](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/52d9fb9331136cb654138898b54ff370716f71b2))
20
+ * **release:** 0.7.65 ([d253971](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d2539714a2378236ba05083e03e901f5623bcc91))
21
+ * **release:** 0.7.66 ([05158f3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/05158f3950da0fefba4a6b1dd2352725a75a0425))
22
+ * **release:** 0.7.67 ([1d3d4ea](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1d3d4ea8fd8018e6cd41fd754a0fd5375b9ee3ab))
23
+ * **release:** 1.0.28 ([8e3e87a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8e3e87a26bb2534aa79213b0ddc1d1db1365e54f))
24
+
25
+
26
+ ### 🐛 Bug Fixes | Bug 修复
27
+
28
+ * **lcb-tabs:** add error handling for JSON parsing in syncForm calls ([3dac339](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/3dac3394071fd10da4f94986034c06566ef67db8))
29
+ * **SharePopup:** add immediate option to watch for data updates ([6e02b88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/6e02b88dce5cf048fbc309285e6f947ad938032d))
30
+ * **wd-img:** remove unnecessary class from image component for cleaner styling ([05e83d5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/05e83d5a211aba9d90704b7e871f0a29a4962d7a))
31
+ * **wd-tabs:** implement layout retry logic to ensure accurate tab positioning on initial render ([94ade3b](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/94ade3b0c75122050b6bb871eeceedf8d09e5f42))
32
+
33
+
34
+ ### ✨ Features | 新功能
35
+
36
+ * **lcb-img-nav:** update demo page with enhanced layout and new navigation title ([0578991](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/05789916afa8448fa3c38d677ac74437f351fc62))
37
+ * **lcb-tabs:** enhance tab component with JSON formatted names and improve layout for better responsiveness ([fc19f33](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/fc19f3384c03519075770c9f6a978a859e8b1e60))
38
+ * 修改字段 ([8ed5c88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8ed5c880145b1d96d1afdd3848da9a6d20ae2ed5))
39
+
5
40
  ### [0.7.67](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.66...v0.7.67) (2026-01-13)
6
41
 
7
42
 
@@ -12,6 +12,7 @@
12
12
  <lcb-order-payment
13
13
  v-model="form.payType"
14
14
  v-model:payCardId="form.payCardId"
15
+ v-model:paymentInfoJson="form.paymentInfoJson"
15
16
  :data="dataInfo?.commitPagePaymentMethod"
16
17
  @onWalletPriceChange="onWalletPriceChange"
17
18
  v-if="dataInfo?.commitPagePaymentMethod"
@@ -43,6 +44,7 @@ const form = ref({
43
44
  payCardId: '',
44
45
  toStoreFlag: false,
45
46
  walletAccountId: '' as string | undefined,
47
+ paymentInfoJson: {} as Record<string, any>,
46
48
  })
47
49
 
48
50
  const [pay] = usePay(() =>
@@ -2,7 +2,39 @@
2
2
  <view class="pay-group">
3
3
  <wd-radio-group v-model="groupValue" @change="onChange">
4
4
  <block v-for="item in data" :key="item.title">
5
- <wd-radio :value="item.type" shape="dot" cell v-if="!(item.content || item.items)">
5
+ <!-- instead: 一级单选,选中后展示表单 -->
6
+ <view v-if="item.type === 'instead'">
7
+ <wd-radio :value="item.type" shape="dot" cell v-if="item.type === 'instead'">
8
+ <view>
9
+ <view class="flex items-center">
10
+ <wd-img
11
+ :src="item.icon"
12
+ width="36rpx"
13
+ height="36rpx"
14
+ radius="8rpx"
15
+ custom-class="mr-18rpx"
16
+ v-if="item.icon"
17
+ />
18
+ <view>
19
+ {{ item.title }}
20
+ </view>
21
+ <text class="text-primary text-2.5 ml-1" v-if="item.subTitle">
22
+ {{ item.subTitle }}
23
+ </text>
24
+ </view>
25
+ </view>
26
+ </wd-radio>
27
+ <view class="ml-56rpx" v-if="payType === item.type && item.items">
28
+ <lcb-form
29
+ :fields="item.items"
30
+ :bottomFixed="false"
31
+ submitText=""
32
+ v-model="insteadForm"
33
+ />
34
+ </view>
35
+ </view>
36
+
37
+ <wd-radio :value="item.type" shape="dot" cell v-else-if="!(item.content || item.items)">
6
38
  <view class="flex">
7
39
  <wd-img
8
40
  :src="item.icon"
@@ -17,6 +49,7 @@
17
49
  </view>
18
50
  </view>
19
51
  </wd-radio>
52
+
20
53
  <view v-else>
21
54
  <wd-cell>
22
55
  <template #title>
@@ -93,6 +126,9 @@ const props = defineProps<LcbOrderPaymentProps>()
93
126
  const emits = defineEmits(['onWalletPriceChange'])
94
127
  const payType = defineModel<string>()
95
128
  const payCardId = defineModel<string>('payCardId')
129
+ // 代下单(instead)表单数据:提交到父级 form.paymentInfoJson
130
+ const paymentInfoJson = defineModel<Record<string, any>>('paymentInfoJson')
131
+ const insteadForm = ref<Record<string, any>>({})
96
132
  const getGroupValue = (payType: string, payCardId: string) => {
97
133
  return payType ? `${payType}${payCardId ? '-' + payCardId : ''}` : undefined
98
134
  }
@@ -102,6 +138,34 @@ const message = useMessage()
102
138
  watch([payType, payCardId], ([newPayType, newPayCardId]) => {
103
139
  groupValue.value = getGroupValue(newPayType || '', newPayCardId || '')
104
140
  })
141
+
142
+ const syncInsteadPaymentInfo = () => {
143
+ if (!paymentInfoJson.value) return
144
+ if (payType.value !== 'instead') {
145
+ paymentInfoJson.value = {}
146
+ return
147
+ }
148
+ const selected = props.data?.find((d) => d.type === 'instead')
149
+ if (!selected) {
150
+ paymentInfoJson.value = {}
151
+ return
152
+ }
153
+ paymentInfoJson.value = insteadForm.value
154
+ }
155
+
156
+ watch(payType, () => {
157
+ // 切换支付方式时同步
158
+ syncInsteadPaymentInfo()
159
+ })
160
+ watch(
161
+ insteadForm,
162
+ () => {
163
+ // 输入变化时同步(仅当选中 instead)
164
+ syncInsteadPaymentInfo()
165
+ },
166
+ { deep: true },
167
+ )
168
+
105
169
  const onChange = ({ value }: { value: string }) => {
106
170
  if (!value) {
107
171
  payType.value = undefined
@@ -113,22 +177,33 @@ const onChange = ({ value }: { value: string }) => {
113
177
  payCardId.value = newPayCardId || undefined
114
178
  }
115
179
  onMounted(() => {
180
+ // 先优先命中「一级」defaultChecked(包含 instead)
116
181
  for (let i = 0; i < (props.data?.length || 0); i++) {
117
182
  const item = props.data![i]
183
+ if (item.defaultChecked) {
184
+ payType.value = item.type
185
+ payCardId.value = undefined
186
+ syncInsteadPaymentInfo()
187
+ return
188
+ }
189
+ }
190
+
191
+ // 再回退:命中子项 defaultChecked(储值卡/会员卡等)
192
+ for (let i = 0; i < (props.data?.length || 0); i++) {
193
+ const item = props.data![i]
194
+ if (item.type === 'instead') continue
118
195
  if (item.content || item.items) {
119
196
  const defaultChild = (item.content || item.items)?.find((child) => child.defaultChecked)
120
197
  if (defaultChild) {
121
198
  payCardId.value = defaultChild.payCardId
122
199
  payType.value = item.type
123
- break
200
+ syncInsteadPaymentInfo()
201
+ return
124
202
  }
125
203
  }
126
- if (item.defaultChecked) {
127
- payType.value = item.type
128
- payCardId.value = undefined
129
- break
130
- }
131
204
  }
205
+
206
+ syncInsteadPaymentInfo()
132
207
  })
133
208
  const onModifyPrice = (price: number, max: number) => {
134
209
  message
@@ -186,5 +261,11 @@ const onModifyPrice = (price: number, max: number) => {
186
261
  padding: 0px !important;
187
262
  }
188
263
  }
264
+
265
+ :deep(.lcb-form) {
266
+ .wd-cell__wrapper {
267
+ padding: 16rpx 0rpx !important;
268
+ }
269
+ }
189
270
  }
190
271
  </style>
@@ -1,3 +1,4 @@
1
+ import { LcbFormField } from 'components/lcb-form/types'
1
2
  import { LcbActionViewProps } from '../lcb-action-view/types'
2
3
  export interface ChildDetail {
3
4
  payCardId: string
@@ -24,7 +25,7 @@ export interface ChildContent {
24
25
  }
25
26
  content?: ChildDetail[]
26
27
  intro?: string
27
- items?: ChildDetail[]
28
+ items?: (ChildDetail & LcbFormField)[]
28
29
  }
29
30
  export interface LcbOrderPaymentProps {
30
31
  data: ChildContent[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.67",
3
+ "version": "0.7.69",
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.27"
14
+ "@tplc/wot": "1.0.28"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -3,6 +3,7 @@ declare let __VLS_typeProps: LcbOrderPaymentProps
3
3
  type __VLS_PublicProps = {
4
4
  modelValue?: string
5
5
  payCardId?: string
6
+ paymentInfoJson?: Record<string, any>
6
7
  } & typeof __VLS_typeProps
7
8
  declare const _default: import('vue').DefineComponent<
8
9
  __VLS_TypePropsToOption<__VLS_PublicProps>,
@@ -15,6 +16,7 @@ declare const _default: import('vue').DefineComponent<
15
16
  {
16
17
  'update:modelValue': (modelValue: string) => void
17
18
  'update:payCardId': (payCardId: string) => void
19
+ 'update:paymentInfoJson': (paymentInfoJson: Record<string, any>) => void
18
20
  onWalletPriceChange: (...args: any[]) => void
19
21
  },
20
22
  string,
@@ -23,6 +25,7 @@ declare const _default: import('vue').DefineComponent<
23
25
  'onUpdate:modelValue'?: ((modelValue: string) => any) | undefined
24
26
  onOnWalletPriceChange?: ((...args: any[]) => any) | undefined
25
27
  'onUpdate:payCardId'?: ((payCardId: string) => any) | undefined
28
+ 'onUpdate:paymentInfoJson'?: ((paymentInfoJson: Record<string, any>) => any) | undefined
26
29
  },
27
30
  {},
28
31
  {}
@@ -1,3 +1,4 @@
1
+ import { LcbFormField } from 'components/lcb-form/types'
1
2
  import { LcbActionViewProps } from '../lcb-action-view/types'
2
3
  export interface ChildDetail {
3
4
  payCardId: string
@@ -23,7 +24,7 @@ export interface ChildContent {
23
24
  }
24
25
  content?: ChildDetail[]
25
26
  intro?: string
26
- items?: ChildDetail[]
27
+ items?: (ChildDetail & LcbFormField)[]
27
28
  }
28
29
  export interface LcbOrderPaymentProps {
29
30
  data: ChildContent[]