mix-public 1.2.0 → 1.2.2
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/README.md +2 -0
- package/customMethod/cookie.js +12 -0
- package/customMethod/publicLogic.ts +1 -1
- package/docs/01./346/241/206/346/236/266/344/273/213/347/273/215/04./345/277/253/351/200/237/344/270/212/346/211/213.md +3 -2
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/01.Goto.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/02.GotoMain.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/03.Drawer.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/04.PopupShow.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/05.GoBack.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/06.ReturnHomePage.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/01./351/241/265/351/235/242/350/267/263/350/275/254/07.GotoUrlByBrowse.md +2 -0
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/02./347/211/271/346/256/212/351/241/265/351/235/242/350/267/263/350/275/254/01.GoToVideo.md +7 -2
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/02./347/211/271/346/256/212/351/241/265/351/235/242/350/267/263/350/275/254/02.GoToMap.md +10 -3
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/02./347/211/271/346/256/212/351/241/265/351/235/242/350/267/263/350/275/254/03.MapSearch.md +11 -3
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/02./347/211/271/346/256/212/351/241/265/351/235/242/350/267/263/350/275/254/04.OnlineService.md +11 -3
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/03./350/267/263/350/275/254/344/270/211/346/226/271/01.OpenOtherApp.md +15 -10
- package/docs/02.API/00./351/241/265/351/235/242/350/267/263/350/275/254/03./350/267/263/350/275/254/344/270/211/346/226/271/02.OpenWechatMiniProgram.md +17 -11
- package/docs/02.API/01./346/234/254/345/234/260/345/217/202/346/225/260/345/255/230/345/202/250/01.PutCookieInfo.md +48 -0
- package/docs/02.API/01./346/234/254/345/234/260/345/217/202/346/225/260/345/255/230/345/202/250/02.GetCookieInfo.md +44 -0
- package/docs/02.API/02.APP/345/210/206/344/272/253/01./345/210/206/344/272/253/351/223/276/346/216/245/350/207/263/345/276/256/344/277/241/01.ShareSessionUrl.md +11 -6
- package/docs/02.API/02.APP/345/210/206/344/272/253/01./345/210/206/344/272/253/351/223/276/346/216/245/350/207/263/345/276/256/344/277/241/02.ShareTimelineUrl.md +11 -6
- package/docs/02.API/02.APP/345/210/206/344/272/253/02./345/210/206/344/272/253/345/233/276/347/211/207/350/207/263/345/276/256/344/277/241/01.ShareSessionImage.md +8 -3
- package/docs/02.API/02.APP/345/210/206/344/272/253/02./345/210/206/344/272/253/345/233/276/347/211/207/350/207/263/345/276/256/344/277/241/02.Base64ImageShareWechatSession.md +8 -3
- package/docs/02.API/02.APP/345/210/206/344/272/253/02./345/210/206/344/272/253/345/233/276/347/211/207/350/207/263/345/276/256/344/277/241/03.ShareTimelineImage.md +8 -3
- package/docs/02.API/02.APP/345/210/206/344/272/253/02./345/210/206/344/272/253/345/233/276/347/211/207/350/207/263/345/276/256/344/277/241/04.Base64ImageShareWechatTimeline.md +8 -3
- package/docs/02.API/04.APP/345/233/276/347/211/207/01./345/233/276/347/211/207/351/200/211/346/213/251/01.UploadPhoto.md +17 -16
- package/docs/02.API/04.APP/345/233/276/347/211/207/01./345/233/276/347/211/207/351/200/211/346/213/251/02.LibraryPhoto.md +17 -16
- package/docs/02.API/04.APP/345/233/276/347/211/207/01./345/233/276/347/211/207/351/200/211/346/213/251/03.CameraPhoto.md +45 -0
- package/docs/api/BATCH_GENERATION_COMPLETE.md +28 -0
- package/docs/api/Cookie/346/223/215/344/275/234/017-PutCookieInfo.md +124 -0
- package/docs/api/Cookie/346/223/215/344/275/234/018-GetCookieInfo.md +141 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/015-OpenOtherApp.md +95 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/016-OpenWechatMiniProgram.md +107 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/032-JumpMiniApp.md +116 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/033-JumpHalfScreenApp.md +126 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/034-getMiniProgramUsageRecord.md +115 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/035-MiniAppDelete.md +86 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/046-OCRBankCard.md +131 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/047-OCRIdCard.md +170 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/048-ScanQRCode.md +113 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/049-QRCodeBase64.md +128 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/050-SetTitle.md +103 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/051-SetRightButtonTitle.md +112 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/052-SetStatusBarBgColor.md +110 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/053-SetStatusBarStyle.md +121 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/062-IsNet.md +133 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/064-GetApnsAuthorizationStatus.md +132 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/068-SettingApns.md +116 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/078-IsOpenPushSound.md +117 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/079-BindCloudChannel.md +137 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/080-UnbindCloudChannel.md +134 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/092-PhoneCall.md +131 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/094-FullScreen.md +87 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/104-OnlineService.md +128 -0
- package/docs/api//345/205/266/344/273/226/345/212/237/350/203/275/107-CutWord.md +136 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/019-ShareSessionUrl.md +106 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/020-ShareSessionImage.md +94 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/021-ShareTimelineUrl.md +107 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/022-ShareTimelineImage.md +95 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/023-Base64ImageShareWechatTimeline.md +99 -0
- package/docs/api//345/210/206/344/272/253/345/212/237/350/203/275/024-Base64ImageShareWechatSession.md +98 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/025-UploadPhoto.md +128 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/026-LibraryPhoto.md +129 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/027-CameraPhoto.md +129 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/028-SaveToSd.md +94 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/029-SaveBase64ImageToSd.md +99 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/030-CachePicture.md +115 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/031-PhotoBrowser.md +122 -0
- package/docs/api//345/233/276/347/211/207/345/244/204/347/220/206/093-SaveToiCloud.md +143 -0
- package/docs/api//345/234/260/345/233/276/345/256/232/344/275/215/013-GoToMap.md +83 -0
- package/docs/api//345/234/260/345/233/276/345/256/232/344/275/215/014-MapSearch.md +81 -0
- package/docs/api//345/234/260/345/233/276/345/256/232/344/275/215/063-GetLocation.md +173 -0
- package/docs/api//345/234/260/345/233/276/345/256/232/344/275/215/105-OpenAmap.md +151 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/010-LoginOut.md +77 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/036-ShowRewardedVideo.md +86 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/037-ShowInterstitial.md +88 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/056-SetBadgeValue.md +115 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/057-ClearBadgeValue.md +93 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/073-ClearAppCache.md +126 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/074-ExitApp.md +138 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/076-ReplaceAppIcon.md +131 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/082-SetApplicationIconBadgeNumber.md +137 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/083-ClearApplicationIconBadgeNumber.md +122 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/084-AutoLogin.md +118 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/096-InitCloudChannel.md +132 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/097-WeChatLogin.md +164 -0
- package/docs/api//345/272/224/347/224/250/347/256/241/347/220/206/098-QQLogin.md +168 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/004-Drawer.md +119 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/005-DrawerBack.md +70 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/006-PopupShow.md +103 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/007-PopupClose.md +71 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/044-RefreshDialog.md +88 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/085-ShowLoading.md +132 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/086-HideLoading.md +135 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/087-ShowMsg.md +135 -0
- package/docs/api//345/274/271/347/252/227/346/212/275/345/261/211/088-ShowDialog.md +159 -0
- package/docs/api//346/224/257/344/273/230/345/212/237/350/203/275/101-RequestAlipay.md +200 -0
- package/docs/api//346/224/257/344/273/230/345/212/237/350/203/275/102-RequestWechatPay.md +214 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/038-DownloadFiles.md +116 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/039-DownloadFileCancel.md +100 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/040-getDownloadFileProgress.md +129 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/041-DownloadFileDelete.md +103 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/042-FilesPreview.md +105 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/043-getFinishDownloadPaths.md +112 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/099-StartHttpServer.md +141 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/100-StopHttpServer.md +137 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/103-CacheSize.md +131 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/106-UploadVideo.md +132 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/109-PlayVideo.md +137 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/110-VideoDownload.md +137 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/111-StartAudioRecording.md +134 -0
- package/docs/api//346/226/207/344/273/266/346/223/215/344/275/234/112-StopAudioRecording.md +132 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/058-GetDeviceInfo.md +134 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/059-GetBrightness.md +104 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/060-GetVolume.md +105 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/065-Brightness.md +134 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/066-VolumeControl.md +142 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/069-GetAppVersion.md +118 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/070-GetStatusBarHeight.md +121 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/075-GetAppIconsPath.md +130 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/077-getBiometricRecognition.md +142 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/081-Shock.md +113 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/090-OpenGyro.md +121 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/091-CloseGyro.md +135 -0
- package/docs/api//350/256/276/345/244/207/344/277/241/346/201/257/095-Keyboard.md +136 -0
- package/docs/api//351/200/232/347/237/245/346/217/220/351/206/222/061-GetClipboardContent.md +117 -0
- package/docs/api//351/200/232/347/237/245/346/217/220/351/206/222/067-ScheduleReminder.md +138 -0
- package/docs/api//351/200/232/347/237/245/346/217/220/351/206/222/089-FloatingWindowData.md +168 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/001-Goto.md +114 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/002-GotoInside.md +80 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/003-GotoMain.md +70 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/008-GoBack.md +83 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/009-ReturnHomePage.md +84 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/011-GotoUrlByBrowse.md +81 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/012-GoToVideo.md +90 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/045-ReturnPageUrl.md +94 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/054-DestructionPage.md +93 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/055-PageCheck.md +94 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/071-GreyAllPages.md +129 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/072-ClosePop.md +133 -0
- package/docs/api//351/241/265/351/235/242/350/267/263/350/275/254/108-StayTime.md +139 -0
- package/main/mixappfunc.ts +703 -198
- package/main/paramsTypes.ts +10 -7
- package/mixRender.css +10 -11
- package/mixRender.js +9 -2
- package/package.json +1 -1
- package/docs/02.API/01./346/234/254/345/234/260/345/217/202/346/225/260/345/255/230/345/202/250/01.putCookieInfo.md +0 -29
- package/docs/02.API/01./346/234/254/345/234/260/345/217/202/346/225/260/345/255/230/345/202/250/02.getCookieInfo.md +0 -52
- package/docs/02.API/02.APP/345/210/206/344/272/253/_meta.json +0 -16
- package/docs/02.API/04.APP/345/233/276/347/211/207/01./345/233/276/347/211/207/351/200/211/346/213/251/03.CanemaPhoto.md +0 -44
- package/docs/02.API/04.APP/345/233/276/347/211/207/01./345/233/276/347/211/207/351/200/211/346/213/251/04.ImgUpload.md +0 -131
- package/docs/02.API/04.APP/345/233/276/347/211/207/_meta.json +0 -23
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-save-to-icloud/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 文件管理
|
|
7
|
+
tags: []
|
|
8
|
+
author: { name: AI Assistant }
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# SaveToiCloud - 保存到iCloud
|
|
12
|
+
|
|
13
|
+
## 功能描述
|
|
14
|
+
|
|
15
|
+
将文件保存到iCloud云存储。用于在iOS设备上将数据同步到iCloud。
|
|
16
|
+
|
|
17
|
+
## 调用类型
|
|
18
|
+
|
|
19
|
+
同步类
|
|
20
|
+
|
|
21
|
+
## 方法说明
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
SaveToiCloud(option: {
|
|
25
|
+
fileName: string;
|
|
26
|
+
fileData: string;
|
|
27
|
+
}): void
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 参数说明
|
|
31
|
+
|
|
32
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
33
|
+
|--------|------|------|------|--------|
|
|
34
|
+
| fileName | string | 是 | 文件名 | "" |
|
|
35
|
+
| fileData | string | 是 | 文件数据(base64格式) | "" |
|
|
36
|
+
|
|
37
|
+
### 返回值说明
|
|
38
|
+
|
|
39
|
+
无返回值
|
|
40
|
+
|
|
41
|
+
## 代码示例
|
|
42
|
+
|
|
43
|
+
### JavaScript 示例
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
// 保存文本文件到iCloud
|
|
47
|
+
mixPublicLib.SaveToiCloud({
|
|
48
|
+
fileName: "notes.txt",
|
|
49
|
+
fileData: btoa("这是要保存的文本内容")
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 保存图片到iCloud
|
|
53
|
+
function saveImageToICloud(imageDataUrl, filename) {
|
|
54
|
+
// 从data URL提取base64数据
|
|
55
|
+
const base64Data = imageDataUrl.split(',')[1];
|
|
56
|
+
mixPublicLib.SaveToiCloud({
|
|
57
|
+
fileName: filename,
|
|
58
|
+
fileData: base64Data
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 保存用户数据到iCloud
|
|
63
|
+
const userData = JSON.stringify({
|
|
64
|
+
preferences: { theme: "dark", language: "zh" },
|
|
65
|
+
settings: { notifications: true }
|
|
66
|
+
});
|
|
67
|
+
mixPublicLib.SaveToiCloud({
|
|
68
|
+
fileName: "user-settings.json",
|
|
69
|
+
fileData: btoa(userData)
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### TypeScript 示例
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import type { SaveToiCloudType } from './paramsTypes';
|
|
77
|
+
|
|
78
|
+
// 保存文件到iCloud
|
|
79
|
+
const iCloudOptions: SaveToiCloudType = {
|
|
80
|
+
fileName: "backup.txt",
|
|
81
|
+
fileData: btoa("备份数据内容")
|
|
82
|
+
};
|
|
83
|
+
mixPublicLib.SaveToiCloud(iCloudOptions);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 使用说明
|
|
87
|
+
|
|
88
|
+
### 文件格式支持
|
|
89
|
+
|
|
90
|
+
- **文本文件**: .txt, .json, .xml, .csv 等
|
|
91
|
+
- **图片文件**: .jpg, .png, .gif 等(需要base64编码)
|
|
92
|
+
- **其他文件**: 任何可以转换为base64的数据
|
|
93
|
+
|
|
94
|
+
### 数据格式要求
|
|
95
|
+
|
|
96
|
+
- **fileData**: 必须是base64编码的字符串
|
|
97
|
+
- **fileName**: 包含文件扩展名的完整文件名
|
|
98
|
+
- **文件大小**: 受iCloud存储空间限制
|
|
99
|
+
|
|
100
|
+
### 平台差异
|
|
101
|
+
|
|
102
|
+
- **iOS**: 完全支持iCloud文件保存功能
|
|
103
|
+
- **Android**: 可能不支持或提供模拟功能
|
|
104
|
+
- **Web端**: 通常不支持iCloud功能
|
|
105
|
+
|
|
106
|
+
### 使用场景
|
|
107
|
+
|
|
108
|
+
- 用户数据的云备份
|
|
109
|
+
- 跨设备数据同步
|
|
110
|
+
- 重要文件的安全存储
|
|
111
|
+
- 应用配置的云端保存
|
|
112
|
+
- 文档和笔记的自动同步
|
|
113
|
+
|
|
114
|
+
## 注意事项
|
|
115
|
+
|
|
116
|
+
- **平台限制**:
|
|
117
|
+
- 此功能主要针对iOS平台
|
|
118
|
+
- Android和Web端可能不支持
|
|
119
|
+
- 需要用户登录Apple ID并启用iCloud
|
|
120
|
+
- **权限要求**:
|
|
121
|
+
- iOS需要用户授权iCloud访问权限
|
|
122
|
+
- 需要在Info.plist中配置iCloud相关权限
|
|
123
|
+
- 某些iCloud容器可能需要特殊配置
|
|
124
|
+
- **用户体验**:
|
|
125
|
+
- 保存过程可能需要几秒钟
|
|
126
|
+
- 大文件保存可能消耗较多时间和存储空间
|
|
127
|
+
- 建议提供保存进度提示
|
|
128
|
+
- **最佳实践**:
|
|
129
|
+
- 在保存前验证文件数据的有效性
|
|
130
|
+
- 提供保存成功的确认提示
|
|
131
|
+
- 处理iCloud存储空间不足的情况
|
|
132
|
+
- 测试不同文件类型和大小的保存效果
|
|
133
|
+
- **兼容性**:
|
|
134
|
+
- 不同iOS版本的iCloud API可能有差异
|
|
135
|
+
- 某些老版本设备可能不支持
|
|
136
|
+
- iCloud服务可用性受网络环境影响
|
|
137
|
+
|
|
138
|
+
## 相关 API
|
|
139
|
+
|
|
140
|
+
- [`SaveToSd`](./028-SaveToSd.md) - 保存在线图片
|
|
141
|
+
- [`SaveBase64ImageToSd`](./029-SaveBase64ImageToSd.md) - 保存base64图片
|
|
142
|
+
- [`UploadPhoto`](./025-UploadPhoto.md) - 选择图片
|
|
143
|
+
- [`GetDeviceInfo`](./058-GetDeviceInfo.md) - 获取设备信息
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-go-to-map/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 页面跳转
|
|
7
|
+
- 地图功能
|
|
8
|
+
tags: []
|
|
9
|
+
author: { name: AI Assistant }
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# GoToMap - 跳转地图页面
|
|
13
|
+
|
|
14
|
+
## 功能描述
|
|
15
|
+
|
|
16
|
+
跳转页面并插入高德地图做关键词搜索。Web端只做页面跳转,APP端会集成高德地图功能。
|
|
17
|
+
|
|
18
|
+
## 调用类型
|
|
19
|
+
|
|
20
|
+
同步类
|
|
21
|
+
|
|
22
|
+
## 方法说明
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
GoToMap(option: {
|
|
26
|
+
Url: string;
|
|
27
|
+
}): void
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 参数说明
|
|
31
|
+
|
|
32
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
33
|
+
|--------|------|------|------|--------|
|
|
34
|
+
| Url | string | 是 | 页面地址 | "" |
|
|
35
|
+
|
|
36
|
+
### 返回值说明
|
|
37
|
+
|
|
38
|
+
无返回值
|
|
39
|
+
|
|
40
|
+
## 代码示例
|
|
41
|
+
|
|
42
|
+
### JavaScript 示例
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
// 跳转到地图页面
|
|
46
|
+
mixPublicLib.GoToMap({ Url: "map-search" });
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### TypeScript 示例
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import type { GotoInsideType } from './paramsTypes';
|
|
53
|
+
|
|
54
|
+
const options: GotoInsideType = { Url: "map-search" };
|
|
55
|
+
|
|
56
|
+
mixPublicLib.GoToMap(options);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 使用说明
|
|
60
|
+
|
|
61
|
+
### 平台差异
|
|
62
|
+
|
|
63
|
+
- **Web端**: 通过 `Goto()` 方法跳转到指定页面URL
|
|
64
|
+
- **APP端**: 跳转到指定页面并集成高德地图关键词搜索功能
|
|
65
|
+
|
|
66
|
+
### 使用场景
|
|
67
|
+
|
|
68
|
+
- 需要跳转到专门的地图搜索页面时使用
|
|
69
|
+
- 适用于位置搜索、地点查找等业务场景
|
|
70
|
+
- 目标页面需要实现地图相关的UI和逻辑
|
|
71
|
+
|
|
72
|
+
## 注意事项
|
|
73
|
+
|
|
74
|
+
- Url 参数必须是有效的页面路径
|
|
75
|
+
- APP端需要在OMEGA项目中配置高德地图相关参数
|
|
76
|
+
- Web端不会自动集成地图功能,需要在目标页面自行实现
|
|
77
|
+
- 此方法本身不包含搜索关键词,关键词需要在目标页面处理
|
|
78
|
+
|
|
79
|
+
## 相关 API
|
|
80
|
+
|
|
81
|
+
- [`Goto`](./001-Goto.md) - 跳转页面
|
|
82
|
+
- [`GetLocation`](./063-GetLocation.md) - 获取地理位置
|
|
83
|
+
- [`OpenAmap`](./105-OpenAmap.md) - 打开高德地图
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-map-search/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 地图功能
|
|
7
|
+
tags: []
|
|
8
|
+
author: { name: AI Assistant }
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# MapSearch - 高德地图搜索
|
|
12
|
+
|
|
13
|
+
## 功能描述
|
|
14
|
+
|
|
15
|
+
跳转高德地图做关键词搜索。Web端只跳转高德地图,APP端会直接在高德地图中进行关键词搜索。
|
|
16
|
+
|
|
17
|
+
## 调用类型
|
|
18
|
+
|
|
19
|
+
同步类
|
|
20
|
+
|
|
21
|
+
## 方法说明
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
MapSearch(option: {
|
|
25
|
+
KeyWord: string;
|
|
26
|
+
}): void
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 参数说明
|
|
30
|
+
|
|
31
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
32
|
+
|--------|------|------|------|--------|
|
|
33
|
+
| KeyWord | string | 是 | 地图搜索关键词 | "" |
|
|
34
|
+
|
|
35
|
+
### 返回值说明
|
|
36
|
+
|
|
37
|
+
无返回值
|
|
38
|
+
|
|
39
|
+
## 代码示例
|
|
40
|
+
|
|
41
|
+
### JavaScript 示例
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
// 在高德地图中搜索关键词
|
|
45
|
+
mixPublicLib.MapSearch({ KeyWord: "天安门" });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### TypeScript 示例
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import type { MapSearchType } from './paramsTypes';
|
|
52
|
+
|
|
53
|
+
const options: MapSearchType = { KeyWord: "天安门" };
|
|
54
|
+
|
|
55
|
+
mixPublicLib.MapSearch(options);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 使用说明
|
|
59
|
+
|
|
60
|
+
### 平台差异
|
|
61
|
+
|
|
62
|
+
- **Web端**: 跳转到高德地图官网(https://uri.amap.com)
|
|
63
|
+
- **APP端**: 直接调用高德地图APP并进行关键词搜索
|
|
64
|
+
|
|
65
|
+
### 使用场景
|
|
66
|
+
|
|
67
|
+
- 需要快速在高德地图中搜索地点时使用
|
|
68
|
+
- 适用于位置查询、导航等业务场景
|
|
69
|
+
- 可以搜索任何有效的地点名称或地址
|
|
70
|
+
|
|
71
|
+
## 注意事项
|
|
72
|
+
|
|
73
|
+
- KeyWord 参数不能为空
|
|
74
|
+
- APP端需要设备已安装高德地图APP
|
|
75
|
+
- Web端只是跳转到高德地图官网,不会自动执行搜索
|
|
76
|
+
- 搜索结果的准确性取决于高德地图的数据质量
|
|
77
|
+
|
|
78
|
+
## 相关 API
|
|
79
|
+
|
|
80
|
+
- [`GetLocation`](./063-GetLocation.md) - 获取地理位置
|
|
81
|
+
- [`GoToMap`](./013-GoToMap.md) - 打开地图
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-get-location/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 位置服务
|
|
7
|
+
tags: []
|
|
8
|
+
author: { name: AI Assistant }
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# GetLocation - 获取地理位置
|
|
12
|
+
|
|
13
|
+
## 功能描述
|
|
14
|
+
|
|
15
|
+
获取设备当前的地理位置信息。返回包含经纬度、地址等信息的对象。
|
|
16
|
+
|
|
17
|
+
## 调用类型
|
|
18
|
+
|
|
19
|
+
异步返回类
|
|
20
|
+
|
|
21
|
+
## 方法说明
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
GetLocation(): Promise<GetLocationType>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 参数说明
|
|
28
|
+
|
|
29
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
30
|
+
|--------|------|------|------|--------|
|
|
31
|
+
| 无 | 无 | 否 | 无参数 | 无 |
|
|
32
|
+
|
|
33
|
+
#### GetLocationType 接口定义
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
interface GetLocationType {
|
|
37
|
+
latitude: number;
|
|
38
|
+
longitude: number;
|
|
39
|
+
speed: number;
|
|
40
|
+
accuracy: number;
|
|
41
|
+
altitude: number;
|
|
42
|
+
verticalAccuracy: number;
|
|
43
|
+
horizontalAccuracy: number;
|
|
44
|
+
address?: string;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 返回值说明
|
|
49
|
+
|
|
50
|
+
Promise<GetLocationType> - 返回地理位置信息对象,包含以下字段:
|
|
51
|
+
- latitude: 纬度
|
|
52
|
+
- longitude: 经度
|
|
53
|
+
- speed: 速度(单位:m/s)
|
|
54
|
+
- accuracy: 位置精度(单位:m)
|
|
55
|
+
- altitude: 高度(单位:m)
|
|
56
|
+
- verticalAccuracy: 垂直精度(单位:m)
|
|
57
|
+
- horizontalAccuracy: 水平精度(单位:m)
|
|
58
|
+
- address: 详细地址(仅当isAddress为true时返回)
|
|
59
|
+
|
|
60
|
+
## 代码示例
|
|
61
|
+
|
|
62
|
+
### JavaScript 示例
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
// 获取基本位置信息(仅经纬度)
|
|
66
|
+
mixPublicLib.GetLocation()
|
|
67
|
+
.then(location => {
|
|
68
|
+
console.log("位置信息:", location);
|
|
69
|
+
console.log(`纬度: ${location.latitude}, 经度: ${location.longitude}`);
|
|
70
|
+
})
|
|
71
|
+
.catch(error => {
|
|
72
|
+
console.error("获取位置失败:", error);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// 获取详细位置信息(包含地址)
|
|
76
|
+
mixPublicLib.GetLocation({ isAddress: true })
|
|
77
|
+
.then(location => {
|
|
78
|
+
console.log("详细位置信息:", location);
|
|
79
|
+
console.log(`地址: ${location.address}`);
|
|
80
|
+
console.log(`坐标: (${location.latitude}, ${location.longitude})`);
|
|
81
|
+
})
|
|
82
|
+
.catch(error => {
|
|
83
|
+
console.error("获取详细位置失败:", error);
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### TypeScript 示例
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
import type { GetLocationParamsType, GetLocationType } from './paramsTypes';
|
|
91
|
+
|
|
92
|
+
// 基本位置获取
|
|
93
|
+
mixPublicLib.GetLocation()
|
|
94
|
+
.then((location: GetLocationType) => {
|
|
95
|
+
console.log(`当前位置: ${location.latitude}, ${location.longitude}`);
|
|
96
|
+
})
|
|
97
|
+
.catch((error: any) => {
|
|
98
|
+
console.error("位置获取失败:", error);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// 详细位置获取
|
|
102
|
+
const options: GetLocationParamsType = { isAddress: true };
|
|
103
|
+
mixPublicLib.GetLocation(options)
|
|
104
|
+
.then((location: GetLocationType) => {
|
|
105
|
+
if (location.address) {
|
|
106
|
+
console.log(`详细地址: ${location.address}`);
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
.catch((error: any) => {
|
|
110
|
+
console.error("详细位置获取失败:", error);
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 使用说明
|
|
115
|
+
|
|
116
|
+
### 参数选项
|
|
117
|
+
|
|
118
|
+
- **isAddress: false** (默认): 仅返回经纬度和基本位置信息
|
|
119
|
+
- **isAddress: true**: 返回完整的地理位置信息,包括详细地址
|
|
120
|
+
|
|
121
|
+
### 平台差异
|
|
122
|
+
|
|
123
|
+
- **Web端**: 使用浏览器Geolocation API,可能需要HTTPS
|
|
124
|
+
- **APP端**: 调用原生定位服务,支持高精度定位
|
|
125
|
+
- **iOS/Android**: 原生实现,支持GPS、WiFi、基站等多种定位方式
|
|
126
|
+
|
|
127
|
+
### 精度说明
|
|
128
|
+
|
|
129
|
+
- **accuracy**: 位置的总体精度
|
|
130
|
+
- **horizontalAccuracy**: 水平方向的精度
|
|
131
|
+
- **verticalAccuracy**: 垂直方向的精度(高度精度)
|
|
132
|
+
- **altitude**: 海拔高度(可能不准确)
|
|
133
|
+
|
|
134
|
+
### 使用场景
|
|
135
|
+
|
|
136
|
+
- 地图应用的位置标记
|
|
137
|
+
- 附近服务的搜索和推荐
|
|
138
|
+
- 位置签到功能
|
|
139
|
+
- 运动轨迹记录
|
|
140
|
+
- 天气信息获取
|
|
141
|
+
- 地理围栏应用
|
|
142
|
+
|
|
143
|
+
## 注意事项
|
|
144
|
+
|
|
145
|
+
- **权限要求**:
|
|
146
|
+
- 必须获得用户的位置权限授权
|
|
147
|
+
- Web端需要HTTPS环境(除localhost外)
|
|
148
|
+
- iOS需要在Info.plist中配置位置权限描述
|
|
149
|
+
- Android需要在Manifest中声明位置权限
|
|
150
|
+
- **隐私考虑**:
|
|
151
|
+
- 位置信息属于敏感个人信息
|
|
152
|
+
- 应明确告知用户位置使用的用途
|
|
153
|
+
- 遵守相关隐私法规和平台政策
|
|
154
|
+
- **性能影响**:
|
|
155
|
+
- 高精度定位会消耗更多电量
|
|
156
|
+
- 获取地址信息需要网络请求,可能较慢
|
|
157
|
+
- 建议根据实际需求选择合适的精度级别
|
|
158
|
+
- **错误处理**:
|
|
159
|
+
- 用户拒绝权限时会抛出异常
|
|
160
|
+
- 设备无GPS或网络时可能定位失败
|
|
161
|
+
- 建议提供优雅的降级方案
|
|
162
|
+
- **最佳实践**:
|
|
163
|
+
- 仅在必要时请求位置信息
|
|
164
|
+
- 提供手动输入位置的替代方案
|
|
165
|
+
- 缓存位置信息避免频繁请求
|
|
166
|
+
- 在后台时停止位置更新以节省电量
|
|
167
|
+
|
|
168
|
+
## 相关 API
|
|
169
|
+
|
|
170
|
+
- [`MapSearch`](./014-MapSearch.md) - 地图搜索
|
|
171
|
+
- [`GoToMap`](./013-GoToMap.md) - 打开地图
|
|
172
|
+
- [`OpenAmap`](./105-OpenAmap.md) - 打开高德地图
|
|
173
|
+
- [`GetDeviceInfo`](./058-GetDeviceInfo.md) - 获取设备信息
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-open-amap/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 地图功能
|
|
7
|
+
tags: []
|
|
8
|
+
author: { name: AI Assistant }
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# OpenAmap - 打开高德地图
|
|
12
|
+
|
|
13
|
+
## 功能描述
|
|
14
|
+
|
|
15
|
+
打开高德地图应用。用于在高德地图中显示位置或进行导航。
|
|
16
|
+
|
|
17
|
+
## 调用类型
|
|
18
|
+
|
|
19
|
+
同步类
|
|
20
|
+
|
|
21
|
+
## 方法说明
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
OpenAmap(option: OpenAmapType): void
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 参数说明
|
|
28
|
+
|
|
29
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
30
|
+
|--------|------|------|------|--------|
|
|
31
|
+
| option | OpenAmapType | 是 | 高德地图配置对象 | {} |
|
|
32
|
+
|
|
33
|
+
#### OpenAmapType 接口定义
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
interface OpenAmapType {
|
|
37
|
+
latitude: number;
|
|
38
|
+
longitude: number;
|
|
39
|
+
name?: string;
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 返回值说明
|
|
44
|
+
|
|
45
|
+
无返回值
|
|
46
|
+
|
|
47
|
+
## 代码示例
|
|
48
|
+
|
|
49
|
+
### JavaScript 示例
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
// 打开高德地图显示指定位置
|
|
53
|
+
mixPublicLib.OpenAmap({
|
|
54
|
+
latitude: 39.9042,
|
|
55
|
+
longitude: 116.4074,
|
|
56
|
+
name: "北京天安门"
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// 仅使用经纬度打开地图
|
|
60
|
+
mixPublicLib.OpenAmap({
|
|
61
|
+
latitude: 31.2304,
|
|
62
|
+
longitude: 121.4737
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// 在获取用户位置后打开高德地图
|
|
66
|
+
function openMapAtCurrentLocation() {
|
|
67
|
+
mixPublicLib.GetLocation()
|
|
68
|
+
.then(location => {
|
|
69
|
+
mixPublicLib.OpenAmap({
|
|
70
|
+
latitude: location.latitude,
|
|
71
|
+
longitude: location.longitude,
|
|
72
|
+
name: "当前位置"
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
.catch(error => {
|
|
76
|
+
console.error("获取位置失败:", error);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### TypeScript 示例
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import type { OpenAmapType } from './paramsTypes';
|
|
85
|
+
|
|
86
|
+
// 打开高德地图
|
|
87
|
+
const mapOptions: OpenAmapType = {
|
|
88
|
+
latitude: 39.9042,
|
|
89
|
+
longitude: 116.4074,
|
|
90
|
+
name: "北京天安门"
|
|
91
|
+
};
|
|
92
|
+
mixPublicLib.OpenAmap(mapOptions);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 使用说明
|
|
96
|
+
|
|
97
|
+
### 参数说明
|
|
98
|
+
|
|
99
|
+
- **latitude**: 目标位置的纬度(必填)
|
|
100
|
+
- **longitude**: 目标位置的经度(必填)
|
|
101
|
+
- **name**: 位置名称(可选,用于在地图上显示标注)
|
|
102
|
+
|
|
103
|
+
### 坐标系统
|
|
104
|
+
|
|
105
|
+
- **WGS84**: 标准GPS坐标系
|
|
106
|
+
- **GCJ02**: 中国国测局坐标系(高德地图使用)
|
|
107
|
+
- 建议使用标准WGS84坐标,SDK会自动转换
|
|
108
|
+
|
|
109
|
+
### 平台差异
|
|
110
|
+
|
|
111
|
+
- **APP端**: 调用高德地图APP(如果已安装)或跳转到网页版
|
|
112
|
+
- **Web端**: 可能跳转到高德地图网页版
|
|
113
|
+
- **小程序**: 可能调用小程序的地图组件
|
|
114
|
+
|
|
115
|
+
### 使用场景
|
|
116
|
+
|
|
117
|
+
- 商家位置导航
|
|
118
|
+
- 用户当前位置显示
|
|
119
|
+
- POI(兴趣点)搜索结果展示
|
|
120
|
+
- 路线规划和导航
|
|
121
|
+
- 地理位置分享
|
|
122
|
+
|
|
123
|
+
## 注意事项
|
|
124
|
+
|
|
125
|
+
- **应用依赖**:
|
|
126
|
+
- APP端需要用户安装高德地图应用
|
|
127
|
+
- 如果未安装,可能跳转到应用商店或网页版
|
|
128
|
+
- Web端直接跳转到高德地图网站
|
|
129
|
+
- **坐标精度**:
|
|
130
|
+
- 纬度范围:-90 到 90
|
|
131
|
+
- 经度范围:-180 到 180
|
|
132
|
+
- 建议验证坐标的有效性
|
|
133
|
+
- **用户体验**:
|
|
134
|
+
- 提供明确的位置信息
|
|
135
|
+
- 考虑用户的位置隐私
|
|
136
|
+
- 处理高德地图未安装的情况
|
|
137
|
+
- **最佳实践**:
|
|
138
|
+
- 结合 `GetLocation` 获取用户当前位置
|
|
139
|
+
- 提供其他地图应用的备选方案
|
|
140
|
+
- 测试不同设备上的地图打开效果
|
|
141
|
+
- 考虑网络环境对地图加载的影响
|
|
142
|
+
- **兼容性**:
|
|
143
|
+
- 不同平台的地图打开方式可能不同
|
|
144
|
+
- 某些地区可能限制高德地图访问
|
|
145
|
+
- 老版本高德地图可能有兼容性问题
|
|
146
|
+
|
|
147
|
+
## 相关 API
|
|
148
|
+
|
|
149
|
+
- [`GetLocation`](./063-GetLocation.md) - 获取地理位置
|
|
150
|
+
- [`GoToMap`](./013-GoToMap.md) - 打开地图
|
|
151
|
+
- [`MapSearch`](./014-MapSearch.md) - 地图搜索
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-03-06
|
|
3
|
+
permalink: /pages/api-login-out/
|
|
4
|
+
categories:
|
|
5
|
+
- API
|
|
6
|
+
- 页面跳转
|
|
7
|
+
- 用户认证
|
|
8
|
+
tags: []
|
|
9
|
+
author: { name: AI Assistant }
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# LoginOut - 退出登录
|
|
13
|
+
|
|
14
|
+
## 功能描述
|
|
15
|
+
|
|
16
|
+
退出APP至登录页面。用于用户登出操作,跳转到预设的登录页面。
|
|
17
|
+
|
|
18
|
+
## 调用类型
|
|
19
|
+
|
|
20
|
+
同步类
|
|
21
|
+
|
|
22
|
+
## 方法说明
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
LoginOut(): void
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 参数说明
|
|
29
|
+
|
|
30
|
+
| 参数名 | 类型 | 必填 | 说明 | 默认值 |
|
|
31
|
+
|--------|------|------|------|--------|
|
|
32
|
+
| 无 | 无 | 否 | 无参数 | 无 |
|
|
33
|
+
|
|
34
|
+
### 返回值说明
|
|
35
|
+
|
|
36
|
+
无返回值
|
|
37
|
+
|
|
38
|
+
## 代码示例
|
|
39
|
+
|
|
40
|
+
### JavaScript 示例
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
// 退出登录
|
|
44
|
+
mixPublicLib.LoginOut();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### TypeScript 示例
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// 退出登录
|
|
51
|
+
mixPublicLib.LoginOut();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 使用说明
|
|
55
|
+
|
|
56
|
+
### 使用场景
|
|
57
|
+
|
|
58
|
+
- 用户主动登出时调用
|
|
59
|
+
- 会话过期需要重新登录时调用
|
|
60
|
+
- 安全退出当前账户时调用
|
|
61
|
+
|
|
62
|
+
### 实现方式
|
|
63
|
+
|
|
64
|
+
- Web端通过 `Goto()` 方法跳转到预设的登录页面(`user-login`)
|
|
65
|
+
- APP端通过原生导航实现跳转到登录页面
|
|
66
|
+
|
|
67
|
+
## 注意事项
|
|
68
|
+
|
|
69
|
+
- 登录页面URL固定为 `user-login`
|
|
70
|
+
- 此操作不会自动清除用户数据,如需清除请配合其他方法使用
|
|
71
|
+
- Web端和APP端的行为一致
|
|
72
|
+
|
|
73
|
+
## 相关 API
|
|
74
|
+
|
|
75
|
+
- [`AutoLogin`](./084-AutoLogin.md) - 自动登录
|
|
76
|
+
- [`Goto`](./001-Goto.md) - 跳转页面
|
|
77
|
+
- [`ClearAppCache`](./073-ClearAppCache.md) - 清理APP缓存
|