@tplc/business 0.3.1 → 0.3.4

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,17 @@
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.3.4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.3...v0.3.4) (2025-01-15)
6
+
7
+ ### [0.3.3](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.90...v0.3.3) (2025-01-15)
8
+
9
+
10
+ ### ✨ Features | 新功能
11
+
12
+ * vip 更新逻辑 ([3258697](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/32586973aefb4e26abdd689de6e70c2b5ea05532))
13
+ * 新增pro ([4a27d7b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4a27d7b7e304fa37f6bcfd174b484198476724c8))
14
+ * 调整拖拽问题 ([8e22a36](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8e22a365b7fb3ce5ebb1042152fdae90514c8bb3))
15
+
5
16
  ### [0.2.90](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.89...v0.2.90) (2025-01-13)
6
17
 
7
18
 
@@ -15,18 +15,18 @@
15
15
 
16
16
  <script setup lang="ts">
17
17
  import type { ButtonProps } from '@tplc/wot/components/wd-button/types'
18
- import type { IPageBtn, PageBtnProps } from '../../api'
18
+ import type { IPageBtn, LcbOperationActionsProps } from './types'
19
19
  import { useMessage } from '@tplc/wot'
20
20
  const message = useMessage()
21
21
  defineOptions({
22
- name: 'BtnViews',
22
+ name: 'LcbOperationActionsBtn',
23
23
  options: {
24
24
  addGlobalClass: true,
25
25
  virtualHost: true,
26
26
  styleIsolation: 'shared',
27
27
  },
28
28
  })
