@tplc/business 0.7.71 → 0.7.72

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,28 @@
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.7.72](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.69...v0.7.72) (2026-01-17)
6
+
7
+
8
+ ### ♻️ Code Refactoring | 代码重构
9
+
10
+ * **lcb-order-payment:** simplify openInsteadPopup function and improve item handling ([5fdd2b6](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5fdd2b6d6339e9c5fa5cd4affa06eb9ed1908443))
11
+ * **types:** remove unused type definitions and clean up component type files for better maintainability ([923135e](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/923135ebed7bcbee56deb891cdbc42206cb40b2a))
12
+
13
+
14
+ ### 🚀 Chore | 构建/工程依赖/工具
15
+
16
+ * **release:** 0.7.70 ([993f445](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/993f4459a619742ee76b4774d7a565934fc2153f))
17
+ * **release:** 0.7.71 ([5b32edb](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5b32edbe244e09f8de16e6d8ea40d1b174e1f442))
18
+ * Remove numerous TypeScript declaration files and update the `lcb-order-payment` component. ([c4860c8](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c4860c866b272f26b5da30e0b5688bb7fae9dd57))
19
+
20
+
21
+ ### ✨ Features | 新功能
22
+
23
+ * Add multiple new LCB component demo pages, update routing and types, and enhance the LCB search demo with new attributes. ([dae3560](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/dae3560de985f84e888e5ac18ba0960941e1aa7c))
24
+ * **lcb-action-view:** add language selection feature to action view component ([42402c4](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/42402c41de1bba1b26e37155cf462f27bc4a0528))
25
+ * Update PayPopup z-index, enhance LcbListProps with tagPosition, and improve lcb-map layout and loading handling ([6b04414](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/6b044148a01f929804259298c3206849121dfa71))
26
+
5
27
  ### [0.7.71](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.70...v0.7.71) (2026-01-15)
6
28
 
7
29
 
