index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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. <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
  8. <body>
  9. <div id="app"></div>
  10. <!-- built files will be auto injected -->
  11. </body>
  12. <script>
  13. (function() {
  14. if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
  15. handleFontSize();
  16. } else {
  17. if (document.addEventListener) {
  18. document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
  19. } else if (document.attachEvent) {
  20. document.attachEvent("WeixinJSBridgeReady", handleFontSize);
  21. document.attachEvent("onWeixinJSBridgeReady", handleFontSize); }
  22. }
  23. function handleFontSize() {
  24. // 设置网页字体为默认大小
  25. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
  26. // 重写设置网页字体大小的事件
  27. WeixinJSBridge.on('menu:setfont', function() {
  28. WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
  29. });
  30. }
  31. })();
  32. </script>
  33. </html>