@tplc/business 0.4.195 → 0.4.197

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.4.197](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.196...v0.4.197) (2025-09-27)
6
+
7
+ ### [0.4.196](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.4.195...v0.4.196) (2025-09-27)
8
+
9
+
10
+ ### ✨ Features | 新功能
11
+
12
+ * tabs 支持修改字体粗细 大小 ([e82aae2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/e82aae25719dcd3e00d57a1116f7a18f1d3de915))
13
+
5
14
  ### [0.4.195](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.98...v0.4.195) (2025-09-09)
6
15
 
7
16
  ### [0.4.194](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.193...v0.4.194) (2025-09-06)
package/action.d.ts CHANGED
@@ -49,7 +49,7 @@ export interface LcbGlobal {
49
49
  mainConfig?: Record<string, any>
50
50
  otherConfig?: Record<string, any>
51
51
  }
52
- messageStore?:() => {
52
+ messageStore?: () => {
53
53
  messageCount: number
54
54
  getCount: () => void
55
55
  }
@@ -73,3 +73,13 @@ global {
73
73
  $lcb: LcbGlobal
74
74
  }
75
75
  }
76
+
77
+ export interface TextRenderViewItem {
78
+ items: {
79
+ content?: string
80
+ style?: Record<string, any>
81
+ link?: LcbActionViewProps
82
+ children?: TextRenderViewItem['items']
83
+ }[]
84
+ style?: Record<string, any>
85
+ }
package/api/pay.ts ADDED
@@ -0,0 +1,59 @@
1
+ // /api/productOrder/commitOrder
2
+ export type CommitPageDetailParams = {
3
+ orderIndexToken?: string
4
+ userAddressId?: string
5
+ pointFlag?: boolean
6
+ useWalletPrice?: number
7
+ pickupInfo?: {
8
+ address: string
9
+ longitude: string
10
+ latitude: string
11
+ title: string
12
+ distance: number
13
+ }
14
+ orderType: string
15
+ /** 下单使用的积分数量 */
16
+ point?: number
17
+ /** 政府补贴 */
18
+ payType?: string
19
+ govVoucherId?: string
20
+ postageType?: number
21
+ /** 选择支付的钱包ID */
22
+ walletAccountId?: string
23
+ /** 平台优惠券 */
24
+ platformVoucherId?: string
25
+ orderNo?: string
26
+ /** 商家优惠券抵扣 */
27
+ merchantVoucherId?: string
28
+ productId?: string
29
+ toStoreFlag?: boolean
30
+ remark?: string
31
+ contactsPhone?: string
32
+ contactsName?: string
33
+ buyQuantity?: number
34
+ toStoreTime?: string
35
+ selectRemark?: string[]
36
+ }
37
+ /** 提交订单 */
38
+ export const commitOrder = async (info: CommitPageDetailParams) => {
39
+ const data = await uni.$lcb.http.post<{
40
+ orderNo: string
41
+ paymentParams: any
42
+ wakePayment: boolean
43
+ }>('/productOrder/commitOrder', {
44
+ ...info,
45
+ paymentPlatform: 'wechat',
46
+ paymentType: 'JSAPI',
47
+ })
48
+ return data
49
+ }
50
+ /** 查询订单支付状态 */
51
+ export const queryOrderPaymentStatus = async (orderNo: string) => {
52
+ const { data } = await uni.$lcb.http.post<{ status: number }>(
53
+ '/productOrder/queryOrderPaymentStatus',
54
+ {
55
+ orderNo,
56
+ },
57
+ )
58
+ return data
59
+ }
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <wd-popup v-model="show" :z-index="1000" custom-class="!rounded-20rpx" closable>
3
+ <view
4
+ class="popup-view"
5
+ :style="{
6
+ width: '90vw',
7
+ }"
8
+ >
9
+ <view class="title">支付</view>
10
+ <view class="p-3">
11
+ <lcb-custom-content v-bind="dataInfo?.customContent" v-if="dataInfo?.customContent" />
12
+ <OrderPayment
13
+ v-model="form.payType"
14
+ :data="dataInfo?.commitPagePaymentMethod"
15
+ @onWalletPriceChange="onWalletPriceChange"
16
+ />
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>
21
+ </view>
22
+ </view>
23
+ </wd-popup>
24
+ </template>
25
+ <script setup lang="ts">
26
+ import { TextRenderViewItem } from '../../../../action'
27
+ import usePay from '../../../../hooks/usePay'
28
+ import { ref, watch } from 'vue'
29
+ const form = ref({
30
+ payType: '',
31
+ useWalletPrice: 0,
32
+ })
33
+
34
+ const [pay] = usePay(() =>
35
+ uni.$lcb.http.post(props.submitRequestInfo.requestUrl, {
36
+ ...props.submitRequestInfo.requestParams,
37
+ ...form.value,
38
+ }),
39
+ )
40
+
41
+ const props = defineProps<{
42
+ requestInfo: {
43
+ requestUrl: string
44
+ requestParams: Record<string, any>
45
+ }
46
+ submitRequestInfo: {
47
+ requestUrl: string
48
+ requestParams: Record<string, any>
49
+ }
50
+ }>()
51
+ const show = defineModel({ default: false })
52
+ const dataInfo = ref<{
53
+ commitPagePaymentMethod: any
54
+ customContent: TextRenderViewItem
55
+ }>()
56
+ watch(
57
+ () => show.value,
58
+ async (newVal) => {
59
+ if (newVal) {
60
+ const data = (await uni.$lcb.http.post(
61
+ props.requestInfo.requestUrl,
62
+ props.requestInfo.requestParams,
63
+ )) as any
64
+ dataInfo.value = data
65
+ }
66
+ },
67
+ )
68
+ const onWalletPriceChange = (useWalletPrice: number) => {
69
+ form.value.useWalletPrice = useWalletPrice
70
+ }
71
+ const onCancel = () => {
72
+ show.value = false
73
+ }
74
+ </script>
75
+ <style lang="scss" scoped>
76
+ .popup-view {
77
+ .title {
78
+ position: relative;
79
+ font-size: 32rpx;
80
+ font-weight: 500;
81
+ line-height: 96rpx;
82
+ text-align: center;
83
+ border-radius: 20rpx;
84
+ box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(243, 245, 249, 0.94);
85
+ }
86
+ }
87
+ </style>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <view :style="customStyle || { display: 'flex', flexDirection: 'row', alignItems: 'center' }">
3
+ <block v-for="(item, index) in items" :key="index">
4
+ <lcb-action-view :custom-style="item.style" v-bind="item.link" v-if="item.link">
5
+ {{ item.content }}
6
+ </lcb-action-view>
7
+ <TextRenderView v-else-if="item.children" :items="item.children" :customStyle="item.style" />
8
+ <view :style="item.style" v-else>
9
+ {{ item.content }}
10
+ </view>
11
+ </block>
12
+ </view>
13
+ </template>
14
+ <script setup lang="ts">
15
+ import type { TextRenderViewItem } from '../../action'
16
+
17
+ defineOptions({
18
+ name: 'LcbCustomContent',
19
+ options: {
20
+ addGlobalClass: true,
21
+ virtualHost: true,
22
+ styleIsolation: 'shared',
23
+ },
24
+ })
25
+ defineProps<
26
+ TextRenderViewItem & {
27
+ customStyle?: Record<string, any>
28
+ }
29
+ >()
30
+ </script>
@@ -0,0 +1,3 @@
1
+ export interface LcbCustomContentProps {
2
+ // Define the component's prop types here
3
+ }
@@ -0,0 +1,57 @@
1
+ import { commitOrder, queryOrderPaymentStatus, type CommitPageDetailParams } from '../api/pay'
2
+ import { onPageHide } from '@dcloudio/uni-app'
3
+ import { IResData } from '../action'
4
+ import { ref } from 'vue'
5
+ import { useRequest } from 'vue-hooks-plus'
6
+
7
+ const usePay = (
8
+ fun?: (data: unknown) => Promise<IResData<any>>,
9
+ queryStatusFun?: (orderNo: string) => Promise<any>,
10
+ ) => {
11
+ const successFun = ref()
12
+ const { runAsync, cancel } = useRequest(queryStatusFun || queryOrderPaymentStatus, {
13
+ manual: true,
14
+ pollingInterval: 1000,
15
+ onSuccess: ({ status }) => {
16
+ if (status === 1) {
17
+ uni.hideLoading()
18
+ cancel()
19
+ successFun.value?.()
20
+ }
21
+ },
22
+ })
23
+ const pay = async (
24
+ data: CommitPageDetailParams,
25
+ options?: {
26
+ onSuccess?: () => void
27
+ onError?: () => void
28
+ },
29
+ ) => {
30
+ const {
31
+ data: { orderNo, paymentParams, wakePayment },
32
+ } = await (fun || commitOrder)(data)
33
+ if (!wakePayment) {
34
+ options?.onSuccess?.()
35
+ runAsync(orderNo)
36
+ return
37
+ }
38
+ successFun.value = options?.onSuccess
39
+ uni.requestPayment({
40
+ provider: 'wxpay',
41
+ ...paymentParams,
42
+ success: () => {
43
+ uni.showLoading({
44
+ title: 'loading...',
45
+ mask: true,
46
+ })
47
+ runAsync(orderNo)
48
+ },
49
+ fail: options?.onError,
50
+ })
51
+ }
52
+ onPageHide(() => {
53
+ cancel?.()
54
+ })
55
+ return [pay]
56
+ }
57
+ export default usePay
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.195",
3
+ "version": "0.4.197",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -0,0 +1,47 @@
1
+ export type CommitPageDetailParams = {
2
+ orderIndexToken?: string
3
+ userAddressId?: string
4
+ pointFlag?: boolean
5
+ useWalletPrice?: number
6
+ pickupInfo?: {
7
+ address: string
8
+ longitude: string
9
+ latitude: string
10
+ title: string
11
+ distance: number
12
+ }
13
+ orderType: string
14
+ /** 下单使用的积分数量 */
15
+ point?: number
16
+ /** 政府补贴 */
17
+ payType?: string
18
+ govVoucherId?: string
19
+ postageType?: number
20
+ /** 选择支付的钱包ID */
21
+ walletAccountId?: string
22
+ /** 平台优惠券 */
23
+ platformVoucherId?: string
24
+ orderNo?: string
25
+ /** 商家优惠券抵扣 */
26
+ merchantVoucherId?: string
27
+ productId?: string
28
+ toStoreFlag?: boolean
29
+ remark?: string
30
+ contactsPhone?: string
31
+ contactsName?: string
32
+ buyQuantity?: number
33
+ toStoreTime?: string
34
+ selectRemark?: string[]
35
+ }
36
+ /** 提交订单 */
37
+ export declare const commitOrder: (info: CommitPageDetailParams) => Promise<
38
+ import('../action').IResData<{
39
+ orderNo: string
40
+ paymentParams: any
41
+ wakePayment: boolean
42
+ }>
43
+ >
44
+ /** 查询订单支付状态 */
45
+ export declare const queryOrderPaymentStatus: (orderNo: string) => Promise<{
46
+ status: number
47
+ }>
@@ -0,0 +1,44 @@
1
+ declare let __VLS_typeProps: {
2
+ requestInfo: {
3
+ requestUrl: string
4
+ requestParams: Record<string, any>
5
+ }
6
+ submitRequestInfo: {
7
+ requestUrl: string
8
+ requestParams: Record<string, any>
9
+ }
10
+ }
11
+ type __VLS_PublicProps = {
12
+ modelValue?: any
13
+ } & typeof __VLS_typeProps
14
+ declare const _default: import('vue').DefineComponent<
15
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
16
+ {},
17
+ unknown,
18
+ {},
19
+ {},
20
+ import('vue').ComponentOptionsMixin,
21
+ import('vue').ComponentOptionsMixin,
22
+ {
23
+ 'update:modelValue': (modelValue: any) => void
24
+ },
25
+ string,
26
+ import('vue').PublicProps,
27
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
28
+ 'onUpdate:modelValue'?: ((modelValue: any) => any) | undefined
29
+ },
30
+ {},
31
+ {}
32
+ >
33
+ export default _default
34
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
35
+ type __VLS_TypePropsToOption<T> = {
36
+ [K in keyof T]-?: {} extends Pick<T, K>
37
+ ? {
38
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
39
+ }
40
+ : {
41
+ type: import('vue').PropType<T[K]>
42
+ required: true
43
+ }
44
+ }
@@ -0,0 +1,40 @@
1
+ import type { TextRenderViewItem } from '../../action'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_TypePropsToOption<
4
+ TextRenderViewItem & {
5
+ customStyle?: Record<string, any>
6
+ }
7
+ >,
8
+ {},
9
+ unknown,
10
+ {},
11
+ {},
12
+ import('vue').ComponentOptionsMixin,
13
+ import('vue').ComponentOptionsMixin,
14
+ {},
15
+ string,
16
+ import('vue').PublicProps,
17
+ Readonly<
18
+ import('vue').ExtractPropTypes<
19
+ __VLS_TypePropsToOption<
20
+ TextRenderViewItem & {
21
+ customStyle?: Record<string, any>
22
+ }
23
+ >
24
+ >
25
+ >,
26
+ {},
27
+ {}
28
+ >
29
+ export default _default
30
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
31
+ type __VLS_TypePropsToOption<T> = {
32
+ [K in keyof T]-?: {} extends Pick<T, K>
33
+ ? {
34
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
35
+ }
36
+ : {
37
+ type: import('vue').PropType<T[K]>
38
+ required: true
39
+ }
40
+ }
@@ -65,8 +65,8 @@ declare const __VLS_component: import('vue').DefineComponent<
65
65
  imageWidth: number
66
66
  borderRadius: number
67
67
  imageHeight: number
68
- dynamicScope: string
69
68
  border: boolean
69
+ dynamicScope: string
70
70
  itemVerticalPadding: number
71
71
  itemHorizontalPadding: number
72
72
  listType: 'list' | 'horizontal' | 'grid' | 'waterfall'
@@ -0,0 +1,13 @@
1
+ import { type CommitPageDetailParams } from '../api/pay'
2
+ import { IResData } from '../action'
3
+ declare const usePay: (
4
+ fun?: (data: unknown) => Promise<IResData<any>>,
5
+ queryStatusFun?: (orderNo: string) => Promise<any>,
6
+ ) => ((
7
+ data: CommitPageDetailParams,
8
+ options?: {
9
+ onSuccess?: () => void
10
+ onError?: () => void
11
+ },
12
+ ) => Promise<void>)[]
13
+ export default usePay