diff --git a/common/js/dom-event-bridge.js b/common/js/dom-event-bridge.js index 31c1bb5..8b95ff1 100644 --- a/common/js/dom-event-bridge.js +++ b/common/js/dom-event-bridge.js @@ -112,7 +112,7 @@ class DomEventBridge { return !event.defaultPrevented // #endif - // #ifdef MP - WEIXIN + // #ifdef MP // 小程序环境不支持 DOM 事件 return true // #endif diff --git a/common/js/event-bus.js b/common/js/event-bus.js index df6b9d1..51ee3ed 100644 --- a/common/js/event-bus.js +++ b/common/js/event-bus.js @@ -29,6 +29,39 @@ class EventBus { return 'weapp' // #endif + // #ifdef MP-ALIPAY + return 'alipay' + // #endif + + // #ifdef MP-BAIDU + return 'baidu' + // #endif + + // #ifdef MP-TOUTIAO + return 'toutiao' + // #endif + + // #ifdef MP-QQ + return 'qq' + // #endif + + // #ifdef MP-KUAISHOU + return 'kuaishou' + // #endif + + // #ifdef MP-JD + return 'jd' + // #endif + + // #ifdef MP-360 + return '360' + // #endif + + // #ifdef MP-XHS + return 'xhs' + // #endif + + return 'unknown' } diff --git a/pages/index/public/js/index.js b/pages/index/public/js/index.js index 930104e..0d36dd6 100644 --- a/pages/index/public/js/index.js +++ b/pages/index/public/js/index.js @@ -21,8 +21,19 @@ export default { this.getFollowQrcode(); }, mounted() { - // 监听图片点击事件 - this.unsubscribe = this.$eventBus?.on('pictureTap', this._handleDiyGroupInteractionEvent); + // 监听图片、文字、商品列表等组件的点击事件 + this.unsubscribe = this.$eventBus?.onMany([ + 'rubik-cube-tap', + 'picture-tap', + 'text-tap', + 'goods-list-tap', + 'presale-tap', + 'notes-tap', + 'merch-list-tap', + 'map-tap', + 'img-ads-tap', + 'many-goods-list-tap' + ], this._handleDiyGroupInteractionEvent); }, beforeDestroy() { // 移除图片点击事件监听