index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <template>
  2. <div class="Collections">
  3. <div
  4. class="banWrapper"
  5. data-aria-viewport-area
  6. tabindex="0"
  7. aria-label
  8. aria-description="You've reached the banner area of the Collections section; this section has one image; please use the tab key to go through the content."
  9. >
  10. <div
  11. class="ban aria-theme-independent"
  12. tabindex="0"
  13. aria-label="Image"
  14. aria-description="Colections"
  15. ></div>
  16. </div>
  17. <!-- 面包屑 -->
  18. <div
  19. class="pos"
  20. data-aria-viewport-area
  21. tabindex="0"
  22. aria-label
  23. aria-description="You've reached the path area; this area has three URLs; use the tab key to go through the content."
  24. >
  25. <span class="pos1" tabindex="0">Your Position:&nbsp;</span>
  26. <Router-link replace to="/Layout/Home" tabindex="0" aria-description="Home">
  27. Home>
  28. </Router-link>
  29. <Router-link
  30. replace
  31. to="/Layout/Collections/Bronzes"
  32. tabindex="0"
  33. aria-description="Collections"
  34. >
  35. Collections>
  36. </Router-link>
  37. <Router-link replace to="" tabindex="0" :aria-description="mbTxt">
  38. {{ mbTxt }}>
  39. </Router-link>
  40. </div>
  41. <!-- 内容 -->
  42. <div class="conten" :class="mbTxt">
  43. <ul
  44. data-aria-viewport-area
  45. tabindex="0"
  46. aria-label
  47. aria-description="You've reached the collection category menu, please use the tab key to navigate through the menu."
  48. >
  49. <li
  50. @click="cutTab(item.url)"
  51. @keydown.enter.passive="cutTab(item.url)"
  52. :class="{
  53. active: mbTxt === item.url,
  54. }"
  55. v-for="(item, index) in tabData"
  56. :key="item.name"
  57. :style="`background-image:url(/data/Collections/tab/${
  58. index + 1
  59. }.png)`"
  60. tabindex="0"
  61. aria-label="Link"
  62. >
  63. <div
  64. class="bac"
  65. :class="{
  66. 'aria-inverse-theme': mbTxt === item.url,
  67. }"
  68. >
  69. {{ item.name }}
  70. </div>
  71. </li>
  72. </ul>
  73. <!-- 右侧内容 -->
  74. <div
  75. class="right"
  76. data-aria-viewport-area
  77. tabindex="0"
  78. aria-label
  79. aria-description="You've reached the tiles of ${keyword}, please use the tab key to go through the tiles."
  80. >
  81. <div
  82. class="row"
  83. v-for="(item, index) in data"
  84. :key="item.id"
  85. @click="lookBig(item)"
  86. @keydown.enter.passive="lookBig(item)"
  87. >
  88. <img
  89. class="rowImg"
  90. :src="`/data/Collections/${mbTxt}/${index + 1}.png`"
  91. :alt="item.h3.replace(/(<([^>]+)>)/gi, '')"
  92. tabindex="0"
  93. aria-label="Image link"
  94. :aria-description="item.h3.replace(/(<([^>]+)>)/gi, '')"
  95. />
  96. <div class="info">
  97. <!-- 箭头 -->
  98. <img v-if="themeIdx === 0" src="/data/Collections/arrow.png" alt="" />
  99. <img v-if="themeIdx === 1" src="/data/Collections/arrow-white.svg" alt="" />
  100. <img v-if="themeIdx === 2" src="/data/Collections/arrow-blue.svg" alt="" />
  101. <img v-if="themeIdx === 3" src="/data/Collections/arrow-yellow.svg" alt="" />
  102. <img v-if="themeIdx === 4" src="/data/Collections/arrow-black.svg" alt="" />
  103. <h3
  104. v-html="item.h3"
  105. tabindex="0"
  106. aria-label="Link"
  107. :aria-description="item.h3.replace(/(<([^>]+)>)/gi, '')"
  108. ></h3>
  109. <p
  110. v-html="item.p"
  111. tabindex="0"
  112. aria-label="Link"
  113. :aria-description="item.p.replace(/(<([^>]+)>)/gi, '')"
  114. ></p>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- 查看详情组件 -->
  120. <CollectionsInfo v-if="isShow" :isShow.sync="isShow" :infoObj="infoObj" />
  121. </div>
  122. </template>
  123. <script>
  124. import CollectionsInfo from "./component/info.vue";
  125. import { Collections } from "@/views/dataAll.js";
  126. import accessibilityMixin from "/src/views/accessibilityMixin.js"
  127. export default {
  128. name: "Collections",
  129. components: { CollectionsInfo },
  130. mixins: [accessibilityMixin],
  131. data() {
  132. //这里存放数据
  133. return {
  134. // 点击单个查看图片
  135. isShow: false,
  136. infoObj: {},
  137. // ---------
  138. data: [],
  139. mbTxt: "Bronzes",
  140. tabData: [
  141. { name: "Bronzes", url: "Bronzes" },
  142. { name: "Ceramics", url: "Ceramics" },
  143. { name: "Buddhist Statues", url: "Buddhist" },
  144. { name: "Jadewares", url: "Jadewares" },
  145. { name: "Calligraphies", url: "Calligraphies" },
  146. { name: "Paintings", url: "Paintings" },
  147. { name: "Gold & Silverwares", url: "Gold" },
  148. { name: "Coins & Banknotes", url: "Coins" },
  149. { name: "Brocades & Embroideries", url: "Brocades" },
  150. { name: "Cultural Supplies", url: "Cultural" },
  151. { name: "Miscellaneous", url: "Miscellaneous" },
  152. ],
  153. };
  154. },
  155. //监听属性 类似于data概念
  156. computed: {},
  157. //监控data中的数据变化
  158. watch: {
  159. // 监听地址栏参数变化
  160. $route: {
  161. handler() {
  162. // 拿到路由参数id
  163. let temp = this.$route.params.id;
  164. this.mbTxt = temp;
  165. this.data = Collections[this.mbTxt];
  166. let keyword = "";
  167. switch (this.mbTxt) {
  168. case "Bronzes":
  169. keyword = "Bronzes";
  170. break;
  171. case "Ceramics":
  172. keyword = "Ceramics";
  173. break;
  174. case "Buddhist":
  175. keyword = "buddhist statues";
  176. break;
  177. case "Jadewares":
  178. keyword = "Jadewares";
  179. break;
  180. case "Calligraphies":
  181. keyword = "Calligraphies";
  182. break;
  183. case "Paintings":
  184. keyword = "Paintings";
  185. break;
  186. case "Gold":
  187. keyword = "gold & silverwares";
  188. break;
  189. case "Coins":
  190. keyword = "coins & banknotes";
  191. break;
  192. case "Brocades":
  193. keyword = "brocades & embroideries";
  194. break;
  195. case "Cultural":
  196. keyword = "cultural supplies";
  197. break;
  198. case "Miscellaneous":
  199. keyword = "miscellaneous arts";
  200. break;
  201. default:
  202. break;
  203. }
  204. this.$eventBus.$emit(
  205. "request-read",
  206. `You've reached the page contains tiles of ${keyword} of the Collections section. This page contains one navigation section, six window sections, and one interactive section. To choose a section, please hit the shortcut key.`
  207. );
  208. },
  209. immediate: true,
  210. },
  211. },
  212. //方法集合
  213. methods: {
  214. // 点击单个查看图片
  215. lookBig(item) {
  216. this.infoObj = item;
  217. this.isShow = true;
  218. this.$nextTick(() => {
  219. // 获取body,防止滚动
  220. let body = document.querySelector("body");
  221. body.style.overflow = "hidden";
  222. });
  223. },
  224. cutTab(path) {
  225. this.$router.push(`/Layout/Collections/${path}`).catch(() => {});
  226. },
  227. },
  228. //生命周期 - 创建完成(可以访问当前this实例)
  229. created() {},
  230. //生命周期 - 挂载完成(可以访问DOM元素)
  231. mounted() {},
  232. beforeCreate() {}, //生命周期 - 创建之前
  233. beforeMount() {}, //生命周期 - 挂载之前
  234. beforeUpdate() {}, //生命周期 - 更新之前
  235. updated() {}, //生命周期 - 更新之后
  236. beforeDestroy() {}, //生命周期 - 销毁之前
  237. destroyed() {}, //生命周期 - 销毁完成
  238. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  239. };
  240. </script>
  241. <style lang='less' scoped>
  242. .Collections {
  243. background-color: #fff;
  244. .ban {
  245. width: 100%;
  246. margin: auto;
  247. background: url("/data/Collections/banner.jpg") no-repeat center top #000000;
  248. height: 300px;
  249. }
  250. .pos {
  251. height: 28px;
  252. line-height: 28px;
  253. font-size: 12px;
  254. margin: 0 auto 10px auto;
  255. width: 1180px;
  256. .pos1 {
  257. color: #c20e11;
  258. }
  259. }
  260. .conten {
  261. display: flex;
  262. width: 1200px;
  263. overflow: hidden;
  264. margin: 0 auto;
  265. padding-bottom: 20px;
  266. zoom: 1;
  267. & > ul {
  268. width: 210px;
  269. & > li {
  270. cursor: pointer;
  271. width: 210px;
  272. height: 48px;
  273. position: relative;
  274. background: #181818 no-repeat right center;
  275. border-bottom: 1px solid #fff;
  276. .bac {
  277. text-indent: 10px;
  278. font-size: 14px;
  279. color: #fff;
  280. line-height: 48px;
  281. z-index: 10;
  282. position: absolute;
  283. top: 0;
  284. left: 0;
  285. width: 100%;
  286. height: 100%;
  287. }
  288. &:hover {
  289. .bac {
  290. background-color: rgba(254, 24, 24, 0.7);
  291. }
  292. }
  293. }
  294. .active {
  295. .bac {
  296. background-color: rgba(254, 24, 24, 0.7);
  297. }
  298. }
  299. }
  300. .right {
  301. border-left: 1px solid #d8d8d8;
  302. flex: 1;
  303. margin-left: 10px;
  304. padding-left: 10px;
  305. position: relative;
  306. .row {
  307. top: 10px;
  308. left: 10px;
  309. position: absolute;
  310. width: 310px;
  311. .rowImg {
  312. width: 310px;
  313. // height: 400px;
  314. vertical-align: middle;
  315. }
  316. .info {
  317. position: relative;
  318. padding: 20px 15px;
  319. & > img {
  320. opacity: 0;
  321. position: absolute;
  322. top: -30px;
  323. left: 30px;
  324. }
  325. h3 {
  326. font-size: 18px;
  327. color: #262626;
  328. line-height: 22px;
  329. padding-bottom: 5px;
  330. font-weight: 700;
  331. /deep/i {
  332. font-style: italic;
  333. }
  334. /deep/.smImg {
  335. width: 41px;
  336. height: 32px;
  337. }
  338. }
  339. p {
  340. font-size: 14px;
  341. color: #626262;
  342. /deep/ i {
  343. font-style: italic;
  344. }
  345. }
  346. }
  347. &:hover {
  348. box-shadow: 0 0 10px #000;
  349. .info {
  350. background-color: #ca000a;
  351. & > img {
  352. opacity: 1;
  353. }
  354. h3 {
  355. color: #fff;
  356. }
  357. p {
  358. color: #fff;
  359. /deep/ i {
  360. font-style: italic;
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. // 第一个页面
  369. .conten {
  370. height: 5291px;
  371. .row {
  372. &:nth-of-type(2) {
  373. left: 330px;
  374. }
  375. &:nth-of-type(3) {
  376. left: 650px;
  377. }
  378. &:nth-of-type(4) {
  379. left: 330px;
  380. top: 369px;
  381. }
  382. &:nth-of-type(5) {
  383. left: 650px;
  384. top: 589px;
  385. }
  386. &:nth-of-type(6) {
  387. top: 609px;
  388. }
  389. &:nth-of-type(7) {
  390. left: 330px;
  391. top: 948px;
  392. }
  393. &:nth-of-type(8) {
  394. left: 650px;
  395. top: 968px;
  396. }
  397. &:nth-of-type(9) {
  398. top: 1166px;
  399. }
  400. &:nth-of-type(10) {
  401. left: 650px;
  402. top: 1325px;
  403. }
  404. &:nth-of-type(11) {
  405. left: 330px;
  406. top: 1507px;
  407. }
  408. &:nth-of-type(12) {
  409. left: 650px;
  410. top: 1724px;
  411. }
  412. &:nth-of-type(13) {
  413. top: 1747px;
  414. }
  415. &:nth-of-type(14) {
  416. left: 330px;
  417. top: 1846px;
  418. }
  419. &:nth-of-type(15) {
  420. left: 330px;
  421. top: 2183px;
  422. }
  423. &:nth-of-type(16) {
  424. left: 650px;
  425. top: 2269px;
  426. }
  427. &:nth-of-type(17) {
  428. top: 2328px;
  429. }
  430. &:nth-of-type(18) {
  431. left: 330px;
  432. top: 2762px;
  433. }
  434. &:nth-of-type(19) {
  435. left: 650px;
  436. top: 2848px;
  437. }
  438. &:nth-of-type(20) {
  439. top: 2887px;
  440. }
  441. &:nth-of-type(21) {
  442. top: 3242px;
  443. }
  444. &:nth-of-type(22) {
  445. left: 330px;
  446. top: 3321px;
  447. }
  448. &:nth-of-type(23) {
  449. left: 650px;
  450. top: 3427px;
  451. }
  452. &:nth-of-type(24) {
  453. top: 3601px;
  454. }
  455. &:nth-of-type(25) {
  456. left: 330px;
  457. top: 3680px;
  458. }
  459. &:nth-of-type(26) {
  460. left: 650px;
  461. top: 3966px;
  462. }
  463. &:nth-of-type(27) {
  464. top: 3980px;
  465. }
  466. &:nth-of-type(28) {
  467. left: 330px;
  468. top: 4101px;
  469. }
  470. &:nth-of-type(29) {
  471. left: 650px;
  472. top: 4365px;
  473. }
  474. &:nth-of-type(30) {
  475. top: 4559px;
  476. }
  477. &:nth-of-type(31) {
  478. left: 330px;
  479. top: 4680px;
  480. }
  481. &:nth-of-type(32) {
  482. left: 650px;
  483. top: 4742px;
  484. }
  485. }
  486. }
  487. .Ceramics {
  488. height: 1603px;
  489. .row {
  490. &:nth-of-type(4) {
  491. top: 411px;
  492. }
  493. &:nth-of-type(7) {
  494. left: 650px;
  495. top: 990px;
  496. }
  497. &:nth-of-type(8) {
  498. left: 330px;
  499. top: 1054px;
  500. }
  501. }
  502. }
  503. .Buddhist {
  504. height: 1870px;
  505. .row {
  506. &:nth-of-type(4) {
  507. top: 347px;
  508. }
  509. &:nth-of-type(5) {
  510. top: 587px;
  511. }
  512. &:nth-of-type(6) {
  513. top: 653px;
  514. }
  515. &:nth-of-type(7) {
  516. top: 944px;
  517. }
  518. &:nth-of-type(8) {
  519. top: 1146px;
  520. }
  521. &:nth-of-type(9) {
  522. top: 1252px;
  523. }
  524. }
  525. }
  526. .Jadewares {
  527. height: 1405px;
  528. .row {
  529. &:nth-of-type(4) {
  530. left: 650px;
  531. top: 382px;
  532. }
  533. &:nth-of-type(5) {
  534. left: 10px;
  535. top: 422px;
  536. }
  537. &:nth-of-type(6) {
  538. left: 330px;
  539. top: 582px;
  540. }
  541. &:nth-of-type(7) {
  542. left: 650px;
  543. top: 732px;
  544. }
  545. &:nth-of-type(8) {
  546. left: 10px;
  547. top: 996px;
  548. }
  549. }
  550. }
  551. .Calligraphies {
  552. height: 2314px;
  553. .row {
  554. &:nth-of-type(4) {
  555. left: 650px;
  556. top: 367px;
  557. }
  558. &:nth-of-type(5) {
  559. left: 10px;
  560. top: 429px;
  561. }
  562. &:nth-of-type(6) {
  563. left: 330px;
  564. top: 609px;
  565. }
  566. &:nth-of-type(7) {
  567. left: 650px;
  568. top: 744px;
  569. }
  570. &:nth-of-type(8) {
  571. left: 10px;
  572. top: 808px;
  573. }
  574. &:nth-of-type(9) {
  575. left: 650px;
  576. top: 1123px;
  577. }
  578. &:nth-of-type(10) {
  579. left: 330px;
  580. top: 1228px;
  581. }
  582. &:nth-of-type(11) {
  583. left: 10px;
  584. top: 1458px;
  585. }
  586. &:nth-of-type(12) {
  587. left: 650px;
  588. top: 1779px;
  589. }
  590. &:nth-of-type(13) {
  591. left: 330px;
  592. top: 1807px;
  593. }
  594. }
  595. }
  596. .Paintings {
  597. height: 2448px;
  598. .row {
  599. &:nth-of-type(4) {
  600. left: 330px;
  601. top: 367px;
  602. }
  603. &:nth-of-type(5) {
  604. left: 10px;
  605. top: 567px;
  606. }
  607. &:nth-of-type(6) {
  608. left: 650px;
  609. top: 589px;
  610. }
  611. &:nth-of-type(7) {
  612. left: 10px;
  613. top: 889px;
  614. }
  615. &:nth-of-type(8) {
  616. left: 650px;
  617. top: 926px;
  618. }
  619. &:nth-of-type(9) {
  620. left: 330px;
  621. top: 966px;
  622. }
  623. &:nth-of-type(10) {
  624. left: 330px;
  625. top: 1323px;
  626. }
  627. &:nth-of-type(11) {
  628. left: 10px;
  629. top: 1486px;
  630. }
  631. &:nth-of-type(12) {
  632. left: 650px;
  633. top: 1503px;
  634. }
  635. &:nth-of-type(13) {
  636. left: 330px;
  637. top: 1829px;
  638. }
  639. &:nth-of-type(14) {
  640. left: 10px;
  641. top: 1845px;
  642. }
  643. }
  644. }
  645. .Gold {
  646. height: 1652px;
  647. .row {
  648. &:nth-of-type(4) {
  649. left: 330px;
  650. top: 367px;
  651. }
  652. &:nth-of-type(5) {
  653. left: 650px;
  654. top: 369px;
  655. }
  656. &:nth-of-type(6) {
  657. left: 10px;
  658. top: 598px;
  659. }
  660. &:nth-of-type(7) {
  661. left: 330px;
  662. top: 746px;
  663. }
  664. &:nth-of-type(8) {
  665. left: 650px;
  666. top: 769px;
  667. }
  668. &:nth-of-type(9) {
  669. left: 650px;
  670. top: 1109px;
  671. }
  672. &:nth-of-type(10) {
  673. left: 330px;
  674. top: 1128px;
  675. }
  676. }
  677. }
  678. .Coins {
  679. height: 2093px;
  680. .row {
  681. &:nth-of-type(4) {
  682. left: 330px;
  683. top: 411px;
  684. }
  685. &:nth-of-type(5) {
  686. left: 10px;
  687. top: 569px;
  688. }
  689. &:nth-of-type(6) {
  690. left: 650px;
  691. top: 611px;
  692. }
  693. &:nth-of-type(7) {
  694. left: 330px;
  695. top: 839px;
  696. }
  697. &:nth-of-type(8) {
  698. left: 10px;
  699. top: 1128px;
  700. }
  701. &:nth-of-type(9) {
  702. left: 650px;
  703. top: 1221px;
  704. }
  705. &:nth-of-type(10) {
  706. left: 330px;
  707. top: 1396px;
  708. }
  709. &:nth-of-type(11) {
  710. left: 10px;
  711. top: 1527px;
  712. }
  713. &:nth-of-type(12) {
  714. left: 650px;
  715. top: 1607px;
  716. }
  717. }
  718. }
  719. .Brocades {
  720. height: 1512px;
  721. .row {
  722. &:nth-of-type(4) {
  723. left: 10px;
  724. top: 409px;
  725. }
  726. &:nth-of-type(5) {
  727. left: 330px;
  728. top: 409px;
  729. }
  730. &:nth-of-type(6) {
  731. left: 650px;
  732. top: 568px;
  733. }
  734. &:nth-of-type(7) {
  735. left: 650px;
  736. top: 945px;
  737. }
  738. &:nth-of-type(8) {
  739. left: 10px;
  740. top: 1027px;
  741. }
  742. }
  743. }
  744. .Cultural {
  745. height: 1451px;
  746. .row {
  747. &:nth-of-type(4) {
  748. left: 650px;
  749. top: 414px;
  750. }
  751. &:nth-of-type(5) {
  752. left: 330px;
  753. top: 563px;
  754. }
  755. &:nth-of-type(6) {
  756. left: 10px;
  757. top: 578px;
  758. }
  759. &:nth-of-type(7) {
  760. left: 650px;
  761. top: 875px;
  762. }
  763. &:nth-of-type(8) {
  764. left: 330px;
  765. top: 930px;
  766. }
  767. }
  768. }
  769. .Miscellaneous {
  770. height: 641px;
  771. }
  772. }
  773. </style>