@tplc/business 0.3.44 → 0.3.46

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,29 @@
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.46](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.45...v0.3.46) (2025-02-13)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 兼容map ([fa98ffb](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/fa98ffb9e2e3a2d75442be8bc71ae58f35f82f56))
11
+
12
+ ### [0.3.45](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.42...v0.3.45) (2025-02-13)
13
+
14
+
15
+ ### 🚀 Chore | 构建/工程依赖/工具
16
+
17
+ * **release:** 0.1.60 ([59c5e89](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/59c5e89204f8c9dcf51593f11531a3e789d8a3c7))
18
+ * **release:** 0.3.43 ([6615820](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/66158205a99fd2d816c4e8160c557c366a2ff944))
19
+ * **release:** 0.3.44 ([e9ec860](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e9ec860c6c411cbc0a2920176fea31f80dc1a07c))
20
+
21
+
22
+ ### ✨ Features | 新功能
23
+
24
+ * 加载更多 ([54abf15](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/54abf1537eaf81dbb592cbfdb056ac299feef0b2))
25
+ * 支持协议 ([4c88106](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/4c88106dd53b609461862356c7e18fdef63d8b11))
26
+ * 更新collapse ([f3d42e8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/f3d42e8e938ab39718304139edc780e3924128d9))
27
+
5
28
  ### [0.3.44](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.43...v0.3.44) (2025-02-13)
6
29
 
7
30
  ### [0.3.43](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.41...v0.3.43) (2025-02-13)
@@ -32,7 +32,7 @@
32
32
  />
33
33
  </view>
34
34
  </view>
35
- <lcb-action-view v-bind="link" v-if="link">
35
+ <lcb-action-view v-bind="link" v-if="link" :url-params="form">
36
36
  <wd-icon :name="icon" class-prefix="lcb" size="36rpx" color="#333" custom-class="ml-4" />
37
37
  </lcb-action-view>
38
38
  </lcb-block>
@@ -17,6 +17,7 @@
17
17
  :step="50"
18
18
  unit="¥"
19
19
  />
20
+ {{ innerValue }}
20
21
  <view class="grid grid-cols-4 gap-4 mt-2" v-if="options.length">
21
22
  <SelectTagView
22
23
  v-for="item in options"
@@ -79,7 +80,7 @@ watch(
79
80
  if (val?.length === 1) {
80
81
  innerValue.value = [val[0], val[0]]
81
82
  } else {
82
- innerValue.value = val
83
+ innerValue.value = val?.map((v) => (typeof v === 'string' ? parseInt(v) : v))
83
84
  }
84
85
  },
85
86
  { immediate: true },
@@ -59,12 +59,15 @@
59
59
 
60
60
  <script lang="ts" setup>
61
61
  import { FORM_KEY } from '@tplc/business/constants'
62
- import { reactive, inject, ref, useAttrs, watch } from 'vue'
62
+ import { reactive, inject, ref, useAttrs, watch, onMounted } from 'vue'
63
63
  import { transformValueUnit } from '../../utils/transform'
64
64
  import { MapItem, MapMarker } from './types'
65
65
  import useAutoHeight from '../../hooks/useAutoHeight'
66
66
  import { LcbListProps } from '@tplc/business/components/lcb-list/types'
67
67
  import { LcbListInfo } from '@tplc/business/components/lcb-list/api'
68
+ import { debounce } from '@tplc/wot/components/common/util'
69
+ import useLocation from '../../hooks/useLocation'
70
+ import { getCurrentPage } from '../../utils/utils'
68
71
  const height = useAutoHeight()
