diff --git a/src/platforms/mp-toutiao/runtime/api/protocols.js b/src/platforms/mp-toutiao/runtime/api/protocols.js index 205e4dc1cb997280c4e408fcfa6434432d851938..646d50659d1a5b7be950d311ee8cab2c95517ba7 100644 --- a/src/platforms/mp-toutiao/runtime/api/protocols.js +++ b/src/platforms/mp-toutiao/runtime/api/protocols.js @@ -2,22 +2,10 @@ import previewImage from '../../../mp-weixin/helpers/normalize-preview-image' // 不支持的 API 列表 const todos = [ - 'hideKeyboard', - 'onSocketOpen', - 'onSocketError', - 'sendSocketMessage', - 'onSocketMessage', - 'closeSocket', - 'onSocketClose', - 'getImageInfo', 'getBackgroundAudioManager', - 'createVideoContext', 'createCameraContext', 'createLivePlayerContext', - 'getSavedFileList', 'getSavedFileInfo', - 'removeSavedFile', - 'getFileInfo', 'openDocument', 'chooseLocation', 'createMapContext', @@ -66,7 +54,6 @@ const todos = [ 'hideTabBarRedDot', 'setBackgroundColor', 'setBackgroundTextStyle', - 'createIntersectionObserver', 'chooseInvoiceTitle', 'navigateToMiniProgram', 'navigateBackMiniProgram', @@ -77,14 +64,28 @@ const todos = [ 'getTemplateList', 'sendTemplateMessage', 'setEnableDebug', - 'getExtConfig', - 'getExtConfigSync', 'onWindowResize', 'offWindowResize' ] -// 存在兼容性的 API 列表 -const canIUses = [] +// 存在兼容性的 API 列表 +// 头条小程序不支持canIUses +const canIUses = [ + // 'createIntersectionObserver', + // 'getSavedFileList', + // 'removeSavedFile', + // 'hideKeyboard', + // 'getImageInfo', + // 'createVideoContext', + // 'onSocketOpen', + // 'onSocketError', + // 'sendSocketMessage', + // 'onSocketMessage', + // 'closeSocket', + // 'onSocketClose', + // 'getExtConfig', + // 'getExtConfigSync', +] // 需要做转换的 API 列表 const protocols = { @@ -101,7 +102,7 @@ const protocols = { }, chooseVideo: { args: { - maxDuration: false + camera: false } }, scanCode: { @@ -149,8 +150,15 @@ const protocols = { timeout: false } }, - requestPayment: { - orderInfo: 'data' + requestPayment: { + args: { + orderInfo: 'data' + } + }, + getFileInfo: { + args: { + digestAlgorithm: false + } } }