@tplc/business 0.2.89 → 0.3.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,13 @@
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.2.90](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.89...v0.2.90) (2025-01-13)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * prodcut 阴影 ([ffe2720](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ffe27203454da157efa96b4ef11389692bc17fc3))
11
+
5
12
  ### [0.2.89](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.88...v0.2.89) (2025-01-12)
6
13
 
7
14
 
@@ -9,10 +9,18 @@
9
9
  :style="{
10
10
  fontWeight,
11
11
  }"
12
- :class="{
13
- 'title-line': showTitleLine,
14
- }"
12
+ class="flex items-center"
15
13
  >
14
+ <view
15
+ v-if="showTitleLine"
16
+ class="h-90%"
17
+ :style="{
18
+ backgroundColor: lineColor || themeColor,
19
+ marginRight: transformValueUnit(lineRight),
20
+ width: transformValueUnit(lineWidth),
21
+ borderRadius: transformValueUnit(lineWidth / 2),
22
+ }"
23
+ />
16
24
  {{ title }}
17
25
  </view>
18
26
  <view
@@ -45,6 +53,8 @@
45
53
  <script setup lang="ts">
46
54
  import { LcbTitleProps } from './types'
47
55
  import { transformValueUnit } from '../../utils/transform'
56
+ import { inject } from 'vue'
57
+ const themeColor = inject('theme-color', '#3875FF')
48
58
  defineOptions({
49
59
  name: 'LcbTitle',
50
60
  options: {
@@ -67,22 +77,7 @@ withDefaults(defineProps<LcbTitleProps>(), {
67
77
  hintColor: '#666',
68
78
  hintVerticalAlign: 'end',
69
79
  showTitleLine: false,
80
+ lineRight: 12,
81
+ lineWidth: 6,
70
82
  })
71
83
  </script>
72
- <style lang="scss" scoped>
73
- @import '@tplc/wot/components/common/abstracts/variable';
74
- .title-line {
75
- position: relative;
76
- padding-left: 10rpx !important;
77
- &::after {
78
- content: '';
79
- position: absolute;
80
- top: 5%;
81
- left: 0;
82
- border-radius: 4rpx;
83
- width: 6rpx;
84
- height: 90%;
85
- background-color: $-color-theme;
86
- }
87
- }
88
- </style>
@@ -17,6 +17,9 @@ export interface LcbTitleProps extends LcbBlockProps {
17
17
  hintFontSize?: number
18
18
  hintVerticalAlign?: 'end' | 'center'
19
19
  showTitleLine?: boolean
20
+ lineRight?: number
21
+ lineColor?: string
22
+ lineWidth?: number
20
23
 
21
24
  moreColor?: string
22
25
  moreFontSize?: number
@@ -1,5 +1,38 @@
1
1
  import { LcbActionViewProps } from '../../lcb-action-view/types'
2
2
  import { ActionView } from '../../../action'
3
+ import { ButtonProps } from '@tplc/wot/types/components/wd-button/types'
4
+
5
+ export interface PageBtnProps {
6
+ buttonList: IPageBtn[]
7
+ size?: 'small' | 'medium' | 'large'
8
+ }
9
+ export interface IPageBtn {
10
+ buttonKey: string
11
+ buttonName: string
12
+ buttonType: number
13
+ popUpFlag: boolean
14
+ popUpTip: string
15
+ content: string
16
+ requestParam?: RequestParam
17
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
18
+ jumpUrl: string
19
+ requestUrl: string
20
+ jumpPage?: string
21
+ styleContent: StyleContent2
22
+ buttonProps?: ButtonProps
23
+ }
24
+ interface StyleContent2 {
25
+ buttonType: string
26
+ style: Style
27
+ }
28
+
29
+ interface Style {
30
+ width: string
31
+ }
32
+
33
+ interface RequestParam {
34
+ orderNo: string
35
+ }
3
36
 
4
37
  export interface CurrentRightsDetail {
5
38
  coverImg: string
@@ -20,6 +53,7 @@ export interface UserLevelRightsList extends ActionView {
20
53
  icon: string
21
54
  userRightsConfigId: string
22
55
  userRightsContent: string
56
+ buttonList: IPageBtn[]
23
57
  userRightsSubTitle: string
24
58
  userRightsTitle: string
25
59
  link: LcbActionViewProps
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <lcb-action-view
3
+ v-bind="item"
4
+ v-for="item in buttonList"
5
+ :key="item.buttonName"
6
+ @click="link({ item })"
7
+ @refresh="$emit('refresh')"
8
+ >
9
+ <wd-button v-bind="getBtnProps(item)" :size="size">{{ item.buttonName }}</wd-button>
10
+ </lcb-action-view>
11
+ <view class="absolute">
12
+ <wd-message-box />
13
+ </view>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import type { ButtonProps } from '@tplc/wot/components/wd-button/types'
18
+ import type { IPageBtn, PageBtnProps } from '../../api'
19
+ import { useMessage } from '@tplc/wot'
20
+ const message = useMessage()
21
+ defineOptions({
22
+ name: 'BtnViews',
23
+ options: {
24
+ addGlobalClass: true,
25
+ virtualHost: true,
26
+ styleIsolation: 'shared',
27
+ },
28
+ })
29
+ withDefaults(defineProps<PageBtnProps>(), {
30
+ size: 'small',
31
+ })
32
+ const emits = defineEmits(['refresh'])
33
+ const getBtnProps = (item: IPageBtn) => {
34
+ return {
35
+ type: item.styleContent?.buttonType?.includes?.('theme') ? 'primary' : 'info',
36
+ plain: item.styleContent?.buttonType?.includes?.('Hollow'),
37
+ size: 'small',
38
+ ...item.buttonProps,
39
+ } as ButtonProps
40
+ }
41
+ async function link({ item }: { item: IPageBtn }) {
42
+ if (item.popUpFlag) {
43
+ message
44
+ .confirm({
45
+ msg: item.popUpTip,
46
+ title: item.content,
47
+ })
48
+ .then(async () => {
49
+ if (item.buttonType === 1) {
50
+ await uni.$lcb.http.post(item.requestUrl, item.requestParam)
51
+ emits('refresh')
52
+ }
53
+ })
54
+ .catch(console.log)
55
+ } else if (item.jumpType === 2) {
56
+ uni.navigateTo({
57
+ url: item.jumpUrl,
58
+ })
59
+ // 再次支付
60
+ } else if (item.buttonKey === 'orderPaymentBtn') {
61
+ const {
62
+ data: { paymentParams },
63
+ } = await uni.$lcb.http.post<any>(item.requestUrl, {
64
+ ...item.requestParam,
65
+ paymentPlatform: 'wechat',
66
+ paymentType: 'JSAPI',
67
+ })
68
+ uni.requestPayment({
69
+ provider: 'wxpay',
70
+ ...paymentParams,
71
+ success: () => {
72
+ uni.showToast({
73
+ title: '支付成功',
74
+ icon: 'success',
75
+ })
76
+ emits('refresh')
77
+ },
78
+ fail: () => {
79
+ uni.showToast({
80
+ title: '支付取消',
81
+ icon: 'none',
82
+ })
83
+ },
84
+ })
85
+ }
86
+ }
87
+ </script>
@@ -8,34 +8,29 @@
8
8
  :size="130"
9
9
  canvasId="qrCode"
10
10
  :value="modelValue.qrCode"
11
- v-if="modelValue.qrCode"
11
+ v-if="modelValue.qrCode && currentLevelFlag"
12
12
  />
13
- <view class="text-3 text-#969696 mt-3.5" v-if="modelValue.qrCodeTips">
13
+ <view class="text-3 text-#969696 mt-3.5" v-if="modelValue.qrCodeTips && currentLevelFlag">
14
14
  {{ modelValue.qrCodeTips }}
15
15
  </view>
16
- <wd-button
17
- type="primary"
18
- plain
19
- custom-class="!rounded-10rpx !mt-4 "
20
- @click="onDrawdown"
16
+ <template
21
17
  v-if="
22
18
  ['voucher', 'cashVoucher'].includes(modelValue.userRightsType) &&
23
19
  !hiddenDrawdown &&
24
20
  currentLevelFlag
25
21
  "
26
22
  >
27
- {{ translate('领取') }}
28
- </wd-button>
23
+ <BtnViews :buttonList="modelValue.buttonList" />
24
+ </template>
29
25
  </view>
30
26
  </wd-popup>
31
27
  </template>
32
28
 
33
29
  <script setup lang="ts">
34
- import { useTranslate } from '@tplc/wot'
30
+ import BtnViews from '../BtnViews/index.vue'
35
31
  import { UserLevelRightsList } from '../../api'
36
32
  import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
37
33
  import { watch, ref } from 'vue'
38
- const { translate } = useTranslate()
39
34
  const show = ref(false)
40
35
  defineProps<{
41
36
  hiddenDrawdown?: boolean
@@ -48,11 +43,7 @@ watch(
48
43
  if (val) show.value = true
49
44
  },
50
45
  )
51
- const onDrawdown = () => {
52
- uni.navigateTo({
53
- url: `${uni.$lcb.internalPages.drawdown}?from=vip&id=${modelValue.value?.userRightsConfigId}`,
54
- })
55
- }
46
+
56
47
  const onClose = () => {
57
48
  show.value = false
58
49
  modelValue.value = undefined
@@ -46,7 +46,7 @@
46
46
  titleKey="userRightsTitle"
47
47
  @click="onItemClick"
48
48
  />
49
- <InfoDialog v-model="current" />
49
+ <InfoDialog v-model="current" currentLevelFlag />
50
50
  </view>
51
51
  </lcb-block>
52
52
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.2.89",
3
+ "version": "0.3.1",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -16,6 +16,8 @@ declare const _default: import('vue').DefineComponent<
16
16
  hintColor: string
17
17
  hintVerticalAlign: string
18
18
  showTitleLine: boolean
19
+ lineRight: number
20
+ lineWidth: number
19
21
  }
20
22
  >,
21
23
  {},
@@ -45,6 +47,8 @@ declare const _default: import('vue').DefineComponent<
45
47
  hintColor: string
46
48
  hintVerticalAlign: string
47
49
  showTitleLine: boolean
50
+ lineRight: number
51
+ lineWidth: number
48
52
  }
49
53
  >
50
54
  >
@@ -52,6 +56,7 @@ declare const _default: import('vue').DefineComponent<
52
56
  {
53
57
  title: string
54
58
  color: string
59
+ lineWidth: number
55
60
  marginHorizontal: number
56
61
  fontSize: number
57
62
  justify:
@@ -65,6 +70,7 @@ declare const _default: import('vue').DefineComponent<
65
70
  hintFontSize: number
66
71
  hintVerticalAlign: 'end' | 'center'
67
72
  showTitleLine: boolean
73
+ lineRight: number
68
74
  moreColor: string
69
75
  moreFontSize: number
70
76
  moreVerticalAlign: 'end' | 'center'
@@ -16,6 +16,9 @@ export interface LcbTitleProps extends LcbBlockProps {
16
16
  hintFontSize?: number
17
17
  hintVerticalAlign?: 'end' | 'center'
18
18
  showTitleLine?: boolean
19
+ lineRight?: number
20
+ lineColor?: string
21
+ lineWidth?: number
19
22
  moreColor?: string
20
23
  moreFontSize?: number
21
24
  moreText?: string
@@ -1,5 +1,35 @@
1
1
  import { LcbActionViewProps } from '../../lcb-action-view/types'
2
2
  import { ActionView } from '../../../action'
3
+ import { ButtonProps } from '@tplc/wot/types/components/wd-button/types'
4
+ export interface PageBtnProps {
5
+ buttonList: IPageBtn[]
6
+ size?: 'small' | 'medium' | 'large'
7
+ }
8
+ export interface IPageBtn {
9
+ buttonKey: string
10
+ buttonName: string
11
+ buttonType: number
12
+ popUpFlag: boolean
13
+ popUpTip: string
14
+ content: string
15
+ requestParam?: RequestParam
16
+ jumpType?: 1 | 2 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 88
17
+ jumpUrl: string
18
+ requestUrl: string
19
+ jumpPage?: string
20
+ styleContent: StyleContent2
21
+ buttonProps?: ButtonProps
22
+ }
23
+ interface StyleContent2 {
24
+ buttonType: string
25
+ style: Style
26
+ }
27
+ interface Style {
28
+ width: string
29
+ }
30
+ interface RequestParam {
31
+ orderNo: string
32
+ }
3
33
  export interface CurrentRightsDetail {
4
34
  coverImg: string
5
35
  effectiveDate: string
@@ -18,6 +48,7 @@ export interface UserLevelRightsList extends ActionView {
18
48
  icon: string
19
49
  userRightsConfigId: string
20
50
  userRightsContent: string
51
+ buttonList: IPageBtn[]
21
52
  userRightsSubTitle: string
22
53
  userRightsTitle: string
23
54
  link: LcbActionViewProps
@@ -32,3 +63,4 @@ export interface UserLevelRightsList extends ActionView {
32
63
  export declare const currentRightsDetail: () => Promise<
33
64
  import('../../../action').IResData<CurrentRightsDetail>
34
65
  >
66
+ export {}
@@ -0,0 +1,60 @@
1
+ import type { PageBtnProps } from '../../api'
2
+ declare const _default: import('vue').DefineComponent<
3
+ __VLS_WithDefaults<
4
+ __VLS_TypePropsToOption<PageBtnProps>,
5
+ {
6
+ size: string
7
+ }
8
+ >,
9
+ {},
10
+ unknown,
11
+ {},
12
+ {},
13
+ import('vue').ComponentOptionsMixin,
14
+ import('vue').ComponentOptionsMixin,
15
+ {
16
+ refresh: (...args: any[]) => void
17
+ },
18
+ string,
19
+ import('vue').PublicProps,
20
+ Readonly<
21
+ import('vue').ExtractPropTypes<
22
+ __VLS_WithDefaults<
23
+ __VLS_TypePropsToOption<PageBtnProps>,
24
+ {
25
+ size: string
26
+ }
27
+ >
28
+ >
29
+ > & {
30
+ onRefresh?: ((...args: any[]) => any) | undefined
31
+ },
32
+ {
33
+ size: 'small' | 'medium' | 'large'
34
+ },
35
+ {}
36
+ >
37
+ export default _default
38
+ type __VLS_WithDefaults<P, D> = {
39
+ [K in keyof Pick<P, keyof P>]: K extends keyof D
40
+ ? __VLS_Prettify<
41
+ P[K] & {
42
+ default: D[K]
43
+ }
44
+ >
45
+ : P[K]
46
+ }
47
+ type __VLS_Prettify<T> = {
48
+ [K in keyof T]: T[K]
49
+ } & {}
50
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
51
+ type __VLS_TypePropsToOption<T> = {
52
+ [K in keyof T]-?: {} extends Pick<T, K>
53
+ ? {
54
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
55
+ }
56
+ : {
57
+ type: import('vue').PropType<T[K]>
58
+ required: true
59
+ }
60
+ }