From 3ff9ad98c4e76fbdde2e93e1789c9af49a385f55 Mon Sep 17 00:00:00 2001 From: zjy Date: Fri, 26 Apr 2024 17:20:11 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=202.21.2=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E9=80=89=E6=8B=A9=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uview-ui/components/u-action-sheet/u-action-sheet.vue | 2 ++ uni_modules/uview-ui/components/u-button/u-button.vue | 5 +++++ uni_modules/uview-ui/libs/mixin/openType.js | 3 +++ 3 files changed, 10 insertions(+) diff --git a/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue b/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue index 26d5d8d9..11a1d1bb 100644 --- a/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue +++ b/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue @@ -47,6 +47,7 @@ @error="onError" @launchapp="onLaunchApp" @opensetting="onOpenSetting" + @chooseavatar="onChooseAvatar" :lang="lang" :session-from="sessionFrom" :send-message-title="sendMessageTitle" @@ -141,6 +142,7 @@ * @event {Function} error 当使用开放能力时,发生错误的回调,openType="error"时有效 * @event {Function} launchapp 打开 APP 成功的回调,openType="launchApp"时有效 * @event {Function} opensetting 在打开授权设置页后回调,openType="openSetting"时有效 + * @event {Function} chooseavatar 微信小程序 2.21.2 自定义头像选择事件 * @example */ export default { diff --git a/uni_modules/uview-ui/components/u-button/u-button.vue b/uni_modules/uview-ui/components/u-button/u-button.vue index d60f73e2..a718d1ab 100644 --- a/uni_modules/uview-ui/components/u-button/u-button.vue +++ b/uni_modules/uview-ui/components/u-button/u-button.vue @@ -20,6 +20,7 @@ @opensetting="opensetting" @launchapp="launchapp" @agreeprivacyauthorization="agreeprivacyauthorization" + @chooseavatar="chooseavatar" :hover-class="!disabled && !loading ? 'u-button--active' : ''" class="u-button u-reset-button" :style="[baseColor, $u.addStyle(customStyle)]" @@ -155,6 +156,7 @@ import props from "./props.js"; * @event {Function} opensetting 在打开授权设置页并关闭后回调 * @event {Function} launchapp 打开 APP 成功的回调 * @event {Function} agreeprivacyauthorization 用户同意隐私协议事件回调 + * @event {Function} chooseavatar 微信小程序 2.21.2 自定义头像选择事件 * @example 月落 */ export default { @@ -291,6 +293,9 @@ export default { agreeprivacyauthorization(res) { this.$emit("agreeprivacyauthorization", res); }, + chooseavatar(res) { + this.$emit("chooseavatar", res); + } }, }; diff --git a/uni_modules/uview-ui/libs/mixin/openType.js b/uni_modules/uview-ui/libs/mixin/openType.js index 45a3e34b..14feac74 100644 --- a/uni_modules/uview-ui/libs/mixin/openType.js +++ b/uni_modules/uview-ui/libs/mixin/openType.js @@ -20,6 +20,9 @@ export default { }, onOpenSetting(event) { this.$emit('opensetting', event.detail) + }, + onChooseAvatar(event) { + this.$emit('chooseavatar', event.detail) } } }