69
72
  defineOptions({
70
73
  name: 'LcbMap',
@@ -75,6 +78,7 @@ defineOptions({
75
78
  },
76
79
  })
77
80
  const attrs = useAttrs()
81
+ const { userLatLon, getLocation } = useLocation()
78
82
  const props = defineProps<LcbListProps & LcbListInfo>()
79
83
  const scaleRadius: Record<string, number> = {
80
84
  3: 1_000_000,
@@ -117,7 +121,7 @@ const form = inject<Record<string, any>>(FORM_KEY, {})
117
121
  const current = ref(0)
118
122
  const list = ref<MapItem[]>([])
119
123
 
120
- const getData = async () => {
124
+ const getData = debounce(async () => {
121
125
  // || props.url
122
126
  const { data } = (await uni.$lcb.http.post('/productInfo/map', {
123
127
  ...props.baseParam,
@@ -127,25 +131,23 @@ const getData = async () => {
127
131
  }
128
132
  list.value = data
129
133
  getCurrentData(data)
130
- }
131
- const getLocation = () => {
132
- uni.getLocation({
133
- type: 'gcj02',
134
- success: (res) => {
135
- form.value.mapViewRadius = scaleRadius[16]
136
- form.value.userLongitude = res.longitude
137
- form.value.userLatitude = res.latitude
138
- form.value.mapLatitude = res.latitude
139
- form.value.mapLongitude = res.longitude
140
- },
141
- fail: () => {
142
- uni.showToast({
143
- title: '定位失败',
144
- icon: 'none',
145
- })
146
- },
147
- })
148
- }
134
+ }, 50)
135
+
136
+ watch(
137
+ () => userLatLon.value,
138
+ (val) => {
139
+ if (!val) return
140
+ form.value.mapLatitude = val.latitude
141
+ form.value.mapLongitude = val.longitude
142
+ form.value.userLongitude = val.longitude
143
+ form.value.userLatitude = val.latitude
144
+ form.value.mapViewRadius = scaleRadius[14]
145
+ },
146
+ {
147
+ immediate: true,
148
+ deep: true,
149
+ },
150
+ )
149
151
  getLocation()
150
152
  const onRegionChange = (e: {
151
153
  type: string
@@ -162,7 +164,6 @@ const onRegionChange = (e: {
162
164
  form.value.mapLatitude = e.detail.centerLocation.latitude
163
165
  form.value.mapLongitude = e.detail.centerLocation.longitude
164
166
  form.value.mapViewRadius = scaleRadius[e.detail.scale]
165
- getData()
166
167
  }
167
168
  }
168
169
  const onCurrentChange = (p: number) => {
@@ -221,6 +222,12 @@ watch(
221
222
  deep: true,
222
223
  },
223
224
  )
225
+ onMounted(() => {
226
+ form.value = {
227
+ ...form.value,
228
+ ...getCurrentPage().options,
229
+ }
230
+ })
224
231
  </script>
225
232
  <style lang="scss">
226
233
  .icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "peerDependencies": {
13
13
  "vue": ">=3.2.47",
14
- "@tplc/wot": "0.1.59"
14
+ "@tplc/wot": "0.1.60"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18",
@@ -1,7 +1,6 @@
1
1
  export declare function formatJson(str: string | object | undefined, defVal?: {}): {}
2
2
  /** 获取上个页面Exposed */
3
3
  export declare const getExposed: () => any
4
- export declare const getPageOptions: () => any
5
4
  export declare const getCurrentPage: () => {
6
5
  pageId: number
7
6
  fullPath: string
package/utils/utils.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { onPageScroll } from '@dcloudio/uni-app'
2
1
  import { parse, stringify } from 'qs'
3
2
  export function formatJson(str: string | object | undefined, defVal = {}) {
4
3
  if (!str) return defVal
@@ -18,10 +17,6 @@ export const getExposed = () => {
18
17
  return page.$vm.$.exposed
19
18
  }
20
19
 
21
- export const getPageOptions = () => {
22
- return getCurrentPage().options
23
- }
24
-
25
20
  export const getCurrentPage = () => {
26
21
  const page = getCurrentPages().pop() as {
27
22
  $page: {
@@ -29,12 +24,12 @@ export const getCurrentPage = () => {
29
24
  }
30
25
  route: string
31
26
  getPageId: () => number
32
- options: any
33
27
  }
28
+ const fullPath = decodeURIComponent(page.$page?.fullPath || '')
34
29
  return {
35
30
  pageId: page.getPageId?.(),
36
31
  fullPath: page.$page?.fullPath,
37
- options: page.options,
32
+ options: parse(fullPath?.split('?')[1]),
38
33
  route: page.route,
39
34
  }
40
35
  }