@tplc/business 0.3.50 → 0.3.52

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.3.52](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.51...v0.3.52) (2025-02-17)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 同步字段 ([b34ceb2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b34ceb2c7d7bea820c31ebdfd0a98d8971647e09))
11
+ * 比例尺调整 ([835e7c2](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/835e7c23faa7dea09697d9446c8a2ea1afa8bd42))
12
+
13
+ ### [0.3.51](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.50...v0.3.51) (2025-02-14)
14
+
15
+
16
+ ### ✨ Features | 新功能
17
+
18
+ * 新增mapcatch ([cfa54e0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/cfa54e0fc77933171a5dd2ae49a083f6cb990516))
19
+
5
20
  ### [0.3.50](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.60...v0.3.50) (2025-02-14)
6
21
 
7
22
 
@@ -15,7 +15,7 @@
15
15
  :safe-area-inset-bottom="true"
16
16
  closable
17
17
  :position="position"
18
- v-if="props.jumpType === 14"
18
+ v-if="[14, 141].includes(props.jumpType || 0)"
19
19
  :custom-class="position === 'bottom' ? '!rounded-t-20rpx' : '!rounded-20rpx'"
20
20
  >
21
21
  <view
@@ -24,12 +24,20 @@
24
24
  width: position === 'bottom' ? '100vw' : '90vw',
25
25
  }"
26
26
  >
27
- <view class="title">
27
+ <view class="title" v-if="title">
28
28
  {{ title }}
29
29
  </view>
30
- <view class="p-3 max-h-50vh overflow-y-auto">
30
+ <view class="p-3 max-h-50vh overflow-y-auto" v-if="content">
31
31
  <mp-html :content="content" />
32
32
  </view>
33
+ <view v-if="jumpType === 141" class="pt-6 pb-5 box-border flex-col-center gap-3">
34
+ <wd-qr-code :value="jumpUrl" :canvas-id="`id_${jumpUrl}`" :size="160" />
35
+ <view class="flex items-center justify-center gap-2">
36
+ <view class="text-3.5">{{ jumpUrl }}</view>
37
+ <!-- 复制 -->
38
+ <wd-button type="text" @click="onCopy(jumpUrl)">{{ translate('复制') }}</wd-button>
39
+ </view>
40
+ </view>
33
41
  </view>
34
42
  </wd-popup>
35
43
  <SharePopup v-model="showPoster" :params="requestParam" />
@@ -42,6 +50,8 @@ import { uploadFile } from '../../hooks/useUpload'
42
50
  import mpHtml from 'mp-html/src/uni-app/components/mp-html/mp-html.vue'
43
51
  import { getFinalUrl, onPageScrollSelector } from '../../utils/utils'
44
52
  import SharePopup from '../lcb-nav/SharePopup/index.vue'