29
- withDefaults(defineProps<PageBtnProps>(), {
29
+ withDefaults(defineProps<LcbOperationActionsProps>(), {
30
30
  size: 'small',
31
31
  })
32
32
  const emits = defineEmits(['refresh'])
@@ -71,7 +71,7 @@ async function link({ item }: { item: IPageBtn }) {
71
71
  success: () => {
72
72
  uni.showToast({
73
73
  title: '支付成功',
74
- icon: 'success',
74
+ icon: 'none',
75
75
  })
76
76
  emits('refresh')
77
77
  },
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <lcb-action-view v-bind="$props" @refresh="$emit('refresh')" @click="handleClick" v-if="!popover">
3
+ <IconView :icon="icon" :iconName="iconName" :iconNameColor="iconNameColor" />
4
+ </lcb-action-view>
5
+ <IconView :icon="icon" :iconName="iconName" :iconNameColor="iconNameColor" v-else />
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import { ref, computed } from 'vue'
10
+ import IconView from './IconView.vue'
11
+
12
+ defineOptions({
13
+ name: 'LcbOperationActionsIcon',
14
+ options: {
15
+ addGlobalClass: true,
16
+ virtualHost: true,
17
+ styleIsolation: 'shared',
18
+ },
19
+ })
20
+ const props = defineProps<{
21
+ iconUrl?: string
22
+ iconName: string
23
+ iconNameColor?: string
24
+ confirmFlag?: boolean
25
+ requestInfo?: {
26
+ requestUrl: string
27
+ requestParams: Record<string, unknown>
28
+ }
29
+ popover?: boolean
30
+ }>()
31
+ const emits = defineEmits(['refresh'])
32
+ const current = ref(props.confirmFlag)
33
+ /** 如果icon是数组那就是类似收藏场景 按钮需要内部切换 */
34
+ const isIconList = props.iconUrl?.includes('[')
35
+ const icon = computed(() => {
36
+ if (props.iconUrl && isIconList) {
37
+ const urls = JSON.parse(props.iconUrl)
38
+ return urls[current.value ? 1 : 0]
39
+ } else {
40
+ return props.iconUrl
41
+ }
42
+ })
43
+ const handleClick = async () => {
44
+ if (isIconList && props.requestInfo) {
45
+ current.value = !current.value
46
+ await uni.$lcb.http.post(props.requestInfo.requestUrl, {
47
+ ...props.requestInfo.requestParams,
48
+ confirmFlag: current.value,
49
+ })
50
+ }
51
+ }
52
+ </script>
53
+ <style lang="scss" scoped></style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <view class="flex flex-col items-center min-h-56rpx justify-center">
3
+ <image :src="icon" class="w-5 h-5 box-border mb-1" v-if="icon" />
4
+ <view class="text-24rpx" :style="{ color: iconNameColor || '#333333' }">
5
+ {{ iconName }}
6
+ </view>
7
+ </view>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ defineOptions({
12
+ name: 'LcbOperationActionsIconView',
13
+ options: {
14
+ addGlobalClass: true,
15
+ virtualHost: true,
16
+ styleIsolation: 'shared',
17
+ },
18
+ })
19
+ defineProps<{
20
+ icon?: string
21
+ iconName: string
22
+ iconNameColor?: string
23
+ }>()
24
+ </script>
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <view @click.stop class="w-full page-btn-view">
3
+ <view class="flex gap-5 w-full items-center">
4
+ <block v-for="item in iconList" :key="item.iconName">
5
+ <wd-popover
6
+ mode="menu"
7
+ :content="getMenu(item.buttonList || [])"
8
+ @menuclick="link"
9
+ placement="top-start"
10
+ v-if="item.iconType === 2"
11
+ >
12
+ <IconActionView v-bind="item" popover />
13
+ </wd-popover>
14
+ <IconActionView v-bind="item" v-else @refresh="$emit('refresh')" />
15
+ </block>
16
+ <view class="flex-1"></view>
17
+ <BtnViews :button-list="buttonList" @refresh="emits('refresh')" :size="size" />
18
+ </view>
19
+ <wd-message-box />
20
+ </view>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import { LcbOperationActionsProps, IPageBtn } from './types'
25
+ import { useMessage } from '@tplc/wot'
26
+ import BtnViews from './BtnViews.vue'
27
+ import IconActionView from './IconActionView.vue'
28
+ defineOptions({
29
+ name: 'LcbOperationActions',
30
+ options: {
31
+ addGlobalClass: true,
32
+ virtualHost: true,
33
+ styleIsolation: 'shared',
34
+ },
35
+ })
36
+ defineProps<LcbOperationActionsProps>()
37
+ const emits = defineEmits(['refresh'])
38
+ const message = useMessage()
39
+ const getMenu = (list: IPageBtn[]) => {
40
+ return list.map((item) => {
41
+ return {
42
+ ...item,
43
+ content: item.buttonName,
44
+ }
45
+ })
46
+ }
47
+ function link({ item }: { item: IPageBtn }) {
48
+ if (item.popUpFlag) {
49
+ message
50
+ .confirm({
51
+ msg: item.popUpTip,
52
+ title: item.content,
53
+ })
54
+ .then(async () => {
55
+ if (item.buttonType === 1) {
56
+ await uni.$lcb.http.post(item.requestUrl, item.requestParam)
57
+ emits('refresh')
58
+ }
59
+ })
60
+ .catch(console.log)
61
+ } else if (item.jumpType === 2) {
62
+ uni.navigateTo({
63
+ url: item.jumpUrl,
64
+ })
65
+ }
66
+ }
67
+ </script>
68
+ <style lang="scss" scoped>
69
+ .page-btn-view {
70
+ :deep(.wd-button.is-medium) {
71
+ min-width: auto !important;
72
+ }
73
+ }
74
+ </style>
@@ -0,0 +1,41 @@
1
+ import type { ButtonProps } from '@tplc/wot/components/wd-button/types'
2
+
3
+ export interface IconList {
4
+ iconName: string
5
+ iconUrl: string
6
+ iconNameColor?: string
7
+ jumpUrl?: string
8
+ jumpPage?: string
9
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
10
+ buttonList?: IPageBtn[]
11
+ iconType?: number
12
+ }
13
+
14
+ export interface IPageBtn {
15
+ buttonKey: string
16
+ buttonName: string
17
+ buttonType: number
18
+ popUpFlag: boolean
19
+ popUpTip: string
20
+ content: string
21
+ requestParam?: {
22
+ orderNo: string
23
+ }
24
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
25
+ jumpUrl: string
26
+ requestUrl: string
27
+ jumpPage?: string
28
+ styleContent: {
29
+ buttonType: string
30
+ style: {
31
+ width: string
32
+ }
33
+ }
34
+ buttonProps?: ButtonProps
35
+ }
36
+
37
+ export interface LcbOperationActionsProps {
38
+ buttonList: IPageBtn[]
39
+ iconList?: IconList[]
40
+ size?: 'small' | 'medium' | 'large'
41
+ }
@@ -13,41 +13,102 @@
13
13
  <view class="text-3 text-#969696 mt-3.5" v-if="modelValue.qrCodeTips && currentLevelFlag">
14
14
  {{ modelValue.qrCodeTips }}
15
15
  </view>
16
- <template
16
+ <view
17
17
  v-if="
18
18
  ['voucher', 'cashVoucher'].includes(modelValue.userRightsType) &&
19
19
  !hiddenDrawdown &&
20
20
  currentLevelFlag
21
21
  "
22
+ class="mt-3"
22
23
  >
23
- <BtnViews :buttonList="modelValue.buttonList" />
24
- </template>
24
+ <lcb-operation-actions :button-list="modelValue.buttonList" @refresh="emits('refresh')" />
25
+ </view>
25
26
  </view>
26
27
  </wd-popup>
27
28
  </template>
28
29
 
29
30
  <script setup lang="ts">
30
- import BtnViews from '../BtnViews/index.vue'
31
+ import { useMessage } from '@tplc/wot'
31
32
  import { UserLevelRightsList } from '../../api'
33
+ import type { IPageBtn, PageBtnProps } from '../../api'
32
34
  import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
33
35
  import { watch, ref } from 'vue'
36
+ import { ButtonProps } from '@tplc/wot/types/components/wd-button/types'
37
+ const message = useMessage()
34
38
  const show = ref(false)
35
39
  defineProps<{
36
40
  hiddenDrawdown?: boolean
37
41
  currentLevelFlag?: boolean
42
+ size?: PageBtnProps['size']
38
43
  }>()
39
44
  const modelValue = defineModel<UserLevelRightsList>()
40
45
  watch(
41
46
  () => modelValue.value,
42
47
  (val) => {
48
+ console.log(modelValue.value, 'modelValue')
43
49
  if (val) show.value = true
44
50
  },
45
51
  )
46
52
 
53
+ const emits = defineEmits(['refresh'])
47
54
  const onClose = () => {
48
55
  show.value = false
49
56
  modelValue.value = undefined
50
57
  }
58
+ const getBtnProps = (item: IPageBtn) => {
59
+ return {
60
+ type: item.styleContent?.buttonType?.includes?.('theme') ? 'primary' : 'info',
61
+ plain: item.styleContent?.buttonType?.includes?.('Hollow'),
62
+ size: 'small',
63
+ ...item.buttonProps,
64
+ } as ButtonProps
65
+ }
66
+ async function link({ item }: { item: IPageBtn }) {
67
+ if (item.popUpFlag) {
68
+ message
69
+ .confirm({
70
+ msg: item.popUpTip,
71
+ title: item.content,
72
+ })
73
+ .then(async () => {
74
+ if (item.buttonType === 1) {
75
+ await uni.$lcb.http.post(item.requestUrl, item.requestParam)
76
+ emits('refresh')
77
+ }
78
+ })
79
+ .catch(console.log)
80
+ } else if (item.jumpType === 2) {
81
+ uni.navigateTo({
82
+ url: item.jumpUrl,
83
+ })
84
+ // 再次支付
85
+ } else if (item.buttonKey === 'orderPaymentBtn') {
86
+ const {
87
+ data: { paymentParams },
88
+ } = await uni.$lcb.http.post<any>(item.requestUrl, {
89
+ ...item.requestParam,
90
+ paymentPlatform: 'wechat',
91
+ paymentType: 'JSAPI',
92
+ })
93
+ uni.requestPayment({
94
+ provider: 'wxpay',
95
+ ...paymentParams,
96
+ success: () => {
97
+ uni.showToast({
98
+ title: '支付成功',
99
+ icon: 'success',
100
+ })
101
+ emits('refresh')
102
+ },
103
+ fail: () => {
104
+ uni.showToast({
105
+ title: '支付取消',
106
+ icon: 'none',
107
+ })
108
+ },
109
+ })
110
+ }
111
+ }
51
112
  </script>
52
113
  <style lang="scss" scoped>
53
114
  .pop-view {
package/global.d.ts CHANGED
@@ -22,6 +22,7 @@ declare module 'vue' {
22
22
  'lcb-map': (typeof import('@tplc/business/components/lcb-map/lcb-map.vue'))['default']
23
23
  'lcb-nav': (typeof import('@tplc/business/components/lcb-nav/lcb-nav.vue'))['default']
24
24
  'lcb-notice': (typeof import('@tplc/business/components/lcb-notice/lcb-notice.vue'))['default']
25
+ 'lcb-operation-actions': (typeof import('@tplc/business/components/lcb-operation-actions/lcb-operation-actions.vue'))['default']
25
26
  'lcb-poster': (typeof import('@tplc/business/components/lcb-poster/lcb-poster.vue'))['default']
26
27
  'lcb-product': (typeof import('@tplc/business/components/lcb-product/lcb-product.vue'))['default']
27
28
  'lcb-product-item': (typeof import('@tplc/business/components/lcb-product-item/lcb-product-item.vue'))['default']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.1",
3
+ "version": "0.3.4",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,7 +1,7 @@
1
- import type { PageBtnProps } from '../../api'
1
+ import type { LcbOperationActionsProps } from './types'
2
2
  declare const _default: import('vue').DefineComponent<
3
3
  __VLS_WithDefaults<
4
- __VLS_TypePropsToOption<PageBtnProps>,
4
+ __VLS_TypePropsToOption<LcbOperationActionsProps>,
5
5
  {
6
6
  size: string
7
7
  }
@@ -20,7 +20,7 @@ declare const _default: import('vue').DefineComponent<
20
20
  Readonly<
21
21
  import('vue').ExtractPropTypes<
22
22
  __VLS_WithDefaults<
23
- __VLS_TypePropsToOption<PageBtnProps>,
23
+ __VLS_TypePropsToOption<LcbOperationActionsProps>,
24
24
  {
25
25
  size: string
26
26
  }
@@ -0,0 +1,55 @@
1
+ declare const _default: import('vue').DefineComponent<
2
+ __VLS_TypePropsToOption<{
3
+ iconUrl?: string
4
+ iconName: string
5
+ iconNameColor?: string
6
+ confirmFlag?: boolean
7
+ requestInfo?: {
8
+ requestUrl: string
9
+ requestParams: Record<string, unknown>
10
+ }
11
+ popover?: boolean
12
+ }>,
13
+ {},
14
+ unknown,
15
+ {},
16
+ {},
17
+ import('vue').ComponentOptionsMixin,
18
+ import('vue').ComponentOptionsMixin,
19
+ {
20
+ refresh: (...args: any[]) => void
21
+ },
22
+ string,
23
+ import('vue').PublicProps,
24
+ Readonly<
25
+ import('vue').ExtractPropTypes<
26
+ __VLS_TypePropsToOption<{
27
+ iconUrl?: string
28
+ iconName: string
29
+ iconNameColor?: string
30
+ confirmFlag?: boolean
31
+ requestInfo?: {
32
+ requestUrl: string
33
+ requestParams: Record<string, unknown>
34
+ }
35
+ popover?: boolean
36
+ }>
37
+ >
38
+ > & {
39
+ onRefresh?: ((...args: any[]) => any) | undefined
40
+ },
41
+ {},
42
+ {}
43
+ >
44
+ export default _default
45
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
46
+ type __VLS_TypePropsToOption<T> = {
47
+ [K in keyof T]-?: {} extends Pick<T, K>
48
+ ? {
49
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
50
+ }
51
+ : {
52
+ type: import('vue').PropType<T[K]>
53
+ required: true
54
+ }
55
+ }
@@ -0,0 +1,39 @@
1
+ declare const _default: import('vue').DefineComponent<
2
+ __VLS_TypePropsToOption<{
3
+ icon?: string
4
+ iconName: string
5
+ iconNameColor?: string
6
+ }>,
7
+ {},
8
+ unknown,
9
+ {},
10
+ {},
11
+ import('vue').ComponentOptionsMixin,
12
+ import('vue').ComponentOptionsMixin,
13
+ {},
14
+ string,
15
+ import('vue').PublicProps,
16
+ Readonly<
17
+ import('vue').ExtractPropTypes<
18
+ __VLS_TypePropsToOption<{
19
+ icon?: string
20
+ iconName: string
21
+ iconNameColor?: string
22
+ }>
23
+ >
24
+ >,
25
+ {},
26
+ {}
27
+ >
28
+ export default _default
29
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
30
+ type __VLS_TypePropsToOption<T> = {
31
+ [K in keyof T]-?: {} extends Pick<T, K>
32
+ ? {
33
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
34
+ }
35
+ : {
36
+ type: import('vue').PropType<T[K]>
37
+ required: true
38
+ }
39
+ }
@@ -0,0 +1,32 @@
1
+ import { LcbOperationActionsProps } from './types'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_TypePropsToOption<LcbOperationActionsProps>,
4
+ {},
5
+ unknown,
6
+ {},
7
+ {},
8
+ import('vue').ComponentOptionsMixin,
9
+ import('vue').ComponentOptionsMixin,
10
+ {
11
+ refresh: (...args: any[]) => void
12
+ },
13
+ string,
14
+ import('vue').PublicProps,
15
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<LcbOperationActionsProps>>> & {
16
+ onRefresh?: ((...args: any[]) => any) | undefined
17
+ },
18
+ {},
19
+ {}
20
+ >
21
+ export default _default
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
23
+ type __VLS_TypePropsToOption<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K>
25
+ ? {
26
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
27
+ }
28
+ : {
29
+ type: import('vue').PropType<T[K]>
30
+ required: true
31
+ }
32
+ }
@@ -0,0 +1,38 @@
1
+ import type { ButtonProps } from '@tplc/wot/components/wd-button/types'
2
+ export interface IconList {
3
+ iconName: string
4
+ iconUrl: string
5
+ iconNameColor?: string
6
+ jumpUrl?: string
7
+ jumpPage?: string
8
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
9
+ buttonList?: IPageBtn[]
10
+ iconType?: number
11
+ }
12
+ export interface IPageBtn {
13
+ buttonKey: string
14
+ buttonName: string
15
+ buttonType: number
16
+ popUpFlag: boolean
17
+ popUpTip: string
18
+ content: string
19
+ requestParam?: {
20
+ orderNo: string
21
+ }
22
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
23
+ jumpUrl: string
24
+ requestUrl: string
25
+ jumpPage?: string
26
+ styleContent: {
27
+ buttonType: string
28
+ style: {
29
+ width: string
30
+ }
31
+ }
32
+ buttonProps?: ButtonProps
33
+ }
34
+ export interface LcbOperationActionsProps {
35
+ buttonList: IPageBtn[]
36
+ iconList?: IconList[]
37
+ size?: 'small' | 'medium' | 'large'
38
+ }
@@ -1,7 +1,9 @@
1
1
  import { UserLevelRightsList } from '../../api'
2
+ import type { PageBtnProps } from '../../api'
2
3
  declare let __VLS_typeProps: {
3
4
  hiddenDrawdown?: boolean
4
5
  currentLevelFlag?: boolean
6
+ size?: PageBtnProps['size']
5
7
  }
6
8
  type __VLS_PublicProps = {
7
9
  modelValue?: UserLevelRightsList
@@ -16,11 +18,13 @@ declare const _default: import('vue').DefineComponent<
16
18
  import('vue').ComponentOptionsMixin,
17
19
  {
18
20
  'update:modelValue': (modelValue: UserLevelRightsList) => void
21
+ refresh: (...args: any[]) => void
19
22
  },
20
23
  string,
21
24
  import('vue').PublicProps,
22
25
  Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
23
26
  'onUpdate:modelValue'?: ((modelValue: UserLevelRightsList) => any) | undefined
27
+ onRefresh?: ((...args: any[]) => any) | undefined
24
28
  },
25
29
  {},
26
30
  {}