@@ -0,0 +1,22 @@
1
+ /** 会员角色 */
2
+ export interface UserVipRole {
3
+ userLevelRoleId: string
4
+ levelRoleName: string
5
+ levelRoleNameEn: string
6
+ levelRoleImg: string
7
+ content: string
8
+ addition?: string
9
+ additionConfig?: string
10
+ subTitle?: string
11
+ title?: string
12
+ levelRoleType?: number
13
+ levelRoleTypeName?: string
14
+ }
15
+
16
+ /** 获取会员角色列表 */
17
+ export const getUserVipRole = () =>
18
+ uni.$lcb.http.post<UserVipRole[]>('/userLevelRole/list', {}, true)
19
+
20
+ /** 选择会员角色 */
21
+ export const userPointChooseRole = (params: { userLevelRoleId: string }) =>
22
+ uni.$lcb.http.post('/userLevelRole/chooseRole', params, true)
@@ -0,0 +1,174 @@
1
+ <template>
2
+ <wd-popup
3
+ v-model="show"
4
+ position="center"
5
+ :close-on-click-modal="false"
6
+ custom-style="background: transparent;"
7
+ >
8
+ <view class="member-role-box text-white text-center w-full relative">
9
+ <!-- 关闭按钮 -->
10
+ <view class="absolute top-20rpx right-20rpx z-10 w-60rpx h-60rpx" @click="close">
11
+ <wd-icon name="close" size="40rpx" color="#fff" />
12
+ </view>
13
+
14
+ <!-- 标题 -->
15
+ <view class="text-40rpx font-bold mb-12rpx">选择角色</view>
16
+ <view class="text-24rpx mb-50rpx">左右滑动选择角色</view>
17
+
18
+ <!-- 角色轮播 -->
19
+ <view class="swiper-box relative h-500rpx mb-80rpx">
20
+ <swiper
21
+ :current="currentIdx"
22
+ class="h-full"
23
+ @change="onChange"
24
+ :previous-margin="`200rpx`"
25
+ :next-margin="`200rpx`"
26
+ >
27
+ <swiper-item v-for="(item, idx) in roleList" :key="item.userLevelRoleId" class="w-300rpx">
28
+ <view class="relative h-full flex items-end justify-center w-full">
29
+ <wd-img
30
+ :src="item.levelRoleImg"
31
+ width="500rpx"
32
+ height="500rpx"
33
+ mode="aspectFit"
34
+ :customClass="`transition-all ${idx === currentIdx ? 'opacity-100 scale-100' : 'opacity-40 scale-70'}`"
35
+ />
36
+ </view>
37
+ </swiper-item>
38
+ </swiper>
39
+ </view>
40
+
41
+ <!-- 角色信息 -->
42
+ <view v-if="currentRole" class="px-40rpx">
43
+ <view class="text-40rpx font-bold mb-20rpx">{{ currentRole.levelRoleName }}</view>
44
+ <view
45
+ class="pager flex items-center justify-center rounded-full mx-auto mb-16rpx w-100rpx h-40rpx bg-white bg-opacity-20"
46
+ >
47
+ <text class="text-24rpx">{{ currentIdx + 1 }}/{{ roleList.length }}</text>
48
+ </view>
49
+ <view class="text-24rpx mb-20rpx">{{ currentRole.levelRoleNameEn }}</view>
50
+ <text class="text-24rpx text-center leading-24rpx whitespace-pre-line">
51
+ {{ currentRole.content }}
52
+ </text>
53
+
54
+ <!-- 确定按钮 -->
55
+ <wd-button
56
+ @click="showConfirm = true"
57
+ custom-class="!block !w-45 mt-4 !mx-auto"
58
+ type="info"
59
+ >
60
+ 确定选择该角色
61
+ </wd-button>
62
+ </view>
63
+ </view>
64
+
65
+ <!-- 确认弹窗 -->
66
+ <wd-popup
67
+ v-model="showConfirm"
68
+ position="center"
69
+ :close-on-click-modal="false"
70
+ custom-class="!bg-transparent"
71
+ >
72
+ <view class="confirm-popup bg-white rounded-24rpx pb-30rpx w-550rpx">
73
+ <view class="pt-4 text-center text-36rpx font-bold mb-4">会员确认</view>
74
+ <view class="text-3.5 text-#333 px-60rpx text-center mb-4">
75
+ 是否确认选择该会员角色?一旦确认,无法更改。
76
+ </view>
77
+ <view class="flex px-2 gap-3 box-border justify-center">
78
+ <wd-button @click="showConfirm = false" type="info">再看看</wd-button>
79
+ <wd-button @click="confirmRole" type="primary">确认</wd-button>
80
+ </view>
81
+ </view>
82
+ </wd-popup>
83
+ </wd-popup>
84
+ </template>
85
+
86
+ <script lang="ts" setup>
87
+ import { getUserVipRole, userPointChooseRole, type UserVipRole } from './api'
88
+ import { ref, computed, watch } from 'vue'
89
+
90
+ defineOptions({
91
+ name: 'MemberRolePopup',
92
+ })
93
+
94
+ const show = defineModel<boolean>('show', { required: true })
95
+
96
+ const currentIdx = ref(0)
97
+ const showConfirm = ref(false)
98
+ const roleList = ref<UserVipRole[]>([])
99
+ const loading = ref(false)
100
+
101
+ // 当前选中的角色
102
+ const currentRole = computed(() => roleList.value[currentIdx.value])
103
+
104
+ // 获取角色列表
105
+ const fetchRoleList = async () => {
106
+ try {
107
+ loading.value = true
108
+ const { data } = await getUserVipRole()
109
+ roleList.value = data || []
110
+ } catch (error) {
111
+ console.error('获取角色列表失败:', error)
112
+ uni.showToast({
113
+ title: '获取角色列表失败',
114
+ icon: 'none',
115
+ })
116
+ } finally {
117
+ loading.value = false
118
+ }
119
+ }
120
+
121
+ // Swiper 改变
122
+ const onChange = (e: any) => {
123
+ currentIdx.value = e.detail.current
124
+ }
125
+
126
+ // 确认选择角色
127
+ const confirmRole = async () => {
128
+ if (!currentRole.value) return
129
+
130
+ try {
131
+ loading.value = true
132
+ await userPointChooseRole({ userLevelRoleId: currentRole.value.userLevelRoleId })
133
+ uni.showToast({
134
+ title: '选择成功',
135
+ icon: 'success',
136
+ })
137
+ showConfirm.value = false
138
+ show.value = false
139
+ } catch (error) {
140
+ console.error('选择角色失败:', error)
141
+ uni.showToast({
142
+ title: '选择角色失败',
143
+ icon: 'none',
144
+ })
145
+ } finally {
146
+ loading.value = false
147
+ }
148
+ }
149
+
150
+ // 关闭弹窗
151
+ const close = () => {
152
+ show.value = false
153
+ }
154
+
155
+ // 监听弹窗打开,获取角色列表
156
+ watch(show, (newVal) => {
157
+ if (newVal && roleList.value.length === 0) {
158
+ fetchRoleList()
159
+ }
160
+ })
161
+ </script>
162
+
163
+ <style lang="scss" scoped>
164
+ .member-role-box {
165
+ width: 100vw;
166
+ min-height: 80vh;
167
+ }
168
+
169
+ .swiper-box {
170
+ :deep(.swiper) {
171
+ height: 100%;
172
+ }
173
+ }
174
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <wd-popup v-model="show" :z-index="1000" custom-class="!rounded-20rpx" closable root-portal>
2
+ <wd-popup v-model="show" :z-index="2" custom-class="!rounded-20rpx" closable root-portal>
3
3
  <view
