temp3.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <title>yyyy</title>
  7. <script src="https://cdn.jsdelivr.net/npm/vue"></script>
  8. </head>
  9. <body>
  10. <style>
  11. .promptBox {
  12. position: fixed;
  13. top: 0;
  14. left: 0;
  15. right: 0;
  16. bottom: 0;
  17. background-color: rgba(0, 0, 0, .3);
  18. display: -webkit-box;
  19. display: -ms-flexbox;
  20. display: flex;
  21. }
  22. .promptBox .wrap {
  23. margin: auto;
  24. background-color: #fff;
  25. width: 6.6rem;
  26. text-align: center;
  27. padding-bottom: .3rem;
  28. border-radius: .08rem;
  29. overflow: hidden;
  30. }
  31. .p-weak-subscribe {
  32. position: relative;
  33. }
  34. .p-weak-subscribe .head.head {
  35. font-size: .36rem;
  36. color: #32a1ff;
  37. font-weight: 700;
  38. }
  39. .promptBox .head {
  40. height: 1rem;
  41. line-height: 1rem;
  42. font-size: .32rem;
  43. border-bottom: 1px solid #e5e5e5;
  44. }
  45. .promptBox .body {
  46. font-size: .32rem;
  47. padding: .3rem;
  48. }
  49. .p-weak-subscribe img {
  50. height: 4rem;
  51. width: 4rem;
  52. margin: .3rem auto;
  53. display: block;
  54. }
  55. </style>
  56. <div id="app">
  57. </div>
  58. <script type="text/javascript">
  59. function refreshRem() {
  60. document.documentElement.style.fontSize = (Math.min(window.innerWidth, screen.width, document.body.offsetWidth) / 750) * 100 + 'px';
  61. }
  62. window.addEventListener('resize', function () {
  63. clearTimeout(tid);
  64. tid = setTimeout(refreshRem, 300);
  65. }, false);
  66. window.addEventListener('pageshow', function (e) {
  67. if (e.persisted) {
  68. clearTimeout(tid);
  69. tid = setTimeout(refreshRem, 300);
  70. }
  71. }, false);
  72. var tid;
  73. refreshRem()
  74. new Vue({
  75. el: '#app',
  76. template: `<div class="promptBox">
  77. <div class="wrap">
  78. <div class="p-weak-subscribe">
  79. <div class="head">温馨提示</div>
  80. <div class="body">
  81. <p>关注作者授权公众号继续阅读</p>
  82. <p>更多精彩内容等你哟~</p>
  83. <div style="position: relative; height: auto;">
  84. <img class="img" src="">
  85. </div>
  86. <p>长按上图识别二维码关注</p>
  87. </div>
  88. <div class="close"></div>
  89. </div>
  90. </div>
  91. </div>`
  92. })
  93. function noop() { }
  94. document.querySelector('.promptBox').addEventListener('click', noop)
  95. document.querySelector('.promptBox').addEventListener('touchmove', function (e) {
  96. e.preventDefault()
  97. })
  98. document.querySelector('.wrap').addEventListener('click', noop)
  99. setTimeout(() => {
  100. document.querySelector('.img').src = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQEC8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyZjJQTk5RMWFld2sxTUJNb05xY1UAAgQlo7BaAwQAjScA"
  101. }, 1000);
  102. </script>
  103. </body>
  104. </html>