From 9a13715edf185064a8f899bc58a76e5f3c90ac1d Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Wed, 18 Dec 2019 12:09:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20API=E5=85=BC=E5=AE=B9=E6=80=A7=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp-alipay/runtime/api/protocols.js | 35 +++++++++++++++---- src/platforms/mp-qq/runtime/api/protocols.js | 26 +++++++------- 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/src/platforms/mp-alipay/runtime/api/protocols.js b/src/platforms/mp-alipay/runtime/api/protocols.js index 7c2c9798..5f78ff75 100644 --- a/src/platforms/mp-alipay/runtime/api/protocols.js +++ b/src/platforms/mp-alipay/runtime/api/protocols.js @@ -1,19 +1,16 @@ // 不支持的 API 列表 const todos = [ - 'saveImageToPhotosAlbum', 'getRecorderManager', 'getBackgroundAudioManager', 'createInnerAudioContext', 'createVideoContext', 'createCameraContext', 'createLivePlayerContext', - 'openDocument', 'onMemoryWarning', 'startAccelerometer', 'startCompass', 'addPhoneContact', 'authorize', - 'chooseAddress', 'chooseInvoiceTitle', 'addTemplate', 'deleteTemplate', @@ -25,8 +22,7 @@ const todos = [ 'getExtConfig', 'getExtConfigSync', 'onWindowResize', - 'offWindowResize', - 'saveVideoToPhotosAlbum' + 'offWindowResize' ] // 存在兼容性的 API 列表 @@ -45,7 +41,11 @@ const canIUses = [ 'createIntersectionObserver', 'getUpdateManager', 'setBackgroundColor', - 'setBackgroundTextStyle' + 'setBackgroundTextStyle', + 'checkIsSupportSoterAuthentication', + 'startSoterAuthentication', + 'checkIsSoterEnrolledInDevice', + 'openDocument' ] function _handleNetworkInfo (result) { @@ -402,6 +402,29 @@ const protocols = { // 需要做转换的 API 列表 }, hideHomeButton: { name: 'hideBackHome' + }, + saveImageToPhotosAlbum: { + name: 'saveImage', + args: { + filePath: 'url' + } + }, + saveVideoToPhotosAlbum: { + args: { + filePath: 'src' + } + }, + chooseAddress: { + name: 'getAddress', + returnValue (result) { + let info = result.result || {} + result.userName = info.fullname + result.provinceName = info.prov + result.cityName = info.city + result.detailInfo = info.address + result.telNumber = info.mobilePhone + result.errMsg = result.resultStatus + } } } diff --git a/src/platforms/mp-qq/runtime/api/protocols.js b/src/platforms/mp-qq/runtime/api/protocols.js index b9c34d04..d050712c 100644 --- a/src/platforms/mp-qq/runtime/api/protocols.js +++ b/src/platforms/mp-qq/runtime/api/protocols.js @@ -3,11 +3,6 @@ export const protocols = { previewImage } export const todos = [ - 'createLivePlayerContext', - 'createLivePusherContext', - 'loadFontFace', - 'onMemoryWarning', - 'onNetworkStatusChange', 'startBeaconDiscovery', 'stopBeaconDiscovery', 'getBeacons', @@ -27,10 +22,7 @@ export const todos = [ 'setWifiList', 'onWifiConnected', 'getConnectedWifi', - 'setNavigationBarColor', 'setTopBarText', - 'getExtConfig', - 'getExtConfigSync', 'getPhoneNumber', 'chooseAddress', 'addCard', @@ -40,10 +32,7 @@ export const todos = [ 'chooseInvoiceTitle', 'checkIsSupportSoterAuthentication', 'startSoterAuthentication', - 'checkIsSoterEnrolledInDevice', - 'reportMonitor', - 'getLogManager', - 'reportAnalytics', + 'checkIsSoterEnrolledInDevice', 'vibrate' ] export const canIUses = [ @@ -69,5 +58,16 @@ export const canIUses = [ 'onSocketClose', 'openDocument', 'updateShareMenu', - 'getShareInfo' + 'getShareInfo', + 'createLivePlayerContext', + 'createLivePusherContext', + 'setNavigationBarColor', + 'loadFontFace', + 'onMemoryWarning', + 'onNetworkStatusChange', + 'getExtConfig', + 'getExtConfigSync', + 'reportMonitor', + 'getLogManager', + 'reportAnalytics' ] -- GitLab