@tplc/business 0.4.185 → 0.4.187

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,21 @@
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.187](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.186...v0.4.187) (2025-08-10)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 自动滚动顶部 ([25b60f4](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/25b60f43311ca51a2ed164bdb891f40e4c6471f1))
11
+
12
+ ### [0.4.186](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.185...v0.4.186) (2025-08-10)
13
+
14
+
15
+ ### ✨ Features | 新功能
16
+
17
+ * banner 支持 fullBannerFlow ([92d6f8f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/92d6f8fd61f50000e89dcd19e9ca17a1c7ce4ec4))
18
+ * mapuopdate ([ecbf37a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ecbf37ad1a8b02d5350a96611ebef1090f1d8de4))
19
+
5
20
  ### [0.4.185](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.184...v0.4.185) (2025-08-04)
6
21
 
7
22
 
@@ -3,9 +3,15 @@
3
3
  class="lcb-banner relative"
4
4
  :class="{
5
5
  'full-screen-background': fullScreenBackground,
6
- 'full-screen-swiper': fullScreenBackground && !height,
6
+ 'full-screen-flow': fullBannerFlow,
7
+ 'full-screen-swiper': (fullScreenBackground || fullBannerFlow) && !height,
7
8
  }"
8
- :style="{ filter: `blur(${Math.min(scrollTop / 100, 10)}px)` }"
9
+ :style="{
10
+ filter: fullScreenBackground ? `blur(${Math.min(scrollTop / 100, 10)}px)` : 'none',
11
+ }"
12
+ @touchstart="handleTouchStart"
13
+ @touchmove="handleTouchMove"
14
+ @touchend="handleTouchEnd"
9
15
  >
10
16
  <view
11
17
  class="absolute z-1 transition-all duration-300"
@@ -24,7 +30,7 @@
24
30
  v-bind="$props"
25
31
  custom-class="overflow-visible lcb-banner-block flex flex-col"
26
32
  :customStyle="
27
- fullScreenBackground
33
+ fullScreenBackground || fullBannerFlow
28
34
  ? { width: '100%', height: '100%', flex: 1, display: 'flex', flexDirection: 'column' }
29
35
  : {}
30
36
  "
@@ -37,7 +43,10 @@
37
43
  v-bind="{
38
44
  list: items,
39
45
  loop,
40
- height: fullScreenBackground && !height ? '100%' : transformValueUnit(height),
46
+ height:
47
+ (fullScreenBackground || fullBannerFlow) && !height
48
+ ? '100%'
49
+ : transformValueUnit(height),
41
50
  imgWidth: imgWidth && transformValueUnit(imgWidth),
42
51
  radius: transformValueUnit(radius),
43
52
  autoplay: Boolean(interval),
@@ -88,6 +97,14 @@ const props = withDefaults(defineProps<LcbBannerProps>(), {
88
97
  fontWeight: 500,
89
98
  })
90
99
  const scrollTop = ref(0)
100
+
101
+ const pageHeight = uni.getWindowInfo().screenHeight
102
+
103
+ // Touch gesture handling
104
+ const touchStartY = ref(0)
105
+ const touchStartX = ref(0)
106
+ const isTouching = ref(false)
107
+
91
108
  const supplementProps = computed(() => {
92
109
  if (props.styleGroup === 2) {
93
110
  return {
@@ -121,10 +138,44 @@ const customStyle = computed(() => {
121
138
  return props.paddingBottom ? `padding-bottom: ${transformValueUnit(props.paddingBottom)}` : ''
122
139
  })
123
140
  onPageScroll((e) => {
124
- if (props.fullScreenBackground) {
141
+ if (props.fullScreenBackground || props.fullBannerFlow) {
125
142
  scrollTop.value = e.scrollTop
126
143
  }
127
144
  })
145
+
146
+ // Touch event handlers
147
+ const handleTouchStart = (e: TouchEvent) => {
148
+ // 并且当前banner在顶部
149
+ if (!props.fullBannerFlow || scrollTop.value > 0) return
150
+ isTouching.value = true
151
+ touchStartY.value = e.touches[0].clientY
152
+ touchStartX.value = e.touches[0].clientX
153
+ }
154
+
155
+ const handleTouchMove = (e: TouchEvent) => {
156
+ if (!isTouching.value) return
157
+
158
+ const currentY = e.touches[0].clientY
159
+ const currentX = e.touches[0].clientX
160
+ const deltaY = Math.abs(currentY - touchStartY.value)
161
+ const deltaX = Math.abs(currentX - touchStartX.value)
162
+
163
+ // Calculate total distance
164
+ const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)
165
+
166
+ // If distance exceeds 50px, scroll to page height
167
+ if (distance > 50) {
168
+ uni.pageScrollTo({
169
+ scrollTop: pageHeight,
170
+ duration: 300,
171
+ })
172
+ isTouching.value = false
173
+ }
174
+ }
175
+
176
+ const handleTouchEnd = () => {
177
+ isTouching.value = false
178
+ }
128
179
  </script>
129
180
  <style lang="scss" scoped>
130
181
  .lcb-banner {
@@ -147,4 +198,12 @@ onPageScroll((e) => {
147
198
  height: 100% !important;
148
199
  }
149
200
  }
201
+ .full-screen-flow {
202
+ width: 100%;
203
+ height: 100vh;
204
+ :deep(.wd-swiper, uni-swiper, .uni-swiper-wrapper, .uni-swiper-wrapper, .lcb-banner-block) {
205
+ width: 100% !important;
206
+ height: 100vh !important;
207
+ }
208
+ }
150
209
  </style>
@@ -57,6 +57,8 @@ export interface LcbBannerProps extends LcbBlockProps {
57
57
  slidingStyle?: 1 | 2
58
58
  maskBgColor?: string
59
59
  fullScreenBackground?: boolean
60
+ /** 是否全屏流式banner */
61
+ fullBannerFlow?: boolean
60
62
  titleColor?: string
61
63
  titleFontSize?: number
62
64
  titleFontWeight?: number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.185",
3
+ "version": "0.4.187",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -54,6 +54,8 @@ export interface LcbBannerProps extends LcbBlockProps {
54
54
  slidingStyle?: 1 | 2
55
55
  maskBgColor?: string
56
56
  fullScreenBackground?: boolean
57
+ /** 是否全屏流式banner */
58
+ fullBannerFlow?: boolean
57
59
  titleColor?: string
58
60
  titleFontSize?: number
59
61
  titleFontWeight?: number