AllPages.vue 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div class="index-box">
  3. <img src="../../public/fourBoxes-image/1.jpg" class="bg-image" />
  4. <div class="index-FourBoxes">
  5. <div class="index-FourBoxes-yushi test" :class="{ active: currentItem === 0 }" @click="goPagess(0)">
  6. <img src="../../public/fourBoxes-image/浴室.png" class="Four-image" @transitionend="handleTransitionEnd('yushi')" />
  7. <div style=" width: 21vw; position: absolute; left: 13.5vw; top: 36vh;">
  8. <img style=" width:100%;" src="../assets/fourBoxes-2/浴室-2.png" />
  9. </div>
  10. </div>
  11. <div class="index-FourBoxes-yimao test" :class="{ active: currentItem === 1 }" @click="goPagess(1)">
  12. <img src="../../public/fourBoxes-image/衣帽间.png" class="Four-image" @transitionend="handleTransitionEnd('yimao')" />
  13. <div style=" width: 21vw;; position: absolute; right: 13.5vw; top: 36vh;">
  14. <img style=" width:100%;" src="../assets/fourBoxes-2/衣帽间-2.png" />
  15. </div>
  16. </div>
  17. <div class="index-FourBoxes-keting test" :class="{ active: currentItem === 2 }" @click="goPagess(2)">
  18. <img src="../../public/fourBoxes-image/客厅.png" @transitionend="handleTransitionEnd('keting')" class="Four-image" />
  19. <div style=" width: 21vw;; position: absolute; left: 13.5vw; top: 77vh;">
  20. <img style=" width:100%;" src="../assets/fourBoxes-2/客厅-2.png" />
  21. </div>
  22. </div>
  23. <div class="index-FourBoxes-yangtai test" :class="{ active: currentItem === 3 }" @click="goPagess(3)">
  24. <img src="../../public/fourBoxes-image/阳台.png" @transitionend="handleTransitionEnd('yangtai')" class="Four-image" />
  25. <div style=" width: 21vw;; position: absolute; right: 13.5vw; top: 77vh;">
  26. <img style=" width:100%;" src="../assets/fourBoxes-2/阳台-2.png" />
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. currentItem: -1
  37. }
  38. },
  39. methods: {
  40. handleTransitionEnd(types) {
  41. this.$router.push({ name: 'Test', query: { types }})
  42. },
  43. goPagess(inx) {
  44. this.currentItem = inx
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .index-box {
  51. width: 100vw;
  52. height: 100vh;
  53. display: flex;
  54. .bg-image {
  55. width: 100%;
  56. height: 100vh;
  57. position: absolute;
  58. }
  59. .index-FourBoxes {
  60. position: relative;
  61. top: 16vh;
  62. width: 98%;
  63. height: 84%;
  64. margin: 0 auto;
  65. display: flex;
  66. flex-wrap: wrap;
  67. align-items: center;
  68. justify-content: center;
  69. .test {
  70. & > img {
  71. opacity: .6;
  72. transition: opacity .2s ease;
  73. }
  74. &.active > img {
  75. opacity: 1;
  76. }
  77. float: left;
  78. width: 48%;
  79. height: 49%;
  80. .Four-image {
  81. width: 100%;
  82. height: 100%;
  83. }
  84. }
  85. &-yushi,
  86. &-keting {
  87. margin-right: 4px;
  88. }
  89. &-yimao,
  90. &-yangtai {
  91. margin-left: 4px;
  92. }
  93. }
  94. }
  95. </style>