@tplc/business 0.7.20 → 0.7.22

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,15 @@
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.22](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.21...v0.7.22) (2025-12-17)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 调整数据结构 ([b6f0d24](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/b6f0d24a26d3d4dbf05ca855ed687d6819eb7c0f))
11
+
12
+ ### [0.7.21](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.20...v0.7.21) (2025-12-17)
13
+
5
14
  ### [0.7.20](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.15...v0.7.20) (2025-12-17)
6
15
 
7
16
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view class="pay-group">
3
- <wd-radio-group v-model="groupValue">
3
+ <wd-radio-group v-model="groupValue" @change="onChange">
4
4
  <block v-for="item in data" :key="item.title">
5
5
  <wd-radio :value="item.type" shape="dot" cell v-if="!(item.content || item.items)">
6
6
  <view class="flex">
@@ -38,11 +38,11 @@
38
38
  </view>
39
39
  </template>
40
40
  </wd-cell>
41
- <view class="ml-56rpx flex flex-col gap-3">
41
+ <view class="ml-56rpx flex flex-col gap-2">
42
42
  <wd-radio
43
43
  v-for="child in item.content || item.items"
44
44
  :key="child.payCardId"
45
- :value="child.payCardId"
45
+ :value="`${item.type}-${child.payCardId}`"
46
46
  shape="dot"
47
47
  cell
48
48
  >
@@ -92,32 +92,40 @@ defineOptions({
92
92
  const props = defineProps<LcbOrderPaymentProps>()
93
93
  const emits = defineEmits(['onWalletPriceChange'])
94
94
  const payType = defineModel<string>()
95
- const groupValue = ref(payType.value)
95
+ const payCardId = defineModel<string>('payCardId')
96
+ const getGroupValue = (payType: string, payCardId: string) => {
97
+ return payType ? `${payType}${payCardId ? '-' + payCardId : ''}` : undefined
98
+ }
99
+ const groupValue = ref(getGroupValue(payType.value || '', payCardId.value || ''))
96
100
  const message = useMessage()
97
- watch(
98
- () => payType.value,
99
- (val) => {
100
- groupValue.value = val
101
- },
102
- )
103
- watch(
104
- () => groupValue.value,
105
- (val) => {
106
- payType.value = val
107
- },
108
- )
101
+ // 同时监听payType payCardId俩个字段 来修改groupValue
102
+ watch([payType, payCardId], ([newPayType, newPayCardId]) => {
103
+ groupValue.value = getGroupValue(newPayType || '', newPayCardId || '')
104
+ })
105
+ const onChange = ({ value }: { value: string }) => {
106
+ if (!value) {
107
+ payType.value = undefined
108
+ payCardId.value = undefined
109
+ return
110
+ }
111
+ const [newPayType, newPayCardId] = value.split('-')
112
+ payType.value = newPayType
113
+ payCardId.value = newPayCardId || undefined
114
+ }
109
115
  onMounted(() => {
110
116
  for (let i = 0; i < (props.data?.length || 0); i++) {
111
117
  const item = props.data![i]
112
118
  if (item.content || item.items) {
113
119
  const defaultChild = (item.content || item.items)?.find((child) => child.defaultChecked)
114
120
  if (defaultChild) {
115
- groupValue.value = defaultChild.payCardId
121
+ payCardId.value = defaultChild.payCardId
122
+ payType.value = item.type
116
123
  break
117
124
  }
118
125
  }
119
126
  if (item.defaultChecked) {
120
- groupValue.value = item.type
127
+ payType.value = item.type
128
+ payCardId.value = undefined
121
129
  break
122
130
  }
123
131
  }
@@ -162,14 +170,18 @@ const onModifyPrice = (price: number, max: number) => {
162
170
  flex-direction: column;
163
171
  gap: 24rpx;
164
172
  }
173
+
165
174
  :deep(.wd-radio) {
166
175
  padding: 0 !important;
176
+
167
177
  .wd-radio__label {
168
178
  flex: 1;
169
179
  }
170
180
  }
181
+
171
182
  :deep(.wd-cell) {
172
183
  padding: 0px !important;
184
+
173
185
  .wd-cell__wrapper {
174
186
  padding: 0px !important;
175
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.20",
3
+ "version": "0.7.22",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -2,6 +2,7 @@ import type { LcbOrderPaymentProps } from './types'
2
2
  declare let __VLS_typeProps: LcbOrderPaymentProps
3
3
  type __VLS_PublicProps = {
4
4
  modelValue?: string
5
+ payCardId?: string
5
6
  } & typeof __VLS_typeProps
6
7
  declare const _default: import('vue').DefineComponent<
7
8
  __VLS_TypePropsToOption<__VLS_PublicProps>,
@@ -13,6 +14,7 @@ declare const _default: import('vue').DefineComponent<
13
14
  import('vue').ComponentOptionsMixin,
14
15
  {
15
16
  'update:modelValue': (modelValue: string) => void
17
+ 'update:payCardId': (payCardId: string) => void
16
18
  onWalletPriceChange: (...args: any[]) => void
17
19
  },
18
20
  string,
@@ -20,6 +22,7 @@ declare const _default: import('vue').DefineComponent<
20
22
  Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
21
23
  'onUpdate:modelValue'?: ((modelValue: string) => any) | undefined
22
24
  onOnWalletPriceChange?: ((...args: any[]) => any) | undefined
25
+ 'onUpdate:payCardId'?: ((payCardId: string) => any) | undefined
23
26
  },
24
27
  {},
25
28
  {}