swiper.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  8. <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  9. <META HTTP-EQUIV="Expires" CONTENT="0">
  10. <link rel="icon" href="/DataV/favicon.ico">
  11. <link rel="stylesheet" href="https://cdn.staticfile.org/Swiper/8.0.7/swiper-bundle.min.css">
  12. </link>
  13. <script src="https://cdn.staticfile.org/Swiper/8.0.7/swiper-bundle.min.js"></script>
  14. <script src="/DataV/cdn/vue/3.2.47/vue.global.min.js"></script>
  15. <title>JNPF数据大屏</title>
  16. <style>
  17. * {
  18. padding: 0;
  19. margin: 0;
  20. }
  21. body,
  22. html,
  23. #app {
  24. height: 100%;
  25. }
  26. html,
  27. body {
  28. position: relative;
  29. height: 100%;
  30. }
  31. .swiper,
  32. .swiper-wrapper,
  33. .swiper-slide {
  34. width: 100%;
  35. height: 100%;
  36. }
  37. .swiper-slide iframe {
  38. width: 100%;
  39. height: 100%;
  40. border: none
  41. }
  42. </style>
  43. <script>
  44. function GetQueryString(name) {
  45. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  46. var r = window.location.search.substr(1).match(reg);
  47. if (r != null) return unescape(r[2]); return null;
  48. }
  49. </script>
  50. </head>
  51. <body>
  52. <div id="app">
  53. <div class="swiper">
  54. <div class="swiper-wrapper">
  55. <div class="swiper-slide" v-for="(item,index) in list" :key="index">
  56. <iframe :src="`./view.html?id=${item}&token=${token}&isDev=${isDev}`" frameborder="0"></iframe>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="swiper-button-prev"></div>
  61. <div class="swiper-button-next"></div>
  62. </div>
  63. <script>
  64. var app = Vue.createApp({
  65. data() {
  66. return {
  67. id: GetQueryString('id'),
  68. token: GetQueryString('token'),
  69. isDev: GetQueryString('isDev'),
  70. list: [],
  71. }
  72. },
  73. created() {
  74. this.list = this.id.split(',')
  75. },
  76. mounted() {
  77. new Swiper('.swiper', {
  78. loop: true,
  79. autoplay: true,
  80. delay: 3000,
  81. navigation: {
  82. nextEl: '.swiper-button-next',
  83. prevEl: '.swiper-button-prev',
  84. }
  85. })
  86. }
  87. })
  88. app.mount('#app')
  89. </script>
  90. </body>
  91. </html>