index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="Home">
  3. <div class="one">
  4. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  5. <van-swipe-item v-for="item in topImg" :key="item.id">
  6. <img
  7. @click="skip(item.path)"
  8. class="topImg"
  9. :src="require(`@/assets/img/Layout/banner${item.id}.png`)"
  10. alt=""
  11. />
  12. </van-swipe-item>
  13. </van-swipe>
  14. </div>
  15. <div class="main">
  16. <div class="tow">
  17. <div class="towTop">
  18. <img src="../../assets/img/Layout/title.png" alt="" />
  19. <h3>Visit Info.</h3>
  20. </div>
  21. <div class="towTxt">
  22. <h3>Opening Hours 09:00-17:00</h3>
  23. <p>
  24. No admission after 16:00 <br />Closed on Mondays(Except for
  25. holidays)
  26. </p>
  27. </div>
  28. <div class="towTxt">
  29. <h3>Individual visitors:</h3>
  30. <p>+86 (10) 63393339</p>
  31. </div>
  32. <div class="towTxt">
  33. <h3>Group visitors:</h3>
  34. <p>+86 (10) 63370458</p>
  35. </div>
  36. <ul class="row">
  37. <li v-for="item in vData" :key="item.id" @click="skip(item.path)">
  38. <img :src="require(`@/assets/img/Layout/v${item.id}.png`)" alt="" />
  39. <p>{{ item.name }}</p>
  40. </li>
  41. </ul>
  42. </div>
  43. <div class="three">
  44. <div class="towTop">
  45. <img src="../../assets/img/Layout/title.png" alt="" />
  46. <h3>Partners & Connections</h3>
  47. </div>
  48. <ul class="row">
  49. <li v-for="(item, index) in link" :key="index">
  50. <a :href="item" target="_blank">
  51. <img
  52. :src="require(`@/assets/img/Layout/link${index + 1}.jpg`)"
  53. alt=""
  54. />
  55. </a>
  56. </li>
  57. </ul>
  58. <div class="more" @click="$router.push('/Layout/AboutLink')">
  59. See More
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. export default {
  67. name: "Home",
  68. components: {},
  69. data() {
  70. //这里存放数据
  71. return {
  72. topImg: [
  73. // { id: 1, path: "/Layout/Detail?id=1&k=3" },
  74. { id: 8, path: "/Layout/Detail?id=60&k=1" },
  75. { id: 7, path: "/Layout/Detail?id=11&k=2" },
  76. { id: 6, path: "/Layout/Detail?id=58&k=1" },
  77. { id: 2, path: "/Layout/Collections/Bronzes" },
  78. { id: 3, path: "/Layout/Detail?id=10&k=2" },
  79. { id: 4, path: "/Layout/Publications/Catalogues" },
  80. ],
  81. vData: [
  82. {
  83. id: 1,
  84. name: "Hours, Direction & Admission",
  85. path: "/Layout/Visit/1",
  86. },
  87. { id: 2, name: "Floor Plans", path: "/Layout/Visit/3" },
  88. { id: 3, name: "Audio Guide & Tour", path: "/Layout/Visit/4" },
  89. { id: 4, name: "Accessibility", path: "/Layout/Visit/5" },
  90. { id: 5, name: "Café & Shop", path: "/Layout/Visit/6" },
  91. { id: 6, name: "Visitor Guidelines", path: "/Layout/Visit/7" },
  92. ],
  93. link: [
  94. "http://www.edo-tokyo-museum.or.jp/en/",
  95. "https://en.shm.ru/",
  96. "https://www.rom.on.ca/en",
  97. "https://museum.seoul.go.kr/eng/index.do",
  98. "https://museumsvictoria.com.au/",
  99. "https://www.vmfa.museum/",
  100. ],
  101. };
  102. },
  103. //监听属性 类似于data概念
  104. computed: {},
  105. //监控data中的数据变化
  106. watch: {},
  107. //方法集合
  108. methods: {
  109. skip(path) {
  110. this.$router.push(path).catch(() => {});
  111. },
  112. },
  113. //生命周期 - 创建完成(可以访问当前this实例)
  114. created() {},
  115. //生命周期 - 挂载完成(可以访问DOM元素)
  116. mounted() {},
  117. beforeCreate() {}, //生命周期 - 创建之前
  118. beforeMount() {}, //生命周期 - 挂载之前
  119. beforeUpdate() {}, //生命周期 - 更新之前
  120. updated() {}, //生命周期 - 更新之后
  121. beforeDestroy() {}, //生命周期 - 销毁之前
  122. destroyed() {}, //生命周期 - 销毁完成
  123. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  124. };
  125. </script>
  126. <style lang="less" scoped>
  127. .Home {
  128. width: 100%;
  129. // padding-top: 50px;
  130. .one {
  131. width: 100%;
  132. .my-swipe {
  133. width: 100%;
  134. .topImg {
  135. width: 100%;
  136. }
  137. }
  138. }
  139. .main {
  140. padding: 0 15px;
  141. padding-bottom: 40px;
  142. background: url("../../assets/img/Layout/bg.png");
  143. background-size: 100% 100%;
  144. .towTop {
  145. display: flex;
  146. align-items: center;
  147. margin-bottom: 24px;
  148. & > img {
  149. width: 41px;
  150. height: 29px;
  151. margin-right: 20px;
  152. }
  153. & > h3 {
  154. color: #c1aa7b;
  155. font-size: 22px;
  156. }
  157. }
  158. .tow {
  159. padding: 40px 0;
  160. border-bottom: 1px solid #ccc;
  161. .towTxt {
  162. padding: 0 0px 0 61px;
  163. margin-bottom: 24px;
  164. & > h3 {
  165. font-weight: 400;
  166. color: #bc1c24;
  167. font-size: 18px;
  168. margin-bottom: 5px;
  169. }
  170. & > p {
  171. color: #6a6a6a;
  172. font-size: 14px;
  173. line-height: 16px;
  174. }
  175. }
  176. .row {
  177. display: flex;
  178. flex-wrap: wrap;
  179. justify-content: space-between;
  180. & > li {
  181. padding-top: 5px;
  182. background: url("../../assets/img/Layout/frame.png");
  183. background-size: 100% 100%;
  184. width: 161px;
  185. height: 70px;
  186. text-align: center;
  187. margin-bottom: 10px;
  188. color: #c1aa7b;
  189. &:nth-of-type(1) {
  190. color: #bc1c24;
  191. }
  192. & > p {
  193. font-family: "Franklin Gothic Medium", "Arial Narrow", Arial,
  194. sans-serif;
  195. font-size: 12px;
  196. line-height: 12px;
  197. text-align: center;
  198. }
  199. }
  200. }
  201. }
  202. .three {
  203. border-bottom: 1px solid #ccc;
  204. padding: 40px 0;
  205. .row {
  206. display: flex;
  207. flex-wrap: wrap;
  208. justify-content: space-between;
  209. & > li {
  210. width: 168px;
  211. height: 62px;
  212. margin-bottom: 10px;
  213. & > a {
  214. display: block;
  215. width: 100%;
  216. height: 100%;
  217. & > img {
  218. width: 100%;
  219. }
  220. }
  221. }
  222. }
  223. .more {
  224. margin: 20px auto 0;
  225. width: 117px;
  226. height: 37px;
  227. background: url("../../assets/img/Layout/see.png");
  228. background-size: 100% 100%;
  229. color: #c1aa7b;
  230. line-height: 40px;
  231. text-align: center;
  232. }
  233. }
  234. }
  235. }
  236. @media screen and (max-width: 370px) {
  237. .main {
  238. padding: 0 8px 40px !important;
  239. }
  240. .row {
  241. display: block !important;
  242. & > li {
  243. margin: 0 auto 10px !important;
  244. }
  245. }
  246. }
  247. </style>