53
+ import { useTranslate } from '@tplc/wot'
54
+ const { translate } = useTranslate()
45
55
  defineOptions({
46
56
  name: 'LcbActionView',
47
57
  options: {
@@ -183,6 +193,9 @@ const onActionClick = async () => {
183
193
  case 106:
184
194
  showPoster.value = true
185
195
  break
196
+ case 141:
197
+ show.value = true
198
+ break
186
199
  default:
187
200
  emits('click')
188
201
  break
@@ -203,6 +216,12 @@ const onChooseAvatar = async (e) => {
203
216
  },
204
217
  })
205
218
  }
219
+ const onCopy = (data?: string) => {
220
+ if (!data) return
221
+ uni.setClipboardData({
222
+ data,
223
+ })
224
+ }
206
225
  </script>
207
226
 
208
227
  <style lang="scss" scoped>
@@ -211,6 +230,7 @@ const onChooseAvatar = async (e) => {
211
230
  border: none;
212
231
  padding: 0;
213
232
  margin: 0;
233
+ margin: 0;
214
234
  color: inherit;
215
235
  font-size: inherit;
216
236
  // display: inline-block;
@@ -13,7 +13,7 @@ export type LcbActionViewProps = {
13
13
  * 13: 退出登录 14: 小程序弹框 16: 小程序锚点 17 网络请求 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
14
14
  * 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话
15
15
  * 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
16
- * 105 查看地图 106 查看地图
16
+ * 105 查看地图 106 查看地图 141 二维码
17
17
  */
18
18
  jumpType?:
19
19
  | 1
@@ -69,4 +69,7 @@ export type LcbActionViewProps = {
69
69
  jumpType: 106
70
70
  requestParam?: Record<string, any>
71
71
  }
72
+ | {
73
+ jumpType: 141
74
+ }
72
75
  )
@@ -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,28 +79,10 @@ 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
- const scaleRadius: Record<string, number> = {
84
- 3: 1_000_000,
85
- 4: 500_000,
86
- 5: 200_000,
87
- 6: 100_000,
88
- 7: 50_000,
89
- 8: 25_000,
90
- 9: 20_000,
91
- 10: 10_000,
92
- 11: 5_000,
93
- 12: 2_000,
94
- 13: 1_000,
95
- 14: 500,
96
- 15: 200,
97
- 16: 100,
98
- 17: 50,
99
- 18: 20,
100
- 19: 10,
101
- 20: 5,
102
- }
103
86
  const themeColor = inject('theme-color', '#3875FF')
104
87
  const callout: MapMarker['callout'] = {
105
88
  content: '腾讯总部大楼',
@@ -108,7 +91,6 @@ const callout: MapMarker['callout'] = {
108
91
  fontSize: 14,
109
92
  textAlign: 'center',
110
93
  borderRadius: 4,
111
-
112
94
  borderWidth: 1,
113
95
  borderColor: themeColor,
114
96
  bgColor: '#ffffff',
@@ -121,16 +103,21 @@ const form = inject<Record<string, any>>(FORM_KEY, {})
121
103
  const current = ref(0)
122
104
  const list = ref<MapItem[]>([])
123
105
 
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)
106
+ const getData = debounce(() => {
107
+ mapContext.value?.getRegion({
108
+ async success(res) {
109
+ const { data = [] } = (await uni.$lcb.http.post('/productInfo/map', {
110
+ ...props.baseParam,
111
+ ...form?.value,
112
+ mapCornerLongitude: res.southwest.longitude,
113
+ mapCornerLatitude: res.southwest.latitude,
114
+ })) as {
115
+ data: MapItem[]
116
+ }
117
+ list.value = data as any
118
+ getCurrentData(data)
119
+ },
120
+ })
134
121
  }, 50)
135
122
 
136
123
  watch(
@@ -141,7 +128,6 @@ watch(
141
128
  form.value.mapLongitude = val.longitude
142
129
  form.value.userLongitude = val.longitude
143
130
  form.value.userLatitude = val.latitude
144
- form.value.mapViewRadius = scaleRadius[14]
145
131
  },
146
132
  {
147
133
  immediate: true,
@@ -160,10 +146,8 @@ const onRegionChange = (e: {
160
146
  }
161
147
  }) => {
162
148
  if (e.type === 'end') {
163
- form.value.scale = e.detail.scale
164
149
  form.value.mapLatitude = e.detail.centerLocation.latitude
165
150
  form.value.mapLongitude = e.detail.centerLocation.longitude
166
- form.value.mapViewRadius = scaleRadius[e.detail.scale]
167
151
  }
168
152
  }
169
153
  const onCurrentChange = (p: number) => {
@@ -220,9 +204,12 @@ watch(
220
204
  },
221
205
  {
222
206
  deep: true,
223
- immediate: true,
224
207
  },
225
208
  )
209
+ onMounted(() => {
210
+ mapContext.value = uni.createMapContext('map', proxy)
211
+ getData()
212
+ })
226
213
  </script>
227
214
  <style lang="scss">
228
215
  .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.52",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -14,7 +14,7 @@ declare const __VLS_component: import('vue').DefineComponent<
14
14
  string,
15
15
  import('vue').PublicProps,
16
16
  any,
17
- {} | {} | {} | {},
17
+ {} | {} | {} | {} | {},
18
18
  {}
19
19
  >
20
20
  declare const _default: __VLS_WithTemplateSlots<
@@ -12,7 +12,7 @@ export type LcbActionViewProps = {
12
12
  * 13: 退出登录 14: 小程序弹框 16: 小程序锚点 17 网络请求 21: 新窗口跳到页面 22: 切换TAB页 23: 重启进入某页面
13
13
  * 24: 回到上一层 25: 关闭当前页面 26: 关闭当前窗口 30: 拨打电话
14
14
  * 88: 授权手机号 101 用户头像 102 分享 103 意见反馈 104 打开授权设置页
15
- * 105 查看地图 106 查看地图
15
+ * 105 查看地图 106 查看地图 141 二维码
16
16
  */
17
17
  jumpType?:
18
18
  | 1
@@ -66,4 +66,7 @@ export type LcbActionViewProps = {
66
66
  jumpType: 106
67
67
  requestParam?: Record<string, any>
68
68
  }
69
+ | {
70
+ jumpType: 141
71
+ }
69
72
  )
@@ -65,8 +65,8 @@ declare const __VLS_component: import('vue').DefineComponent<
65
65
  {
66
66
  'update:modelValue': (modelValue: number[]) => void
67
67
  confirm: (...args: any[]) => void
68
- open: (...args: any[]) => void
69
68
  cancel: (...args: any[]) => void
69
+ open: (...args: any[]) => void
70
70
  },
71
71
  string,
72
72
  import('vue').PublicProps,
@@ -56,10 +56,10 @@ declare const _default: import('vue').DefineComponent<
56
56
  onClick?: ((...args: any[]) => any) | undefined
57
57
  },
58
58
  {
59
- paddingHorizontal: number
60
- paddingVertical: number
61
59
  iconSize: number
62
60
  iconColor: string
61
+ paddingHorizontal: number
62
+ paddingVertical: number
63
63
  textColor: string
64
64
  pictureDistribution: 3 | 4 | 5
65
65
  iconRadius: number
@@ -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
@@ -42,10 +42,10 @@ declare const _default: import('vue').DefineComponent<
42
42
  {
43
43
  backgroundColor: string
44
44
  color: string
45
+ iconSize: number
45
46
  direction: import('@tplc/wot/types/components/wd-notice-bar/types').NoticeBarScrollDirection
46
47
  paddingVertical: number
47
48
  borderColor: string
48
- iconSize: number
49
49
  speed: number
50
50
  rightArrow: boolean
51
51
  },
@@ -13,8 +13,8 @@ declare const _default: import('vue').DefineComponent<
13
13
  import('vue').ComponentOptionsMixin,
14
14
  import('vue').ComponentOptionsMixin,
15
15
  {
16
- refresh: (...args: any[]) => void
17
16
  cancel: (...args: any[]) => void
17
+ refresh: (...args: any[]) => void
18
18
  },
19
19
  string,
20
20
  import('vue').PublicProps,
@@ -8,8 +8,8 @@ declare const _default: import('vue').DefineComponent<
8
8
  import('vue').ComponentOptionsMixin,
9
9
  import('vue').ComponentOptionsMixin,
10
10
  {
11
- refresh: (...args: any[]) => void
12
11
  cancel: (...args: any[]) => void
12
+ refresh: (...args: any[]) => void
13
13
  },
14
14
  string,
15
15
  import('vue').PublicProps,
@@ -54,11 +54,11 @@ declare const _default: import('vue').DefineComponent<
54
54
  >
55
55
  >,
56
56
  {
57
+ iconName: string
57
58
  paddingTop: number
58
59
  paddingBottom: number
59
60
  paddingLeft: number
60
61
  paddingRight: number
61
- iconName: string
62
62
  textColor: string
63
63
  iconType: 0 | 1
64
64
  textSize: number