@tplc/business 0.7.86 → 0.7.87

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,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.7.87](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.33...v0.7.87) (2026-01-21)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.7.84 ([cb04a38](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/cb04a38f7c3a08344a99b134480d89b4114aa29c))
11
+ * **release:** 0.7.85 ([990307d](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/990307d9bd2013ff50504bfaaa7044e621cd8d39))
12
+ * **release:** 0.7.86 ([865ba3e](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/865ba3eac1842866e6d6e3069ca39b4a5b9be34e))
13
+
14
+
15
+ ### ✨ Features | 新功能
16
+
17
+ * **pages:** add new empty state components and update navigation titles ([679a13f](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/679a13f09ca9952e792212ca5e8d122a43fb0b9a))
18
+ * **wd-calendar-view:** implement dynamic end date calculation based on defaultDays prop ([0b48f3e](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/0b48f3ee9df12b55069c24b82ab758d31260d595))
19
+ * 边框显隐 ([14c4a65](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/14c4a65e628c877a23a038603cf59cc7fab13b8c))
20
+
5
21
  ### [0.7.86](http://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.85...v0.7.86) (2026-01-21)
6
22
 
7
23
  ### [0.7.85](http://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.84...v0.7.85) (2026-01-21)
@@ -138,7 +138,7 @@ const { getLocation, userLocation, locationIng } = useLocation((location) => {
138
138
  }
139
139
  setHistoryCity(addressCity.value)
140
140
  })
141
- getLocation()
141
+ getLocation(true)
142
142
  const nightCount = computed(() => {
143
143
  return dayjs(dayRange.value[1]).diff(dayRange.value[0], 'day')
144
144
  })
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view id="pagingTop"></view>
3
- <view class="flex-col flex w-full" :style="{ height }" v-if="height">
3
+ <view class="flex-col flex w-full" :style="{ height: mapHeight }" v-if="mapHeight">
4
4
  <view class="flex-1 h-0 relative">
5
5
  <map
6
6
  id="map"
@@ -103,15 +103,16 @@ import {
103
103
  onUnmounted,
104
104
  onMounted,
105
105
  nextTick,
106
+ computed,
106
107
  } from 'vue'
107
108
  import { getJsonFromStr, transformValueUnit } from '../../utils/transform'
108
- import { MapItem, MapMarker } from './types'
109
+ import { MapItem, MapMarker, MapProps } from './types'
109
110
  import useAutoHeight from '../../hooks/useAutoHeight'
110
111
  import { LcbListProps } from '@tplc/business/components/lcb-list/types'
111
112
  import { LcbListInfo } from '@tplc/business/components/lcb-list/api'
112
113
  import { debounce } from '@tplc/wot/components/common/util'
113
114
  import useLocation from '../../hooks/useLocation'
114
- const { height } = useAutoHeight('pagingTop', 500)
115
+ const { height } = useAutoHeight('pagingTop', 500, true)
115
116
  const mapReady = ref(false)
