@tplc/business 0.4.200 → 0.5.1

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,25 @@
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.1](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.201...v0.5.1) (2025-09-28)
6
+
7
+ ### [0.4.201](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.195...v0.4.201) (2025-09-28)
8
+
9
+
10
+ ### 🚀 Chore | 构建/工程依赖/工具
11
+
12
+ * **release:** 0.4.196 ([c7c1a13](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c7c1a130bc26b271280bcf19f8b4949fd773bc5b))
13
+ * **release:** 0.4.197 ([429c906](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/429c90628fa1c64696d8586f906f938cb2ff3363))
14
+ * **release:** 0.4.198 ([1966d27](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/1966d27bdfda3840bfb573cb5073c1148e85dd2d))
15
+ * **release:** 0.4.199 ([214449b](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/214449b823499bd37a5ba542ef79b4268e0cf7d7))
16
+ * **release:** 0.4.200 ([e003377](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/e0033779a16d9bf0da645d8c8be603064efbe58d))
17
+
18
+
19
+ ### ✨ Features | 新功能
20
+
21
+ * tabs 支持修改字体粗细 大小 ([e82aae2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/e82aae25719dcd3e00d57a1116f7a18f1d3de915))
22
+ * 支持 ([de0836a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/de0836a947e8afdffd087dabe3f1aea24a04e83c))
23
+
5
24
  ### [0.4.200](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.199...v0.4.200) (2025-09-27)
6
25
 
7
26
  ### [0.4.199](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.198...v0.4.199) (2025-09-27)
@@ -7,17 +7,18 @@
7
7
  }"
8
8
  >
9
9
  <view class="title">支付</view>
10
- <view class="p-3">
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
- </view>
18
- <view class="flex gap-5 mt-8">
19
- <wd-button plain @click="onCancel">取消</wd-button>
20
- <wd-button @click="pay" type="primary">支付</wd-button>
18
+ <view class="flex gap-5 mt-4">
19
+ <wd-button plain @click="onCancel">取消</wd-button>
20
+ <wd-button @click="pay" type="primary">支付</wd-button>
21
+ </view>
21
22
  </view>
22
23
  </view>
23
24
  </wd-popup>
@@ -28,7 +29,9 @@ import usePay from '../../../../hooks/usePay'
28
29
  import { ref, watch } from 'vue'
29
30
  const form = ref({
30
31
  payType: '',
31
- useWalletPrice: 0,
32
+ useWalletPrice: 84,
33
+ toStoreFlag: false,
34
+ walletAccountId: '' as string | undefined,
32
35
  })
33
36
 
34
37
  const [pay] = usePay(() =>
@@ -38,6 +41,24 @@ const [pay] = usePay(() =>
38
41
  }),
39
42
  )
40
43
 
44
+ watch(
45
+ () => form.value?.payType,
46
+ (val) => {
47
+ if (val) {
48
+ if (val === 'toStore') {
49
+ form.value.toStoreFlag = true
50
+ form.value.walletAccountId = undefined
51
+ } else if (val !== 'wechat') {
52
+ form.value.walletAccountId = val
53
+ form.value.toStoreFlag = false
54
+ } else {
55
+ form.value.walletAccountId = undefined
56
+ form.value.toStoreFlag = false
57
+ }
58
+ }
59
+ },
60
+ )
61
+
41
62
  const props = defineProps<{
42
63
  requestInfo: {
43
64
  requestUrl: string
@@ -57,13 +78,17 @@ watch(
57
78
  () => show.value,
58
79
  async (newVal) => {
59
80
  if (newVal) {
60
- const data = (await uni.$lcb.http.post(
81
+ const { data } = (await uni.$lcb.http.post(
61
82
  props.requestInfo.requestUrl,
62
83
  props.requestInfo.requestParams,
63
84
  )) as any
85
+ // form.value.payType = data.commitPagePaymentMethod.find((v) => v.defaultChecked)?.type
64
86
  dataInfo.value = data
65
87
  }
66
88
  },
89
+ {
90
+ immediate: true,
91
+ },
67
92
  )
68
93
  const onWalletPriceChange = (useWalletPrice: number) => {
69
94
  form.value.useWalletPrice = useWalletPrice
@@ -52,6 +52,12 @@
52
52
  </view>
53
53
  </view>
54
54
  </wd-popup>
55
+ <PayPopup
56
+ v-model="showPay"
57
+ :requestInfo="requestInfo"
58
+ :submitRequestInfo="submitRequestInfo"
59
+ v-if="[144].includes(getJumpType(jumpType)) && showPay"
60
+ />
55
61
  <SharePopup v-model="showPoster" :params="requestParam" />
56
62
  </template>
57
63
 
@@ -64,6 +70,7 @@ import SharePopup from '../lcb-nav/SharePopup/index.vue'
64
70
  import { useTranslate } from '@tplc/wot'
65
71
  import { PAGE_PROVIDE_KEY, USER_BASIC_INFO } from '../../constants'
66
72
  import { getTemplateMessageList, TemplateMessage } from '../../api/user'
73
+ import PayPopup from './components/PayPopup/index.vue'
67
74
  const { translate } = useTranslate()
68
75
  defineOptions({
69
76
  name: 'LcbActionView',
@@ -78,6 +85,7 @@ const props = defineProps<LcbActionViewProps>()
78
85
  const basicInfo = inject(USER_BASIC_INFO, {}) as unknown as Ref<Record<string, any>>
79
86
  const pageInfo = inject(PAGE_PROVIDE_KEY) as unknown as Ref<Record<string, any>>
80
87
  const showPoster = ref(false)
88
+ const showPay = ref(false)
81
89
  const emits = defineEmits<{
82
90
  (e: 'phone', value: { detail: { errMsg: string; encryptedData: string; iv: string } }): void
83
91
  (e: 'avatar', value: string): void
@@ -295,6 +303,9 @@ const onActionClick = async () => {
295
303
  })
296
304
  }
297
305
  break
306
+ case 144:
307
+ showPay.value = true
308
+ break
298
309
  default:
299
310
  emits('click', props)
300
311
  break
@@ -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.200",
3
+ "version": "0.5.1",
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
+ }