Showing
1 changed file
with
4 additions
and
1 deletions
@@ -990,7 +990,10 @@ $(function() { | @@ -990,7 +990,10 @@ $(function() { | ||
990 | getShopProductLinks(); | 990 | getShopProductLinks(); |
991 | 991 | ||
992 | // 小程序相关处理 | 992 | // 小程序相关处理 |
993 | - if (!window.WeixinJSBridge || !window.WeixinJSBridge.invoke) { | 993 | + if (navigator.userAgent.match(/MicroMessenger/i) && navigator.userAgent.match(/miniProgram/i)) { |
994 | + console.log('miniprogram'); | ||
995 | + miniProgramHandleInit(); | ||
996 | + } else if (!window.WeixinJSBridge || !window.WeixinJSBridge.invoke) { | ||
994 | document.addEventListener('WeixinJSBridgeReady', miniProgramHandleInit, false); | 997 | document.addEventListener('WeixinJSBridgeReady', miniProgramHandleInit, false); |
995 | } else { | 998 | } else { |
996 | miniProgramHandleInit(); | 999 | miniProgramHandleInit(); |
-
Please register or login to post a comment