4
4
  class="popup-view"
5
5
  :style="{
@@ -78,6 +78,7 @@
78
78
  v-if="['145'].includes(getJumpType(jumpType)) && showCustomPopup"
79
79
  :jumpUrl="jumpUrl"
80
80
  />
81
+ <MemberRolePopup v-model:show="showMemberRole" v-if="showMemberRole" />
81
82
  </view>
82
83
  </template>
83
84
 
@@ -88,10 +89,11 @@ import { uploadFile } from '../../hooks/useUpload'
88
89
  import { getFinalUrl, onPageScrollSelector, getExposed, getCurrentPage } from '../../utils/utils'
89
90
  import SharePopup from '../../components/lcb-nav/SharePopup/index.vue'
90
91
  import CustomPopup from './components/CustomPopup/index.vue'
91
- import { useTranslate } from '@tplc/wot'
92
+ import { Locale, useTranslate } from '@tplc/wot'
92
93
  import { PAGE_PROVIDE_KEY, USER_BASIC_INFO } from '../../constants'
93
94
  import { getTemplateMessageList, TemplateMessage } from '../../api/user'
94
95
  import PayPopup from './components/PayPopup/index.vue'
96
+ import MemberRolePopup from './components/MemberRolePopup/index.vue'
95
97
  const { translate } = useTranslate()
