@tplc/business 0.4.201 → 0.5.2

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,23 @@
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.2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.200...v0.5.2) (2025-09-29)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.201 ([863a022](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/863a022a8921174351f4ddd55530c70a3fd96978))
11
+ * **release:** 0.5.1 ([59e3d04](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/59e3d044f747fc52f53ee0079cdb6172bf86c1bd))
12
+
13
+
14
+ ### ✨ Features | 新功能
15
+
16
+ * paypopup 兼容小程序 ([2be4585](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2be4585183dcc184e91e8c483660ef51e8b53509))
17
+ * 支持 ([de0836a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/de0836a947e8afdffd087dabe3f1aea24a04e83c))
18
+ * 新增 pay组件 ([03f3d88](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/03f3d88c1725ffdab4439c870c6747a0765345c9))
19
+
20
+ ### [0.5.1](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.201...v0.5.1) (2025-09-28)
21
+
5
22
  ### [0.4.201](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.195...v0.4.201) (2025-09-28)
6
23
 
7
24
 
@@ -9,10 +9,11 @@
9
9
  <view class="title">支付</view>
10
10
  <view class="p-3 gap-3 flex flex-col">
11
11
  <lcb-custom-content v-bind="dataInfo?.customContent" v-if="dataInfo?.customContent" />
12
- <OrderPayment
12
+ <lcb-order-payment
13
13
  v-model="form.payType"
14
14
  :data="dataInfo?.commitPagePaymentMethod"
15
15
  @onWalletPriceChange="onWalletPriceChange"
16
+ v-if="dataInfo?.commitPagePaymentMethod"
16
17
  />
17
18
  <view class="flex gap-5 mt-4">
18
19
  <wd-button plain @click="onCancel">取消</wd-button>
@@ -26,9 +27,20 @@
26
27
  import { TextRenderViewItem } from '../../../../action'
27
28
  import usePay from '../../../../hooks/usePay'
28
29
  import { ref, watch } from 'vue'
30
+ defineOptions({
31
+ name: 'PayPopup',
32
+ options: {
33
+ addGlobalClass: true,
34
+ virtualHost: true,
35
+ styleIsolation: 'shared',
36
+ },
37
+ })
38
+
29
39
  const form = ref({
30
40
  payType: '',
31
41
  useWalletPrice: 84,
42
+ toStoreFlag: false,
43
+ walletAccountId: '' as string | undefined,
32
44
  })
33
45
 
34
46
  const [pay] = usePay(() =>
@@ -38,6 +50,24 @@ const [pay] = usePay(() =>
38
50
  }),
39
51
  )
40
52
 
53
+ watch(
54
+ () => form.value?.payType,
55
+ (val) => {
56
+ if (val) {
57
+ if (val === 'toStore') {
58
+ form.value.toStoreFlag = true
59
+ form.value.walletAccountId = undefined
60
+ } else if (val !== 'wechat') {
61
+ form.value.walletAccountId = val
62
+ form.value.toStoreFlag = false
63
+ } else {
64
+ form.value.walletAccountId = undefined
65
+ form.value.toStoreFlag = false
66
+ }
67
+ }
68
+ },
69
+ )
70
+
41
71
  const props = defineProps<{
42
72
  requestInfo: {
43
73
  requestUrl: string
@@ -61,10 +91,13 @@ watch(
61
91
  props.requestInfo.requestUrl,
62
92
  props.requestInfo.requestParams,
63
93
  )) as any
64
- form.value.payType = data.commitPagePaymentMethod.find((v) => v.defaultChecked)?.type
94
+ // form.value.payType = data.commitPagePaymentMethod.find((v) => v.defaultChecked)?.type
65
95
  dataInfo.value = data
66
96
  }
67
97
  },
98
+ {
99
+ immediate: true,
100
+ },
68
101
  )
