@tplc/business 0.7.67 → 0.7.68
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 +33 -0
- package/components/lcb-action-view/components/PayPopup/index.vue +2 -0
- package/components/lcb-order-payment/lcb-order-payment.vue +101 -7
- package/components/lcb-order-payment/types.ts +2 -1
- package/package.json +2 -2
- package/types/components/lcb-order-payment/lcb-order-payment.vue.d.ts +3 -0
- package/types/components/lcb-order-payment/types.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
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.68](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.27...v0.7.68) (2026-01-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring | 代码重构
|
|
9
|
+
|
|
10
|
+
* **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))
|
|
11
|
+
* **types:** standardize type definitions and improve consistency across components ([227a8d9](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/227a8d9ee1c458f87916d28949513d68d808768c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
15
|
+
|
|
16
|
+
* **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))
|
|
17
|
+
* **release:** 0.7.64 ([52d9fb9](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/52d9fb9331136cb654138898b54ff370716f71b2))
|
|
18
|
+
* **release:** 0.7.65 ([d253971](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/d2539714a2378236ba05083e03e901f5623bcc91))
|
|
19
|
+
* **release:** 0.7.66 ([05158f3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/05158f3950da0fefba4a6b1dd2352725a75a0425))
|
|
20
|
+
* **release:** 0.7.67 ([1d3d4ea](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1d3d4ea8fd8018e6cd41fd754a0fd5375b9ee3ab))
|
|
21
|
+
* **release:** 1.0.28 ([8e3e87a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8e3e87a26bb2534aa79213b0ddc1d1db1365e54f))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
25
|
+
|
|
26
|
+
* **lcb-tabs:** add error handling for JSON parsing in syncForm calls ([3dac339](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/3dac3394071fd10da4f94986034c06566ef67db8))
|
|
27
|
+
* **SharePopup:** add immediate option to watch for data updates ([6e02b88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/6e02b88dce5cf048fbc309285e6f947ad938032d))
|
|
28
|
+
* **wd-img:** remove unnecessary class from image component for cleaner styling ([05e83d5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/05e83d5a211aba9d90704b7e871f0a29a4962d7a))
|
|
29
|
+
* **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))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### ✨ Features | 新功能
|
|
33
|
+
|
|
34
|
+
* **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))
|
|
35
|
+
* **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))
|
|
36
|
+
* 修改字段 ([8ed5c88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8ed5c880145b1d96d1afdd3848da9a6d20ae2ed5))
|
|
37
|
+
|
|
5
38
|
### [0.7.67](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.66...v0.7.67) (2026-01-13)
|
|
6
39
|
|
|
7
40
|
|
|
@@ -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:paymentInfoItems="form.paymentInfoItems"
|
|
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
|
+
paymentInfoItems: [] as 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
|
-
|
|
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
|
+
<lcb-form
|
|
28
|
+
custom-class="ml-56rpx"
|
|
29
|
+
v-if="payType === item.type && item.items"
|
|
30
|
+
:fields="item.items"
|
|
31
|
+
:bottomFixed="false"
|
|
32
|
+
submitText=""
|
|
33
|
+
v-model="insteadForm"
|
|
34
|
+
/>
|
|
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.paymentInfoItems
|
|
130
|
+
const paymentInfoItems = defineModel<any[]>('paymentInfoItems')
|
|
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,45 @@ 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 (!paymentInfoItems.value) return
|
|
144
|
+
if (payType.value !== 'instead') {
|
|
145
|
+
paymentInfoItems.value = []
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
const selected = props.data?.find((d) => d.type === 'instead')
|
|
149
|
+
if (!selected) {
|
|
150
|
+
paymentInfoItems.value = []
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
const rawItems: any[] = (selected as any).items || []
|
|
154
|
+
paymentInfoItems.value = [
|
|
155
|
+
{
|
|
156
|
+
...(selected as any),
|
|
157
|
+
// 保留原始 items(字段定义),同时补上用户输入值,方便后端直接取用
|
|
158
|
+
items: rawItems.map((f: any) => ({
|
|
159
|
+
...f,
|
|
160
|
+
value: f?.field ? insteadForm.value?.[f.field] : undefined,
|
|
161
|
+
})),
|
|
162
|
+
form: { ...insteadForm.value },
|
|
163
|
+
},
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
watch(payType, () => {
|
|
168
|
+
// 切换支付方式时同步
|
|
169
|
+
syncInsteadPaymentInfo()
|
|
170
|
+
})
|
|
171
|
+
watch(
|
|
172
|
+
insteadForm,
|
|
173
|
+
() => {
|
|
174
|
+
// 输入变化时同步(仅当选中 instead)
|
|
175
|
+
syncInsteadPaymentInfo()
|
|
176
|
+
},
|
|
177
|
+
{ deep: true },
|
|
178
|
+
)
|
|
179
|
+
|
|
105
180
|
const onChange = ({ value }: { value: string }) => {
|
|
106
181
|
if (!value) {
|
|
107
182
|
payType.value = undefined
|
|
@@ -113,22 +188,33 @@ const onChange = ({ value }: { value: string }) => {
|
|
|
113
188
|
payCardId.value = newPayCardId || undefined
|
|
114
189
|
}
|
|
115
190
|
onMounted(() => {
|
|
191
|
+
// 先优先命中「一级」defaultChecked(包含 instead)
|
|
192
|
+
for (let i = 0; i < (props.data?.length || 0); i++) {
|
|
193
|
+
const item = props.data![i]
|
|
194
|
+
if (item.defaultChecked) {
|
|
195
|
+
payType.value = item.type
|
|
196
|
+
payCardId.value = undefined
|
|
197
|
+
syncInsteadPaymentInfo()
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 再回退:命中子项 defaultChecked(储值卡/会员卡等)
|
|
116
203
|
for (let i = 0; i < (props.data?.length || 0); i++) {
|
|
117
204
|
const item = props.data![i]
|
|
205
|
+
if (item.type === 'instead') continue
|
|
118
206
|
if (item.content || item.items) {
|
|
119
207
|
const defaultChild = (item.content || item.items)?.find((child) => child.defaultChecked)
|
|
120
208
|
if (defaultChild) {
|
|
121
209
|
payCardId.value = defaultChild.payCardId
|
|
122
210
|
payType.value = item.type
|
|
123
|
-
|
|
211
|
+
syncInsteadPaymentInfo()
|
|
212
|
+
return
|
|
124
213
|
}
|
|
125
214
|
}
|
|
126
|
-
if (item.defaultChecked) {
|
|
127
|
-
payType.value = item.type
|
|
128
|
-
payCardId.value = undefined
|
|
129
|
-
break
|
|
130
|
-
}
|
|
131
215
|
}
|
|
216
|
+
|
|
217
|
+
syncInsteadPaymentInfo()
|
|
132
218
|
})
|
|
133
219
|
const onModifyPrice = (price: number, max: number) => {
|
|
134
220
|
message
|
|
@@ -186,5 +272,13 @@ const onModifyPrice = (price: number, max: number) => {
|
|
|
186
272
|
padding: 0px !important;
|
|
187
273
|
}
|
|
188
274
|
}
|
|
275
|
+
|
|
276
|
+
:deep(.lcb-form) {
|
|
277
|
+
:deep(.wd-cell) {
|
|
278
|
+
.wd-cell__wrapper {
|
|
279
|
+
padding: 24rpx 0rpx !important;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
189
283
|
}
|
|
190
284
|
</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.
|
|
3
|
+
"version": "0.7.68",
|
|
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.
|
|
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
|
+
paymentInfoItems?: 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:paymentInfoItems': (paymentInfoItems: 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:paymentInfoItems'?: ((paymentInfoItems: 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[]
|