@tplc/business 0.4.190 → 0.4.192

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,32 @@
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.192](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.190...v0.4.192) (2025-08-18)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.4.191 ([d030e41](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/d030e41babc0f69317a087c3d8eb9c3e021e901b))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * area auto ([7df0e63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7df0e6312d2ea031bc2474d8894fefc071edaaa4))
16
+ * 兼容跳转 ([13b1e44](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/13b1e4494dfdf2d13764fcc685b6f062353aa57a))
17
+
18
+ ### [0.4.191](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.189...v0.4.191) (2025-08-15)
19
+
20
+
21
+ ### 🚀 Chore | 构建/工程依赖/工具
22
+
23
+ * **release:** 0.4.190 ([c7aff92](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/c7aff92429d278770f1a3298e6c962d36dd10746))
24
+
25
+
26
+ ### ✨ Features | 新功能
27
+
28
+ * area auto ([7df0e63](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7df0e6312d2ea031bc2474d8894fefc071edaaa4))
29
+ * 城市不需要判断 openFlag ([5132529](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5132529d23f6607145c6df519df6500b1e024765))
30
+
5
31
  ### [0.4.190](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.187...v0.4.190) (2025-08-14)
6
32
 
7
33
 
@@ -27,7 +27,7 @@
27
27
  :safe-area-inset-bottom="position === 'bottom'"
28
28
  closable
29
29
  :position="position"
30
- v-if="[14, 141].includes(props.jumpType || 0) && show"
30
+ v-if="[14, 141].includes(getJumpType(jumpType)) && show"
31
31
  :custom-class="position === 'bottom' ? '!rounded-t-20rpx' : '!rounded-20rpx'"
32
32
  >
33
33
  <view
@@ -42,7 +42,7 @@
42
42
  <view class="p-3 max-h-50vh overflow-y-auto" v-if="content">
43
43
  <lcb-rich-text :content="content" />
44
44
  </view>
45
- <view v-if="jumpType === 141" class="pt-6 pb-5 box-border flex-col-center gap-3">
45
+ <view v-if="getJumpType(jumpType) === 141" class="pt-6 pb-5 box-border flex-col-center gap-3">
46
46
  <wd-qr-code :value="jumpUrl" :canvas-id="`id_${jumpUrl}`" :size="160" />
47
47
  <view class="flex items-center justify-center gap-2">
48
48
  <view class="text-3.5">{{ jumpUrl }}</view>
@@ -57,7 +57,7 @@
57
57
 
58
58
  <script setup lang="ts">
59
59
  import { computed, ref, inject, Ref, onMounted } from 'vue'
60
- import { LcbActionViewProps } from './types'
60
+ import { jumpTypeMap, LcbActionViewProps } from './types'
61
61
  import { uploadFile } from '../../hooks/useUpload'
62
62
  import { getFinalUrl, onPageScrollSelector, getExposed, getCurrentPage } from '../../utils/utils'
63
63
  import SharePopup from '../lcb-nav/SharePopup/index.vue'
