From 777a79f33825868f1f84fe96d00c14c662fd16a7 Mon Sep 17 00:00:00 2001 From: tianjiaxing Date: Thu, 7 Apr 2022 15:06:14 +0800 Subject: [PATCH] fix(weixin): protocol showActionSheet, title -> alertText --- packages/uni-mp-weixin/dist/index.js | 11 ++++++++++- src/platforms/mp-weixin/helpers/show-action-sheet.js | 7 +++++++ src/platforms/mp-weixin/runtime/api/protocols.js | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/platforms/mp-weixin/helpers/show-action-sheet.js diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 03aaa6030..ece486e09 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -579,6 +579,14 @@ var getSystemInfo = { } }; +var showActionSheet = { + args (fromArgs) { + if (typeof fromArgs === 'object') { + fromArgs.alertText = fromArgs.title; + } + } +}; + // import navigateTo from 'uni-helpers/navigate-to' const protocols = { @@ -586,7 +594,8 @@ const protocols = { // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP previewImage, getSystemInfo, - getSystemInfoSync: getSystemInfo + getSystemInfoSync: getSystemInfo, + showActionSheet }; const todos = [ 'vibrate', diff --git a/src/platforms/mp-weixin/helpers/show-action-sheet.js b/src/platforms/mp-weixin/helpers/show-action-sheet.js new file mode 100644 index 000000000..a5119c27a --- /dev/null +++ b/src/platforms/mp-weixin/helpers/show-action-sheet.js @@ -0,0 +1,7 @@ +export default { + args (fromArgs) { + if (typeof fromArgs === 'object') { + fromArgs.alertText = fromArgs.title + } + } +} diff --git a/src/platforms/mp-weixin/runtime/api/protocols.js b/src/platforms/mp-weixin/runtime/api/protocols.js index 247d57bc9..b9de8c722 100644 --- a/src/platforms/mp-weixin/runtime/api/protocols.js +++ b/src/platforms/mp-weixin/runtime/api/protocols.js @@ -2,13 +2,15 @@ import redirectTo from '../../helpers/redirect-to' import previewImage from '../../helpers/normalize-preview-image' import getSystemInfo from '../../helpers/system-info' +import showActionSheet from '../../helpers/show-action-sheet' export const protocols = { redirectTo, // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP previewImage, getSystemInfo, - getSystemInfoSync: getSystemInfo + getSystemInfoSync: getSystemInfo, + showActionSheet } export const todos = [ 'vibrate', -- GitLab