From bcf9ba9064386038d374ea4cb2a5003aa4f40d50 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 15 Aug 2019 21:37:53 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E5=A4=B4=E6=9D=A1?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8FAPI=E6=94=AF=E6=8C=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp-toutiao/service/api/protocols.js | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/src/platforms/mp-toutiao/service/api/protocols.js b/src/platforms/mp-toutiao/service/api/protocols.js index 205e4dc1c..63fa041e6 100644 --- a/src/platforms/mp-toutiao/service/api/protocols.js +++ b/src/platforms/mp-toutiao/service/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,30 @@ const todos = [ 'getTemplateList', 'sendTemplateMessage', 'setEnableDebug', - 'getExtConfig', - 'getExtConfigSync', 'onWindowResize', - 'offWindowResize' + 'offWindowResize', + 'compressImage', + 'createOffscreenCanvas' ] // 存在兼容性的 API 列表 -const canIUses = [] +// 头条小程序不支持canIUses +const canIUses = [ + // 'createIntersectionObserver', + // 'getSavedFileList', + // 'removeSavedFile', + // 'hideKeyboard', + // 'getImageInfo', + // 'createVideoContext', + // 'onSocketOpen', + // 'onSocketError', + // 'sendSocketMessage', + // 'onSocketMessage', + // 'closeSocket', + // 'onSocketClose', + // 'getExtConfig', + // 'getExtConfigSync', +] // 需要做转换的 API 列表 const protocols = { @@ -101,7 +104,7 @@ const protocols = { }, chooseVideo: { args: { - maxDuration: false + camera: false } }, scanCode: { @@ -150,7 +153,14 @@ const protocols = { } }, requestPayment: { - orderInfo: 'data' + args: { + orderInfo: 'data' + } + }, + getFileInfo: { + args: { + digestAlgorithm: false + } } } -- GitLab