@@ -89,7 +89,7 @@ const emits = defineEmits<{
89
89
  const templateMessageList = ref<TemplateMessage[]>([])
90
90
  const routeFullPath = ref('')
91
91
  onMounted(async () => {
92
- if (props.jumpType === 142 && props.events) {
92
+ if (getJumpType(props.jumpType) === 142 && 'events' in props && props.events) {
93
93
  const data = await getTemplateMessageList(props.events)
94
94
  templateMessageList.value = data
95
95
  }
@@ -110,10 +110,11 @@ const openType = computed(() => {
110
110
  102: 'share',
111
111
  103: 'feedback',
112
112
  104: 'openSetting',
113
- }[props.jumpType || '']
113
+ }[getJumpType(props.jumpType)]
114
114
  })
115
115
  const onActionClick = async () => {
116
- const { jumpUrl, jumpType } = props
116
+ const { jumpUrl, jumpType: type } = props
117
+ const jumpType = getJumpType(type)
117
118
  /**
118
119
  * 跳转类型 1: 网页 2: 小程序内页 10: 跳转小程序 11: 跳转半屏小程序 12: 小程序客服
119
120
  * 13: 退出登录 14: 小程序弹框 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
@@ -140,7 +141,7 @@ const onActionClick = async () => {
140
141
  break
141
142
  /** 跳转小程序 */
142
143
  case 10:
143
- if (url && props.jumpAppid) {
144
+ if (url && 'jumpAppid' in props && props.jumpAppid) {
144
145
  uni.navigateToMiniProgram({
145
146
  appId: props.jumpAppid,
146
147
  path: url,
@@ -150,7 +151,7 @@ const onActionClick = async () => {
150
151
  break
151
152
  /** 跳转半屏小程序 */
152
153
  case 11:
153
- if (url && props.jumpAppid) {
154
+ if (url && 'jumpAppid' in props && props.jumpAppid) {
154
155
  uni.openEmbeddedMiniProgram({
155
156
  appId: props.jumpAppid,
156
157
  path: url,
@@ -190,10 +191,10 @@ const onActionClick = async () => {
190
191
  }
191
192
  break
192
193
  case 17:
193
- if (props.requestInfo)
194
+ if ('requestInfo' in props && props.requestInfo)
194
195
  await uni.$lcb.http.post(props.requestInfo.requestUrl, props.requestInfo.requestParams)
195
196
  /** 请求之后刷新schemaPage */
196
- if (props.requestInfo?.refreshSchemaPage) {
197
+ if ('requestInfo' in props && props.requestInfo?.refreshSchemaPage) {
197
198
  uni.$emit('refreshSchemaPage')
198
199
  }
199
200
  emits('refresh')
@@ -246,13 +247,13 @@ const onActionClick = async () => {
246
247
  break
247
248
  /** 拨打电话 */
248
249
  case 30:
249
- if (props.phoneNumber)
250
+ if ('phoneNumber' in props && props.phoneNumber)
250
251
  uni.makePhoneCall({
251
252
  phoneNumber: props.phoneNumber,
252
253
  })
253
254
  break
254
255
  case 105:
255
- if (props.addressInfo) uni.openLocation(props.addressInfo)
256
+ if ('addressInfo' in props && props.addressInfo) uni.openLocation(props.addressInfo)
256
257
  emits('nav')
257
258
  break
258
259
  case 106:
@@ -266,10 +267,12 @@ const onActionClick = async () => {
266
267
  uni.navigateBack()
267
268
  break
268
269
  case 107:
269
- uni.setStorageSync('imagePreview', JSON.stringify(props.content))
270
- uni.navigateTo({
271
- url: `/pages/system/imagePreview`,
272
- })
270
+ if ('content' in props && props.content) {
271
+ uni.setStorageSync('imagePreview', JSON.stringify(props.content))
272
+ uni.navigateTo({
273
+ url: `/pages/system/imagePreview`,
274
+ })
275
+ }
273
276
  break
274
277
  case 142:
275
278
  onTemplateMessage()
@@ -297,6 +300,10 @@ const onActionClick = async () => {
297
300
  break
298
301
  }
299
302
  }
303
+ const getJumpType = (jumpType?: string | number) => {
304
+ if (!jumpType) return ''
305
+ return jumpTypeMap[jumpType] || jumpType
306
+ }
300
307
  const getPhoneNumber = (e) => {
301
308
  if (e.detail.errMsg === 'getPhoneNumber:ok') {
302
309
  emits('phone', e)
@@ -93,3 +93,33 @@ export type LcbActionViewProps = {
93
93
  events: string
94
94
  }
95
95
  )
96
+
97
+ // 根据LcbActionViewProps 的jumTyp帮我生成一份英文映射 key为英文 value 为number
98
+ export const jumpTypeMap = {
99
+ webview: 1,
100
+ miniProgram: 2,
101
+ jumpMiniProgram: 10,
102
+ halfScreenMiniProgram: 11,
103
+ miniProgramCustomerService: 12,
104
+ logout: 13,
105
+ miniProgramDialog: 14,
106
+ miniProgramAnchor: 16,
107
+ request: 17,
108
+ newWindow: 21,
109
+ switchTab: 22,
110
+ restartMiniProgram: 23,
111
+ back: 24,
112
+ closeCurrentPage: 25,
113
+ closeCurrentWindow: 26,
114
+ phoneCall: 30,
115
+ getPhoneNumber: 88,
116
+ chooseAvatar: 101,
117
+ share: 102,
118
+ feedback: 103,
119
+ openSetting: 104,
120
+ map: 105,
121
+ poster: 106,
122
+ imagePreview: 107,
123
+ qrCode: 141,
124
+ templateMessage: 142,
125
+ }
@@ -70,14 +70,25 @@
70
70
  }"
71
71
  />
72
72
  </lcb-block>
73
+ <wd-icon
74
+ name="chevron-down"
75
+ size="40px"
76
+ color="#fff"
77
+ custom-class="z-1 absolute bottom-20 left-0 right-0 m-auto w-fit"
78
+ v-if="fullScreenBackground && supportClickScroll"
79
+ @click="handleScrollToBottom"
80
+ />
73
81
  </view>
82
+
83
+ <view class="h-100vh w-full" v-if="fullScreenBackground && supportClickScroll" />
74
84
  </template>
75
85
 
76
86
  <script setup lang="ts">
77
- import { computed, ref } from 'vue'
87
+ import { computed, inject, Ref, ref } from 'vue'
78
88
  import { LcbBannerProps } from './types'
79
89
  import { transformValueUnit } from '../../utils/transform'
80
90
  import { onPageScroll } from '@dcloudio/uni-app'
91
+ import { SHOW_TABBAR } from '../../constants'
81
92
  defineOptions({
82
93
  name: 'LcbBanner',
83
94
  options: {
@@ -95,10 +106,12 @@ const props = withDefaults(defineProps<LcbBannerProps>(), {
95
106
  titleTop: 100,
96
107
  titleLeft: 100,
97
108
  fontWeight: 500,
109
+ supportClickScroll: false,
98
110
  })
99
111
  const scrollTop = ref(0)
100
112
 
101
113
  const pageHeight = uni.getWindowInfo().screenHeight
114
+ const showTabbar = inject(SHOW_TABBAR) as Ref<boolean>
102
115
 
103
116
  // Touch gesture handling
104
117
  const touchStartY = ref(0)
@@ -141,6 +154,13 @@ onPageScroll((e) => {
141
154
  if (props.fullScreenBackground || props.fullBannerFlow) {
142
155
  scrollTop.value = e.scrollTop
143
156
  }
157
+ if (props.supportClickScroll) {
158
+ if (e.scrollTop > 100) {
159
+ showTabbar.value = true
160
+ } else {
161
+ showTabbar.value = false
162
+ }
163
+ }
144
164
  })
145
165
 
146
166
  // Touch event handlers
@@ -176,6 +196,13 @@ const handleTouchMove = (e: TouchEvent) => {
176
196
  const handleTouchEnd = () => {
177
197
  isTouching.value = false
178
198
  }
199
+ const handleScrollToBottom = () => {
200
+ const statusBarHeight = uni.getWindowInfo().statusBarHeight
201
+ uni.pageScrollTo({
202
+ scrollTop: pageHeight - statusBarHeight - 44,
203
+ duration: 300,
204
+ })
205
+ }
179
206
  </script>
180
207
  <style lang="scss" scoped>
181
208
  .lcb-banner {
@@ -195,7 +222,7 @@ const handleTouchEnd = () => {
195
222
  .full-screen-swiper {
196
223
  :deep(.wd-swiper, uni-swiper, .uni-swiper-wrapper, .uni-swiper-wrapper, .lcb-banner-block) {
197
224
  width: 100% !important;
198
- height: 100% !important;
225
+ height: 100vh !important;
199
226
  }
200
227
  }
201
228
  .full-screen-flow {
@@ -57,6 +57,8 @@ export interface LcbBannerProps extends LcbBlockProps {
57
57
  slidingStyle?: 1 | 2
58
58
  maskBgColor?: string
59
59
  fullScreenBackground?: boolean
60
+ // 支持点击滚动页面
61
+ supportClickScroll?: boolean
60
62
  /** 是否全屏流式banner */
61
63
  fullBannerFlow?: boolean
62
64
  titleColor?: string
package/constants.ts CHANGED
@@ -13,3 +13,5 @@ export const LIST_FORM_CHOOSER_VALUES = 'list_form_chooser_values'
13
13
  export const PAGE_DYNAMIC_DATA = 'page_dynamic_data'
14
14
  /** 列表页表单选择项 */
15
15
  export const WRAPPER_ITEM_KEY = 'wrapper_item_key'
16
+ /** 是否显示tabbar */
17
+ export const SHOW_TABBAR = 'show_tabbar'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.190",
3
+ "version": "0.4.192",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -90,3 +90,31 @@ export type LcbActionViewProps = {
90
90
  events: string
91
91
  }
92
92
  )
93
+ export declare const jumpTypeMap: {
94
+ webview: number
95
+ miniProgram: number
96
+ jumpMiniProgram: number
97
+ halfScreenMiniProgram: number
98
+ miniProgramCustomerService: number
99
+ logout: number
100
+ miniProgramDialog: number
101
+ miniProgramAnchor: number
102
+ request: number
103
+ newWindow: number
104
+ switchTab: number
105
+ restartMiniProgram: number
106
+ back: number
107
+ closeCurrentPage: number
108
+ closeCurrentWindow: number
109
+ phoneCall: number
110
+ getPhoneNumber: number
111
+ chooseAvatar: number
112
+ share: number
113
+ feedback: number
114
+ openSetting: number
115
+ map: number
116
+ poster: number
117
+ imagePreview: number
118
+ qrCode: number
119
+ templateMessage: number
120
+ }
@@ -11,6 +11,7 @@ declare const _default: import('vue').DefineComponent<
11
11
  titleTop: number
12
12
  titleLeft: number
13
13
  fontWeight: number
14
+ supportClickScroll: boolean
14
15
  }
15
16
  >,
16
17
  {},
@@ -35,6 +36,7 @@ declare const _default: import('vue').DefineComponent<
35
36
  titleTop: number
36
37
  titleLeft: number
37
38
  fontWeight: number
39
+ supportClickScroll: boolean
38
40
  }
39
41
  >
40
42
  >
@@ -44,6 +46,7 @@ declare const _default: import('vue').DefineComponent<
44
46
  fontWeight: number
45
47
  styleGroup: 1 | 2
46
48
  slidingStyle: 1 | 2
49
+ supportClickScroll: boolean
47
50
  titleColor: string
48
51
  titleFontSize: number
49
52
  titleTop: number
@@ -54,6 +54,7 @@ export interface LcbBannerProps extends LcbBlockProps {
54
54
  slidingStyle?: 1 | 2
55
55
  maskBgColor?: string
56
56
  fullScreenBackground?: boolean
57
+ supportClickScroll?: boolean
57
58
  /** 是否全屏流式banner */
58
59
  fullBannerFlow?: boolean
59
60
  titleColor?: string
@@ -13,3 +13,5 @@ export declare const LIST_FORM_CHOOSER_VALUES = 'list_form_chooser_values'
13
13
  export declare const PAGE_DYNAMIC_DATA = 'page_dynamic_data'
14
14
  /** 列表页表单选择项 */
15
15
  export declare const WRAPPER_ITEM_KEY = 'wrapper_item_key'
16
+ /** 是否显示tabbar */
17
+ export declare const SHOW_TABBAR = 'show_tabbar'