@tplc/business 0.3.50 → 0.3.51

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,13 @@
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.3.51](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.50...v0.3.51) (2025-02-14)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 新增mapcatch ([cfa54e0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/cfa54e0fc77933171a5dd2ae49a083f6cb990516))
11
+
5
12
  ### [0.3.50](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.60...v0.3.50) (2025-02-14)
6
13
 
7
14
 
@@ -58,7 +58,7 @@
58
58
  </template>
59
59
 
60
60
  <script setup lang="ts">
61
- import { computed, getCurrentInstance, nextTick, watch, ref } from 'vue'
61
+ import { computed, getCurrentInstance, nextTick, watch, ref, watchEffect } from 'vue'
62
62
  import { TreeSelectProps } from './type'
63
63
  import useSelect from '../../hooks/useSelect'
64
64
  import SelectTagView from '../SelectTagView/index.vue'
@@ -92,14 +92,16 @@ const treeObj = computed(() => {
92
92
  )
93
93
  })
94
94
  const onSubmit = () => {
95
- if (props.mode !== 'multiple') {
96
- modelTitle.value = treeObj.value[innerValue.value as string]
97
- }
98
95
  model.value = innerValue.value
99
96
  nextTick(() => {
100
97
  emits('submit')
101
98
  })
102
99
  }
100
+ watchEffect(() => {
101
+ if (props.mode !== 'multiple') {
102
+ modelTitle.value = treeObj.value[innerValue.value as string]
103
+ }
104
+ })
103
105
  const onCategoryClick = (index: number) => {
104
106
  currentCategory.value = index
105
107
  toView.value = `grid_${index}`
@@ -9,7 +9,9 @@
9
9
  show-location
10
10
  show-compass
11
11
  show-scale
12
+ :scale="14"
12
13
  class="w-full h-full"
14
+ id="map"
13
15
  @regionchange="onRegionChange"
14
16
  @callouttap="onCalloutTap"
15
17
  />
@@ -59,7 +61,7 @@
59
61
 
60
62
  <script lang="ts" setup>
61
63
  import { FORM_KEY } from '@tplc/business/constants'
62
- import { reactive, inject, ref, useAttrs, watch, onMounted } from 'vue'
64
+ import { reactive, inject, ref, useAttrs, watch, onMounted, getCurrentInstance } from 'vue'
63
65
  import { transformValueUnit } from '../../utils/transform'
64
66
  import { MapItem, MapMarker } from './types'
65
67
  import useAutoHeight from '../../hooks/useAutoHeight'
@@ -67,7 +69,6 @@ import { LcbListProps } from '@tplc/business/components/lcb-list/types'
67
69
  import { LcbListInfo } from '@tplc/business/components/lcb-list/api'
68
70
  import { debounce } from '@tplc/wot/components/common/util'
69
71
  import useLocation from '../../hooks/useLocation'
70
- import { getCurrentPage } from '../../utils/utils'
71
72
  const height = useAutoHeight()
72
73
  defineOptions({
73
74
  name: 'LcbMap',
@@ -78,6 +79,8 @@ defineOptions({
78
79
  },
79
80
  })
80
81
  const attrs = useAttrs()
82
+ const { proxy } = getCurrentInstance()!
83
+ const mapContext = ref<UniApp.MapContext>()
81
84
  const { userLatLon, getLocation } = useLocation()
82
85
  const props = defineProps<LcbListProps & LcbListInfo>()
83
86
  const scaleRadius: Record<string, number> = {
@@ -121,16 +124,21 @@ const form = inject<Record<string, any>>(FORM_KEY, {})
121
124
  const current = ref(0)
122
125
  const list = ref<MapItem[]>([])
123
126
 
124
- const getData = debounce(async () => {
125
- // || props.url
126
- const { data } = (await uni.$lcb.http.post('/productInfo/map', {
127
- ...props.baseParam,
128
- ...form?.value,
129
- })) as {
130
- data: MapItem[]
131
- }
132
- list.value = data
133
- getCurrentData(data)
127
+ const getData = debounce(() => {
128
+ mapContext.value?.getRegion({
129
+ async success(res) {
130
+ const { data = [] } = (await uni.$lcb.http.post('/productInfo/map', {
131
+ ...props.baseParam,
132
+ ...form?.value,
133
+ mapCornerLongitude: res.southwest.longitude,
134
+ mapCornerLatitude: res.southwest.latitude,
135
+ })) as {
136
+ data: MapItem[]
137
+ }
138
+ list.value = data
139
+ getCurrentData(data)
140
+ },
141
+ })
134
142
  }, 50)
135
143
 
136
144
  watch(
@@ -141,6 +149,7 @@ watch(
141
149
  form.value.mapLongitude = val.longitude
142
150
  form.value.userLongitude = val.longitude
143
151
  form.value.userLatitude = val.latitude
152
+ form.value.scale = 14
144
153
  form.value.mapViewRadius = scaleRadius[14]
145
154
  },
146
155
  {
@@ -163,7 +172,7 @@ const onRegionChange = (e: {
163
172
  form.value.scale = e.detail.scale
164
173
  form.value.mapLatitude = e.detail.centerLocation.latitude
165
174
  form.value.mapLongitude = e.detail.centerLocation.longitude
166
- form.value.mapViewRadius = scaleRadius[e.detail.scale]
175
+ form.value.mapViewRadius = scaleRadius[parseInt(String(e.detail.scale))]
167
176
  }
168
177
  }
169
178
  const onCurrentChange = (p: number) => {
@@ -220,9 +229,12 @@ watch(
220
229
  },
221
230
  {
222
231
  deep: true,
223
- immediate: true,
224
232
  },
225
233
  )
234
+ onMounted(() => {
235
+ mapContext.value = uni.createMapContext('map', proxy)
236
+ getData()
237
+ })
226
238
  </script>
227
239
  <style lang="scss">
228
240
  .icon {
@@ -32,6 +32,7 @@ export interface MapMarker {
32
32
  export interface MapItem {
33
33
  mapPriceTips: string
34
34
  latitude: number
35
+ productName: string
35
36
  longitude: number
36
37
  productId: string
37
38
  link: LcbActionViewProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.50",
3
+ "version": "0.3.51",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -30,6 +30,7 @@ export interface MapMarker {
30
30
  export interface MapItem {
31
31
  mapPriceTips: string
32
32
  latitude: number
33
+ productName: string
33
34
  longitude: number
34
35
  productId: string
35
36
  link: LcbActionViewProps