69
102
  const onWalletPriceChange = (useWalletPrice: number) => {
70
103
  form.value.useWalletPrice = useWalletPrice
@@ -0,0 +1,178 @@
1
+ <template>
2
+ <view class="pay-group">
3
+ <wd-radio-group v-model="groupValue">
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)">
6
+ <view class="flex">
7
+ <wd-img
8
+ :src="item.icon"
9
+ width="36rpx"
10
+ height="36rpx"
11
+ radius="8rpx"
12
+ custom-class="mr-18rpx"
13
+ v-if="item.icon"
14
+ />
15
+ <view>
16
+ {{ item.title }}
17
+ </view>
18
+ </view>
19
+ </wd-radio>
20
+ <view v-else>
21
+ <wd-cell>
22
+ <template #title>
23
+ <view class="flex items-center">
24
+ <wd-img
25
+ :src="item.icon"
26
+ width="36rpx"
27
+ height="36rpx"
28
+ radius="8rpx"
29
+ custom-class="mr-18rpx"
30
+ v-if="item.icon"
31
+ />
32
+ <view>
33
+ {{ item.title }}
34
+ </view>
35
+ <text class="text-primary text-2.5 ml-1" v-if="item.subTitle">
36
+ {{ item.subTitle }}
37
+ </text>
38
+ </view>
39
+ </template>
40
+ </wd-cell>
41
+ <view class="ml-56rpx flex flex-col gap-3">
42
+ <wd-radio
43
+ v-for="child in item.content || item.items"
44
+ :key="child.walletAccountId"
45
+ :value="child.walletAccountId"
46
+ shape="dot"
47
+ cell
48
+ >
49
+ <view class="flex items-center w-full">
50
+ <view class="break-all text-start">{{ child.name }}</view>
51
+ <lcb-action-view v-bind="child.link" custom-class="flex-shrink-0" v-if="child.link">
52
+ <view class="flex items-center text-primary text-3 ml-3">
53
+ {{ t('充值') }}
54
+ <wd-icon name="xiangyou" class-prefix="lcb" size="24rpx" />
55
+ </view>
56
+ </lcb-action-view>
57
+ <view class="flex-1"></view>
58
+ <template v-if="child.useWalletPrice">
59
+ <view>{{ child.walletEditTip }}{{ child.useWalletPrice }}</view>
60
+ <view
61
+ class="text-end text-primary mr-3 ml-1"
62
+ @click.stop="
63
+ onModifyPrice(child.useWalletPrice || 0, child.usableWalletPrice || 0)
64
+ "
65
+ >
66
+ 修改
67
+ </view>
68
+ </template>
69
+ </view>
70
+ </wd-radio>
71
+ </view>
72
+ </view>
73
+ </block>
74
+ </wd-radio-group>
75
+ <wd-message-box />
76
+ </view>
77
+ </template>
78
+
79
+ <script lang="ts" setup>
80
+ import type { LcbOrderPaymentProps } from './types'
81
+ import { useMessage, useTranslate } from '@tplc/wot'
82
+ import { ref, watch, onMounted } from 'vue'
83
+ const { translate: t } = useTranslate()
84
+ defineOptions({
85
+ name: 'OrderPayment',
86
+ options: {
87
+ addGlobalClass: true,
88
+ virtualHost: true,
89
+ styleIsolation: 'shared',
90
+ },
91
+ })
92
+ const props = defineProps<LcbOrderPaymentProps>()
93
+ const emits = defineEmits(['onWalletPriceChange'])
94
+ const payType = defineModel<string>()
95
+ const groupValue = ref(payType.value)
96
+ 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
+ )
109
+ onMounted(() => {
110
+ for (let i = 0; i < (props.data?.length || 0); i++) {
111
+ const item = props.data![i]
112
+ if (item.content || item.items) {
113
+ const defaultChild = (item.content || item.items)?.find((child) => child.defaultChecked)
114
+ if (defaultChild) {
115
+ groupValue.value = defaultChild.walletAccountId
116
+ break
117
+ }
118
+ }
119
+ if (item.defaultChecked) {
120
+ groupValue.value = item.type
121
+ break
122
+ }
123
+ }
124
+ })
125
+ const onModifyPrice = (price: number, max: number) => {
126
+ message
127
+ .prompt({
128
+ title: '请输入金额',
129
+ inputValue: price,
130
+ inputType: 'number',
131
+ inputPlaceholder: `金额`,
132
+ beforeConfirm: ({ resolve, value }) => {
133
+ const num = Number(value)
134
+ if (num > max) {
135
+ uni.showToast({
136
+ title: `最多${max}元`,
137
+ icon: 'none',
138
+ })
139
+ resolve(false)
140
+ } else if (`${value}`.split('.')[1]?.length > 2) {
141
+ uni.showToast({
142
+ title: '最多两位小数',
143
+ icon: 'none',
144
+ })
145
+ resolve(false)
146
+ } else {
147
+ resolve(true)
148
+ }
149
+ },
150
+ })
151
+ .then((resp) => {
152
+ if (resp.action === 'confirm') {
153
+ emits('onWalletPriceChange', Number(resp.value))
154
+ }
155
+ })
156
+ }
157
+ </script>
158
+ <style lang="scss">
159
+ .pay-group {
160
+ :deep(.wd-radio-group) {
161
+ display: flex;
162
+ flex-direction: column;
163
+ gap: 24rpx;
164
+ }
165
+ :deep(.wd-radio) {
166
+ padding: 0 !important;
167
+ .wd-radio__label {
168
+ flex: 1;
169
+ }
170
+ }
171
+ :deep(.wd-cell) {
172
+ padding: 0px !important;
173
+ .wd-cell__wrapper {
174
+ padding: 0px !important;
175
+ }
176
+ }
177
+ }
178
+ </style>
@@ -0,0 +1,31 @@
1
+ import { LcbActionViewProps } from '../lcb-action-view/types'
2
+ export interface ChildDetail {
3
+ walletAccountId: string
4
+ name: string
5
+ title: string
6
+ link: LcbActionViewProps
7
+ defaultChecked?: boolean
8
+ content: string
9
+ useWalletPrice?: number
10
+ usableWalletPrice?: number
11
+ walletEditTip?: string
12
+ }
13
+
14
+ export interface ChildContent {
15
+ title: string
16
+ price?: number
17
+ type: string
18
+ icon?: string
19
+ subTitle: string
20
+ defaultChecked?: boolean
21
+ button: {
22
+ name: string
23
+ link: LcbActionViewProps
24
+ }
25
+ content?: ChildDetail[]
26
+ intro?: string
27
+ items?: ChildDetail[]
28
+ }
29
+ export interface LcbOrderPaymentProps {
30
+ data: ChildContent[]
31
+ }
package/global.d.ts CHANGED
@@ -15,6 +15,7 @@ declare module 'vue' {
15
15
  'lcb-calendar-filter': (typeof import('@tplc/business/components/lcb-calendar-filter/lcb-calendar-filter.vue'))['default']
16
16
  'lcb-calendar-search': (typeof import('@tplc/business/components/lcb-calendar-search/lcb-calendar-search.vue'))['default']
17
17
  'lcb-city-select': (typeof import('@tplc/business/components/lcb-city-select/lcb-city-select.vue'))['default']
18
+ 'lcb-custom-content': (typeof import('@tplc/business/components/lcb-custom-content/lcb-custom-content.vue'))['default']
18
19
  'lcb-dynamic-data': (typeof import('@tplc/business/components/lcb-dynamic-data/lcb-dynamic-data.vue'))['default']
19
20
  'lcb-fab': (typeof import('@tplc/business/components/lcb-fab/lcb-fab.vue'))['default']
20
21
  'lcb-filter-grid': (typeof import('@tplc/business/components/lcb-filter-grid/lcb-filter-grid.vue'))['default']
@@ -30,6 +31,7 @@ declare module 'vue' {
30
31
  'lcb-nav': (typeof import('@tplc/business/components/lcb-nav/lcb-nav.vue'))['default']
31
32
  'lcb-notice': (typeof import('@tplc/business/components/lcb-notice/lcb-notice.vue'))['default']
32
33
  'lcb-operation-actions': (typeof import('@tplc/business/components/lcb-operation-actions/lcb-operation-actions.vue'))['default']
34
+ 'lcb-order-payment': (typeof import('@tplc/business/components/lcb-order-payment/lcb-order-payment.vue'))['default']
33
35
  'lcb-particulars': (typeof import('@tplc/business/components/lcb-particulars/lcb-particulars.vue'))['default']
34
36
  'lcb-poster': (typeof import('@tplc/business/components/lcb-poster/lcb-poster.vue'))['default']
35
37
  'lcb-product': (typeof import('@tplc/business/components/lcb-product/lcb-product.vue'))['default']
@@ -50,7 +52,6 @@ declare module 'vue' {
50
52
  'lcb-waterfall': (typeof import('@tplc/business/components/lcb-waterfall/lcb-waterfall.vue'))['default']
51
53
  'lcb-wrapper-item': (typeof import('@tplc/business/components/lcb-wrapper-item/lcb-wrapper-item.vue'))['default']
52
54
  'lcb-wrapper-list': (typeof import('@tplc/business/components/lcb-wrapper-list/lcb-wrapper-list.vue'))['default']
53
- 'lcb-custom-content': (typeof import('@tplc/business/components/lcb-custom-content/lcb-custom-content.vue'))['default']
54
55
  }
55
56
  }
56
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.201",
3
+ "version": "0.5.2",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -0,0 +1,38 @@
1
+ import type { LcbOrderPaymentProps } from './types'
2
+ declare let __VLS_typeProps: LcbOrderPaymentProps
3
+ type __VLS_PublicProps = {
4
+ modelValue?: string
5
+ } & typeof __VLS_typeProps
6
+ declare const _default: import('vue').DefineComponent<
7
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
8
+ {},
9
+ unknown,
10
+ {},
11
+ {},
12
+ import('vue').ComponentOptionsMixin,
13
+ import('vue').ComponentOptionsMixin,
14
+ {
15
+ 'update:modelValue': (modelValue: string) => void
16
+ onWalletPriceChange: (...args: any[]) => void
17
+ },
18
+ string,
19
+ import('vue').PublicProps,
20
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
21
+ 'onUpdate:modelValue'?: ((modelValue: string) => any) | undefined
22
+ onOnWalletPriceChange?: ((...args: any[]) => any) | undefined
23
+ },
24
+ {},
25
+ {}
26
+ >
27
+ export default _default
28
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
29
+ type __VLS_TypePropsToOption<T> = {
30
+ [K in keyof T]-?: {} extends Pick<T, K>
31
+ ? {
32
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
33
+ }
34
+ : {
35
+ type: import('vue').PropType<T[K]>
36
+ required: true
37
+ }
38
+ }
@@ -0,0 +1,30 @@
1
+ import { LcbActionViewProps } from '../lcb-action-view/types'
2
+ export interface ChildDetail {
3
+ walletAccountId: string
4
+ name: string
5
+ title: string
6
+ link: LcbActionViewProps
7
+ defaultChecked?: boolean
8
+ content: string
9
+ useWalletPrice?: number
10
+ usableWalletPrice?: number
11
+ walletEditTip?: string
12
+ }
13
+ export interface ChildContent {
14
+ title: string
15
+ price?: number
16
+ type: string
17
+ icon?: string
18
+ subTitle: string
19
+ defaultChecked?: boolean
20
+ button: {
21
+ name: string
22
+ link: LcbActionViewProps
23
+ }
24
+ content?: ChildDetail[]
25
+ intro?: string
26
+ items?: ChildDetail[]
27
+ }
28
+ export interface LcbOrderPaymentProps {
29
+ data: ChildContent[]
30
+ }