@tplc/business 0.4.184 → 0.4.186
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 +16 -0
- package/components/lcb-banner/lcb-banner.vue +60 -5
- package/components/lcb-banner/types.ts +2 -0
- package/components/lcb-map/images/earth.gif +0 -0
- package/components/lcb-map/lcb-map.vue +29 -24
- package/package.json +1 -1
- package/types/components/lcb-banner/types.d.ts +2 -0
- package/components/lcb-map/images/transparent.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
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.186](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.185...v0.4.186) (2025-08-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* banner 支持 fullBannerFlow ([92d6f8f](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/92d6f8fd61f50000e89dcd19e9ca17a1c7ce4ec4))
|
|
11
|
+
* mapuopdate ([ecbf37a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/ecbf37ad1a8b02d5350a96611ebef1090f1d8de4))
|
|
12
|
+
|
|
13
|
+
### [0.4.185](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.184...v0.4.185) (2025-08-04)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
* map scale ([6dc2249](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/6dc22499f4f7c2d0a6ed0d04f925fd1025248399))
|
|
19
|
+
* map修改样式 ([8ffc1aa](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/8ffc1aa582e93ae622084fb6cbdc8ad5f5618cf0))
|
|
20
|
+
|
|
5
21
|
### [0.4.184](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.183...v0.4.184) (2025-08-02)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
class="lcb-banner relative"
|
|
4
4
|
:class="{
|
|
5
5
|
'full-screen-background': fullScreenBackground,
|
|
6
|
-
'full-screen-
|
|
6
|
+
'full-screen-flow': fullBannerFlow,
|
|
7
|
+
'full-screen-swiper': (fullScreenBackground || fullBannerFlow) && !height,
|
|
7
8
|
}"
|
|
8
|
-
:style="{
|
|
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:
|
|
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 {
|
|
@@ -140,6 +191,10 @@ onPageScroll((e) => {
|
|
|
140
191
|
top: 0;
|
|
141
192
|
left: 0;
|
|
142
193
|
}
|
|
194
|
+
.full-screen-flow {
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 100vh;
|
|
197
|
+
}
|
|
143
198
|
|
|
144
199
|
.full-screen-swiper {
|
|
145
200
|
:deep(.wd-swiper, uni-swiper, .uni-swiper-wrapper, .uni-swiper-wrapper, .lcb-banner-block) {
|
|
@@ -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
|
|
Binary file
|
|
@@ -75,22 +75,17 @@
|
|
|
75
75
|
/>
|
|
76
76
|
</view>
|
|
77
77
|
</view>
|
|
78
|
+
<!-- loading 加载地球gif -->
|
|
79
|
+
<view class="absolute top-0 left-0 w-full h-full flex-center z-2" v-if="isLoading">
|
|
80
|
+
<image src="./images/earth.gif" class="w-137rpx h-120rpx mt--180rpx" />
|
|
81
|
+
</view>
|
|
78
82
|
</view>
|
|
79
83
|
</view>
|
|
80
84
|
</template>
|
|
81
85
|
|
|
82
86
|
<script lang="ts" setup>
|
|
83
87
|
import { FORM_KEY } from '@tplc/business/constants'
|
|
84
|
-
import {
|
|
85
|
-
reactive,
|
|
86
|
-
inject,
|
|
87
|
-
ref,
|
|
88
|
-
useAttrs,
|
|
89
|
-
watch,
|
|
90
|
-
onMounted,
|
|
91
|
-
getCurrentInstance,
|
|
92
|
-
onUnmounted,
|
|
93
|
-
} from 'vue'
|
|
88
|
+
import { reactive, inject, ref, useAttrs, watch, getCurrentInstance, onUnmounted } from 'vue'
|
|
94
89
|
import { getJsonFromStr, transformValueUnit } from '../../utils/transform'
|
|
95
90
|
import { MapItem, MapMarker } from './types'
|
|
96
91
|
import useAutoHeight from '../../hooks/useAutoHeight'
|
|
@@ -111,6 +106,7 @@ const attrs = useAttrs()
|
|
|
111
106
|
const { proxy } = getCurrentInstance()!
|
|
112
107
|
const mapContext = ref<UniApp.MapContext>()
|
|
113
108
|
const { userLatLon, getLocation } = useLocation()
|
|
109
|
+
const isLoading = ref(false)
|
|
114
110
|
const props = withDefaults(defineProps<LcbListProps & LcbListInfo>(), {
|
|
115
111
|
mapTagMode: 'multiple',
|
|
116
112
|
})
|
|
@@ -126,6 +122,7 @@ const callout: MapMarker['callout'] = {
|
|
|
126
122
|
borderColor: themeColor,
|
|
127
123
|
bgColor: '#ffffff',
|
|
128
124
|
color: themeColor,
|
|
125
|
+
// anchorY: 10,
|
|
129
126
|
}
|
|
130
127
|
const selectedTag = ref<string[]>([])
|
|
131
128
|
const info = reactive({
|
|
@@ -160,20 +157,26 @@ const getData = debounce(() => {
|
|
|
160
157
|
if (!southwest) return
|
|
161
158
|
mapContext.value?.getCenterLocation({
|
|
162
159
|
async success({ latitude, longitude }) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
isLoading.value = true
|
|
161
|
+
const { data = [] } = (await uni.$lcb.http.post(
|
|
162
|
+
'/productInfoMap/list',
|
|
163
|
+
{
|
|
164
|
+
...props.baseParam,
|
|
165
|
+
...form?.value,
|
|
166
|
+
mapLatitude: latitude,
|
|
167
|
+
mapLongitude: longitude,
|
|
168
|
+
mapScale: currentScale.value,
|
|
169
|
+
mapCornerLongitude: southwest.longitude,
|
|
170
|
+
mapCornerLatitude: southwest.latitude,
|
|
171
|
+
productTypeList: selectedTag.value.length ? selectedTag.value : undefined,
|
|
172
|
+
},
|
|
173
|
+
true,
|
|
174
|
+
)) as {
|
|
173
175
|
data: MapItem[]
|
|
174
176
|
}
|
|
175
177
|
list.value = data as any
|
|
176
178
|
getCurrentData(data)
|
|
179
|
+
isLoading.value = false
|
|
177
180
|
},
|
|
178
181
|
})
|
|
179
182
|
},
|
|
@@ -202,6 +205,7 @@ const getConfig = async () => {
|
|
|
202
205
|
...form?.value,
|
|
203
206
|
...getJsonFromStr(props.mapConfigParams),
|
|
204
207
|
})
|
|
208
|
+
mapContext.value = uni.createMapContext('map', proxy)
|
|
205
209
|
mapContext.value?.moveToLocation({
|
|
206
210
|
latitude: mapLatitude,
|
|
207
211
|
longitude: mapLongitude,
|
|
@@ -280,13 +284,14 @@ const getCurrentData = (markers: MapItem[]) => {
|
|
|
280
284
|
const isCurrent = index === 0
|
|
281
285
|
return {
|
|
282
286
|
id: index,
|
|
283
|
-
iconPath: '
|
|
287
|
+
iconPath: '/static/images/transparent.png',
|
|
284
288
|
width: 1,
|
|
285
289
|
height: 1,
|
|
286
290
|
poiId: current.productId,
|
|
287
291
|
latitude: current.latitude,
|
|
288
292
|
longitude: current.longitude,
|
|
289
293
|
// alpha: 0.5,
|
|
294
|
+
// label: current.mapPriceTips,
|
|
290
295
|
callout: {
|
|
291
296
|
...callout,
|
|
292
297
|
content: current.mapPriceTips,
|
|
@@ -309,9 +314,9 @@ watch(
|
|
|
309
314
|
deep: true,
|
|
310
315
|
},
|
|
311
316
|
)
|
|
312
|
-
onMounted(() => {
|
|
313
|
-
|
|
314
|
-
})
|
|
317
|
+
// onMounted(() => {
|
|
318
|
+
// mapContext.value = uni.createMapContext('map', proxy)
|
|
319
|
+
// })
|
|
315
320
|
|
|
316
321
|
onUnmounted(() => {
|
|
317
322
|
mapContext.value = undefined
|
package/package.json
CHANGED
|
@@ -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
|
|
Binary file
|