Model2D.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <script src="./info.js"></script>
  7. <script>
  8. document.title = titleInfo;
  9. </script>
  10. <script src="./js/vue.min.js"></script>
  11. <!-- Swiper JS -->
  12. <script src="./js/swiper-bundle.min.js"></script>
  13. <link rel="stylesheet" href="./css/swiper-bundle.min.css" />
  14. <style>
  15. html,
  16. body {
  17. position: relative;
  18. height: 100%;
  19. }
  20. #app {
  21. width: 100%;
  22. height: 100%;
  23. background: #eee;
  24. font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  25. font-size: 14px;
  26. color: #000;
  27. margin: 0;
  28. padding: 0;
  29. }
  30. body {
  31. background: #eee;
  32. font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  33. font-size: 14px;
  34. color: #000;
  35. margin: 0;
  36. padding: 0;
  37. }
  38. .swiper {
  39. width: 100%;
  40. height: 100%;
  41. }
  42. .swiper-slide {
  43. text-align: center;
  44. font-size: 18px;
  45. background: #fff;
  46. /* Center slide text vertically */
  47. display: -webkit-box;
  48. display: -ms-flexbox;
  49. display: -webkit-flex;
  50. display: flex;
  51. -webkit-box-pack: center;
  52. -ms-flex-pack: center;
  53. -webkit-justify-content: center;
  54. justify-content: center;
  55. -webkit-box-align: center;
  56. -ms-flex-align: center;
  57. -webkit-align-items: center;
  58. align-items: center;
  59. }
  60. .swiper-slide img {
  61. display: block;
  62. /* width: 100%; */
  63. height: 100%;
  64. /* object-fit: cover; */
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div id="app">
  70. <div class="swiper mySwiper">
  71. <div class="swiper-wrapper">
  72. <div class="swiper-slide">
  73. <img :src="`./images/${number}.jpg`" alt="" />
  74. </div>
  75. </div>
  76. <!-- <div class="swiper-button-next"></div>
  77. <div class="swiper-button-prev"></div> -->
  78. <div class="swiper-pagination"></div>
  79. </div>
  80. </div>
  81. <script>
  82. var app = new Vue({
  83. el: "#app",
  84. data() {
  85. return {
  86. title: "2d",
  87. number: 0,
  88. name: "",
  89. };
  90. },
  91. mounted() {},
  92. created() {
  93. var mySwiper = new Swiper(".swiper", {
  94. direction: "vertical", // 垂直切换选项
  95. loop: true, // 循环模式选项
  96. // 如果需要分页器
  97. pagination: {
  98. el: ".swiper-pagination",
  99. },
  100. // 如果需要前进后退按钮
  101. // navigation: {
  102. // nextEl: ".swiper-button-next",
  103. // prevEl: ".swiper-button-prev",
  104. // },
  105. });
  106. // 创建一个URLSearchParams对象
  107. let params = new URLSearchParams(window.location.search);
  108. // 获取参数值
  109. let paramValue = params.get("m");
  110. this.number = paramValue;
  111. this.name = objInfo2d[paramValue];
  112. console.log(objInfo2d[paramValue], this.number);
  113. },
  114. });
  115. </script>
  116. </body>
  117. </html>