af-mobile-client-vue3 1.1.17 → 1.1.18

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.1.17",
4
+ "version": "1.1.18",
5
5
  "description": "Vue + Vite component lib",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -15,12 +15,15 @@ const props = withDefaults(defineProps<Props>(), {
15
15
  defaultCenter: () => {
16
16
  try {
17
17
  mobileUtil.execute({
18
- param: undefined,
19
- funcName: 'getPhoneStatus',
18
+ param: {},
19
+ funcName: 'getLocationResult',
20
20
  callbackFunc: (result) => {
21
- const locationResult = result as PhoneLocationStatus
22
- if (locationResult.f_latitude && locationResult.f_longitude) {
23
- return [locationResult.f_longitude, locationResult.f_latitude]
21
+ const res = result as PhoneLocationStatus
22
+ if (res.status === 'success') {
23
+ const locationResult = JSON.parse(res.data.location)
24
+ if (locationResult.longitude && locationResult.latitude) {
25
+ return [locationResult.longitude, locationResult.latitude]
26
+ }
24
27
  }
25
28
  },
26
29
  })
@@ -818,16 +818,19 @@ async function handleLocation() {
818
818
 
819
819
  try {
820
820
  mobileUtil.execute({
821
- param: undefined,
822
- funcName: 'getPhoneStatus',
821
+ param: {},
822
+ funcName: 'getLocationResult',
823
823
  callbackFunc: (result) => {
824
- const locationResult = result as PhoneLocationStatus
825
- if (locationResult.f_latitude && locationResult.f_longitude) {
826
- const center: [number, number] = [locationResult.f_longitude, locationResult.f_latitude]
827
- setCenterAndZoom(center, getZoom())
828
- // 更新位置图标
829
- if (isFollowingLocation.value) {
830
- updateLocationMarker(center)
824
+ const res = result as PhoneLocationStatus
825
+ if (res.status === 'success') {
826
+ const locationResult = JSON.parse(res.data.location)
827
+ if (locationResult.longitude && locationResult.latitude) {
828
+ const center: [number, number] = [locationResult.longitude, locationResult.latitude]
829
+ setCenterAndZoom(center, getZoom())
830
+ // 更新位置图标
831
+ if (isFollowingLocation.value) {
832
+ updateLocationMarker(center)
833
+ }
831
834
  }
832
835
  }
833
836
  },
@@ -10,12 +10,12 @@ export interface LocationResult {
10
10
 
11
11
  /** 手机状态接口 */
12
12
  export interface PhoneLocationStatus {
13
- /** 纬度 */
14
- f_latitude: number
15
- /** 经度 */
16
- f_longitude: number
17
- /** 其他可能的状态属性 */
18
- [key: string]: unknown
13
+
14
+ status: string
15
+
16
+ data: {
17
+ location: string;
18
+ }
19
19
  }
20
20
 
21
21
  /** 初始化参数接口 */