@tplc/business 0.4.131 → 0.4.132

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,14 @@
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.132](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.131...v0.4.132) (2025-06-19)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 新增默认值 ([77346b6](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/77346b60fde8a78bb1a095c852474481d7be73f9))
11
+ * 调整定位 ([2d796a0](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/2d796a0d84c74584077f240c11d1433b8a5746ef))
12
+
5
13
  ### [0.4.131](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.130...v0.4.131) (2025-06-17)
6
14
 
7
15
 
@@ -20,10 +20,10 @@ const useLocation = (onLocation?: (location: UserLocation) => void) => {
20
20
  }
21
21
 
22
22
  // 引导用户前往设置页面重新授权
23
- function navigateToSettings() {
23
+ function navigateToSettings(forceSetting = false) {
24
24
  /** 48小时提醒一次 */
25
25
  const lastTime = uni.getStorageSync('location_last_time')
26
- if (lastTime && new Date().getTime() - lastTime < 48 * 60 * 60 * 1000) {
26
+ if (lastTime && new Date().getTime() - lastTime < 48 * 60 * 60 * 1000 && !forceSetting) {
27
27
  return
28
28
  }
29
29
  uni.setStorageSync('location_last_time', new Date().getTime())
@@ -47,7 +47,7 @@ const useLocation = (onLocation?: (location: UserLocation) => void) => {
47
47
  })
48
48
  }
49
49
 
50
- const getLocation = async (force = false) => {
50
+ const getLocation = async (force = false, forceSetting = false) => {
51
51
  // 如果不是force并且当前位置有值,则不刷新
52
52
  if (!force && currentLocation.value) return
53
53
  if ((await checkLocationPermission()) !== false) {
@@ -85,7 +85,7 @@ const useLocation = (onLocation?: (location: UserLocation) => void) => {
85
85
  })
86
86
  })
87
87
  } else {
88
- navigateToSettings()
88
+ navigateToSettings(forceSetting)
89
89
  }
90
90
  }
91
91
  return { getLocation, locationIng, userLocation: currentLocation, userLatLon: currentUserLatLon }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.131",
3
+ "version": "0.4.132",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -2,7 +2,7 @@ import { UserLocation } from './useLocation.api'
2
2
  export declare const currentLocation: import('vue').Ref<UserLocation | undefined>
3
3
  export declare const currentUserLatLon: import('vue').Ref<UniApp.GetLocationSuccess | undefined>
4
4
  declare const useLocation: (onLocation?: (location: UserLocation) => void) => {
5
- getLocation: (force?: boolean) => Promise<void>
5
+ getLocation: (force?: boolean, forceSetting?: boolean) => Promise<void>
6
6
  locationIng: import('vue').Ref<boolean>
7
7
  userLocation: import('vue').Ref<UserLocation | undefined>
8
8
  userLatLon: import('vue').Ref<UniApp.GetLocationSuccess | undefined>