index.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
  6. <title>U豆充值</title>
  7. <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  8. </head>
  9. <body>
  10. <div id="app"></div>
  11. <!-- built files will be auto injected -->
  12. </body>
  13. <script>
  14. (function() {
  15. if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
  16. handleFontSize();
  17. } else {
  18. if (document.addEventListener) {
  19. document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
  20. } else if (document.attachEvent) {
  21. document.attachEvent("WeixinJSBridgeReady", handleFontSize);
  22. document.attachEvent("onWeixinJSBridgeReady", handleFontSize); }
  23. }
  24. function handleFontSize() {
  25. // 设置网页字体为默认大小
  26. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
  27. // 重写设置网页字体大小的事件
  28. WeixinJSBridge.on('menu:setfont', function() {
  29. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
  30. });
  31. }
  32. })();
  33. </script>
  34. </html>