116
117
  defineOptions({
117
118
  name: 'LcbMap',
@@ -121,12 +122,15 @@ defineOptions({
121
122
  styleIsolation: 'shared',
122
123
  },
123
124
  })
125
+ const mapHeight = computed(() => {
126
+ return props.mapHeight ? `${props.mapHeight}px` : height.value
127
+ })
124
128
  const attrs = useAttrs()
125
129
  const { proxy } = getCurrentInstance()!
126
130
  const mapContext = ref<UniApp.MapContext>()
127
131
  const { userLatLon, getLocation } = useLocation()
128
132
  const isLoading = ref(false)
129
- const props = withDefaults(defineProps<LcbListProps & LcbListInfo>(), {
133
+ const props = withDefaults(defineProps<LcbListProps & LcbListInfo & MapProps>(), {
130
134
  mapTagMode: 'multiple',
131
135
  tagPosition: 'right',
132
136
  })
@@ -151,12 +155,12 @@ const info = reactive({
151
155
  const form = inject<Record<string, any>>(FORM_KEY, {})
152
156
  const current = ref(0)
153
157
  const list = ref<MapItem[]>([])
154
- const mapScale = ref(14)
158
+ const mapScale = ref(props.mapScale || 14)
155
159
  const isConfig = ref(false)
156
160
  const currentScale = ref(14)
157
161
  const mapLatLon = ref({
158
- latitude: 0,
159
- longitude: 0,
162
+ latitude: 39.9042,
163
+ longitude: 116.4074,
160
164
  })
161
165
 
162
166
  const onTagClick = (value: string) => {
@@ -280,6 +284,8 @@ const getConfig = async () => {
280
284
  watch(
281
285
  () => userLatLon.value,
282
286
  async (val, old) => {
287
+ /* 如果设置了经纬度,则不获取位置 */
288
+ if (props.latitude && props.longitude) return
283
289
  if (!val || JSON.stringify(val) === JSON.stringify(old)) return
284
290
  form.value.userLongitude = val.longitude
285
291
  form.value.userLatitude = val.latitude
@@ -394,6 +400,13 @@ onMounted(() => {
394
400
  mapContext.value = uni.createMapContext('map', proxy)
395
401
  if (mapContext.value) {
396
402
  mapReady.value = true
403
+ /* 如果设置了经纬度,则设置地图中心点 */
404
+ if (props.latitude && props.longitude) {
405
+ mapLatLon.value = {
406
+ latitude: props.latitude,
407
+ longitude: props.longitude,
408
+ }
409
+ }
397
410
  }
398
411
  } catch (error) {
399
412
  console.error('地图初始化异常:', error)
@@ -35,3 +35,9 @@ export interface MapItem {
35
35
  productId: string
36
36
  link: any
37
37
  }
38
+ export interface MapProps {
39
+ latitude?: number
40
+ longitude?: number
41
+ mapScale?: number
42
+ mapHeight?: number
43
+ }
@@ -2,7 +2,7 @@ import { getRect, isH5 } from '@tplc/wot/components/common/util'
2
2
  import { getCurrentInstance, onMounted, ref } from 'vue'
3
3
  import { getCurrentPage } from '../utils/utils'
4
4
 
5
- const useAutoHeight = (id = 'pagingTop', timeOut = 200) => {
5
+ const useAutoHeight = (id = 'pagingTop', timeOut = 200, fullScreen = false) => {
6
6
  const { proxy } = getCurrentInstance() as any
7
7
  const route = getCurrentPage().route
8
8
  const isTabBar = uni.$lcb.getIsTabbar(route)
@@ -15,7 +15,7 @@ const useAutoHeight = (id = 'pagingTop', timeOut = 200) => {
15
15
  setTimeout(() => {
16
16
  getRect(`#${id}`, false, proxy).then((res) => {
17
17
  top.value = res.top || 0
18
- if (!isTabBar) {
18
+ if (!isTabBar || fullScreen) {
19
19
  height.value = `${viewPageHeight - (res.top || 0)}px`
20
20
  } else {
21
21
  height.value = `calc(${viewPageHeight - (res.top || 0)}px - var(--window-bottom) - env(safe-area-inset-bottom))`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.86",
3
+ "version": "0.7.87",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -1,8 +1,9 @@
1
+ import { MapProps } from './types'
1
2
  import { LcbListProps } from '@tplc/business/components/lcb-list/types'
2
3
  import { LcbListInfo } from '@tplc/business/components/lcb-list/api'
3
4
  declare const _default: import('vue').DefineComponent<
4
5
  __VLS_WithDefaults<
5
- __VLS_TypePropsToOption<LcbListProps & LcbListInfo>,
6
+ __VLS_TypePropsToOption<LcbListProps & LcbListInfo & MapProps>,
6
7
  {
7
8
  mapTagMode: string
8
9
  tagPosition: string
@@ -20,7 +21,7 @@ declare const _default: import('vue').DefineComponent<
20
21
  Readonly<
21
22
  import('vue').ExtractPropTypes<
22
23
  __VLS_WithDefaults<
23
- __VLS_TypePropsToOption<LcbListProps & LcbListInfo>,
24
+ __VLS_TypePropsToOption<LcbListProps & LcbListInfo & MapProps>,
24
25
  {
25
26
  mapTagMode: string
26
27
  tagPosition: string
@@ -34,3 +34,9 @@ export interface MapItem {
34
34
  productId: string
35
35
  link: any
36
36
  }
37
+ export interface MapProps {
38
+ latitude?: number
39
+ longitude?: number
40
+ mapScale?: number
41
+ mapHeight?: number
42
+ }
@@ -1,6 +1,7 @@
1
1
  declare const useAutoHeight: (
2
2
  id?: string,
3
3
  timeOut?: number,
4
+ fullScreen?: boolean,
4
5
  ) => {
5
6
  height: import('vue').Ref<string>
6
7
  top: import('vue').Ref<number>