96
98
  defineOptions({
97
99
  name: 'LcbActionView',
@@ -107,6 +109,7 @@ const basicInfo = inject(USER_BASIC_INFO, {}) as unknown as Ref<Record<string, a
107
109
  const pageInfo = inject(PAGE_PROVIDE_KEY) as unknown as Ref<Record<string, any>>
108
110
  const showPoster = ref(false)
109
111
  const showPay = ref(false)
112
+ const showMemberRole = ref(false)
110
113
  const emits = defineEmits<{
111
114
  (e: 'phone', value: { detail: { errMsg: string; encryptedData: string; iv: string } }): void
112
115
  (e: 'avatar', value: string): void
@@ -356,6 +359,21 @@ const onActionClick = async () => {
356
359
  fail: () => uni.navigateBack({}),
357
360
  })
358
361
  break
362
+ case '147':
363
+ uni.showActionSheet({
364
+ itemList: ['中文', '英文'],
365
+ success: (res) => {
366
+ if (res.tapIndex === 0) {
367
+ Locale.use('zh-CN')
368
+ } else {
369
+ Locale.use('en-US')
370
+ }
371
+ },
372
+ })
373
+ break
374
+ case '148':
375
+ showMemberRole.value = true
376
+ break
359
377
  default:
360
378
  emits('click', props)
361
379
  break
@@ -61,7 +61,8 @@ export type LcbActionViewProps = {
61
61
  | 104
62
62
  | 241
63
63
  | 143
64
-
64
+ | 147
65
+ | 148
65
66
  /** 小程序appid */
66
67
  jumpAppid?: string
67
68
 
@@ -140,4 +141,6 @@ export const jumpTypeMap = {
140
141
  'mixture-pay': 144,
141
142
  customPopup: 145,
142
143
  arScan: 146,
144
+ translate: 147,
145
+ memberRole: 148,
143
146
  }
@@ -44,6 +44,7 @@ export interface LcbListProps extends LcbBlockProps {
44
44
  }[]
45
45
  mapTagMode?: 'single' | 'multiple'
46
46
  mapConfigParams?: string
47
+ tagPosition?: 'left' | 'right'
47
48
  }
48
49
  export interface Option {
49
50
  label: string
@@ -20,7 +20,10 @@
20
20
  class="w-36rpx h-66rpx absolute left-0 top-0 m-auto bottom-0 right-0"
21
21
  />
22
22
  <!-- 重新定位到当前位置 -->
23
- <view class="absolute top-3 right-2 flex flex-col gap-2">
23
+ <view
24
+ class="absolute top-3 flex flex-col gap-2"
25
+ :class="tagPosition === 'left' ? 'left-2 ' : 'right-2'"
26
+ >
24
27
  <view
25
28
  v-for="item in mapTags"
26
29
  :key="item.value"
@@ -122,6 +125,7 @@ const { userLatLon, getLocation } = useLocation()
122
125
  const isLoading = ref(false)
123
126
  const props = withDefaults(defineProps<LcbListProps & LcbListInfo>(), {
124
127
  mapTagMode: 'multiple',
128
+ tagPosition: 'right',
125
129
  })
126
130
  const themeColor = inject('theme-color', '#3875FF')
127
131
  const callout: MapMarker['callout'] = {
package/hooks/usePay.ts CHANGED
@@ -50,18 +50,21 @@ const usePay = (
50
50
  runAsync(orderNo)
51
51
  return
52
52
  }
53
+ uni.showLoading({
54
+ title: 'loading...',
55
+ mask: true,
56
+ })
53
57
  successFun.value = options?.onSuccess
54
58
  uni.requestPayment({
55
59
  provider: 'wxpay',
56
60
  ...paymentParams,
57
61
  success: () => {
58
- uni.showLoading({
59
- title: 'loading...',
60
- mask: true,
61
- })
62
62
  runAsync(orderNo)
63
63
  },
64
- fail: options?.onError,
64
+ fail: () => {
65
+ options?.onError?.()
66
+ uni.hideLoading()
67
+ },
65
68
  })
66
69
  }
67
70
  onPageHide(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.71",
3
+ "version": "0.7.72",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -0,0 +1,22 @@
1
+ /** 会员角色 */
2
+ export interface UserVipRole {
3
+ userLevelRoleId: string
4
+ levelRoleName: string
5
+ levelRoleNameEn: string
6
+ levelRoleImg: string
7
+ content: string
8
+ addition?: string
9
+ additionConfig?: string
10
+ subTitle?: string
11
+ title?: string
12
+ levelRoleType?: number
13
+ levelRoleTypeName?: string
14
+ }
15
+ /** 获取会员角色列表 */
16
+ export declare const getUserVipRole: () => Promise<
17
+ import('../../../../action').IResData<UserVipRole[]>
18
+ >
19
+ /** 选择会员角色 */
20
+ export declare const userPointChooseRole: (params: {
21
+ userLevelRoleId: string
22
+ }) => Promise<import('../../../../action').IResData<unknown>>
@@ -0,0 +1,34 @@
1
+ type __VLS_PublicProps = {
2
+ show: boolean
3
+ }
4
+ declare const _default: import('vue').DefineComponent<
5
+ __VLS_TypePropsToOption<__VLS_PublicProps>,
6
+ {},
7
+ unknown,
8
+ {},
9
+ {},
10
+ import('vue').ComponentOptionsMixin,
11
+ import('vue').ComponentOptionsMixin,
12
+ {
13
+ 'update:show': (show: boolean) => void
14
+ },
15
+ string,
16
+ import('vue').PublicProps,
17
+ Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
18
+ 'onUpdate:show'?: ((show: boolean) => any) | undefined
19
+ },
20
+ {},
21
+ {}
22
+ >
23
+ export default _default
24
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
25
+ type __VLS_TypePropsToOption<T> = {
26
+ [K in keyof T]-?: {} extends Pick<T, K>
27
+ ? {
28
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
29
+ }
30
+ : {
31
+ type: import('vue').PropType<T[K]>
32
+ required: true
33
+ }
34
+ }
@@ -59,6 +59,8 @@ export type LcbActionViewProps = {
59
59
  | 104
60
60
  | 241
61
61
  | 143
62
+ | 147
63
+ | 148
62
64
  /** 小程序appid */
63
65
  jumpAppid?: string
64
66
  }
@@ -133,4 +135,6 @@ export declare const jumpTypeMap: {
133
135
  'mixture-pay': number
134
136
  customPopup: number
135
137
  arScan: number
138
+ translate: number
139
+ memberRole: number
136
140
  }
@@ -101,6 +101,7 @@ declare const __VLS_component: import('vue').DefineComponent<
101
101
  }[]
102
102
  mapTagMode: 'single' | 'multiple'
103
103
  mapConfigParams: string
104
+ tagPosition: 'left' | 'right'
104
105
  },
105
106
  {}
106
107
  >
@@ -41,6 +41,7 @@ export interface LcbListProps extends LcbBlockProps {
41
41
  }[]
42
42
  mapTagMode?: 'single' | 'multiple'
43
43
  mapConfigParams?: string
44
+ tagPosition?: 'left' | 'right'
44
45
  }
45
46
  export interface Option {
46
47
  label: string
@@ -5,6 +5,7 @@ declare const _default: import('vue').DefineComponent<
5
5
  __VLS_TypePropsToOption<LcbListProps & LcbListInfo>,
6
6
  {
7
7
  mapTagMode: string
8
+ tagPosition: string
8
9
  }
9
10
  >,
10
11
  {},
@@ -22,12 +23,14 @@ declare const _default: import('vue').DefineComponent<
22
23
  __VLS_TypePropsToOption<LcbListProps & LcbListInfo>,
23
24
  {
24
25
  mapTagMode: string
26
+ tagPosition: string
25
27
  }
26
28
  >
27
29
  >
28
30
  >,
29
31
  {
30
32
  mapTagMode: 'single' | 'multiple'
33
+ tagPosition: 'left' | 'right'
31
34
  },
32
35
  {}
33
36
  >
@@ -113,6 +113,8 @@ declare const _default: import('vue').DefineComponent<
113
113
  | 104
114
114
  | 241
115
115
  | 143
116
+ | 147
117
+ | 148
116
118
  jumpAppid?: string
117
119
  } & import('../lcb-block/types').LcbBlockProps
118
120
  >,