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)
}
}
}