index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="about-layout" ref="aboutLayout">
  3. <aboutBg class="about-bg"/>
  4. <div id="luxy" >
  5. <div class="plate01 plate">
  6. <img class="about-logo" :src="`${$cdn}images/about_logo.png`" alt>
  7. <div class="introduce">
  8. <img :src="`${$cdn}images/fdage.png`" alt>
  9. <div class="intro-r">
  10. <div class="item" v-for="(item,index) in langAbout.intro" :key="index">
  11. <img src="@/assets/images/DFKI.png" v-if="item.img" alt="">
  12. <div class="b-title">{{item.name}}</div>
  13. <p class="b-label" v-for="(sub,i) in item.txt" :key="i" >{{sub}}</p>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="plate02 ">
  19. <img :src="`${$cdn}images/hezhao.png`" alt>
  20. </div>
  21. <div class="plate03" :style="{marginLeft:(split - 405)+ 'px'}">
  22. <div class="event plate">
  23. <touch class="touch-layout" :iactive='iactive' :data="imgs" :width="360" :loop="3000">
  24. <div class="item" slot="item" slot-scope="{item}">
  25. <img :src="item.img">
  26. </div>
  27. <div slot="foot" slot-scope="{data, index}" class="ban">
  28. <span @click="iactive=i" v-for="(item, i) in data" :key="i" :class="{active: i===index}"></span>
  29. </div>
  30. </touch>
  31. <div class="e-node">
  32. <h2>{{langAbout.events.title}}</h2>
  33. <ul>
  34. <li v-for="(item,idx) in langAbout.events.nodes" :key="idx">
  35. <h3>{{item.year}}</h3>
  36. <p v-for="(sub, i) in item.txt" :key="i">{{sub}}</p>
  37. </li>
  38. </ul>
  39. </div>
  40. </div>
  41. <div class="contact plate">
  42. <img :src="`${$cdn}images/company.png`" alt>
  43. <div class="e-node">
  44. <ul>
  45. <li v-for="(item,idx) in langAbout.kefu" :key="idx">
  46. <h3 :class="item.class">{{item.title}}</h3>
  47. <p v-for="(sub, i) in item.content" :key="i">{{sub}}</p>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. <ifooter/>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import {mapState} from 'vuex'
  59. import aboutBg from '@/components/aboutBg'
  60. import touch from '@/components/touch'
  61. import footer from '@/page/layout/footer'
  62. import { getPosition } from '@/util'
  63. import * as luxy from 'luxy.js'
  64. export default {
  65. data () {
  66. const imgs = [
  67. {
  68. img: this.$cdn + 'images/event.png'
  69. },
  70. {
  71. img: this.$cdn + 'images/about1.jpg'
  72. },
  73. {
  74. img: this.$cdn + 'images/about2.jpg'
  75. },
  76. {
  77. img: this.$cdn + 'images/about3.jpg'
  78. },
  79. {
  80. img: this.$cdn + 'images/about4.jpg'
  81. },
  82. {
  83. img: this.$cdn + 'images/about5.jpg'
  84. }
  85. ]
  86. return {
  87. imgs,
  88. iactive: 0
  89. }
  90. },
  91. components: {
  92. aboutBg,
  93. touch,
  94. ifooter: footer
  95. },
  96. computed: {
  97. ...mapState({
  98. split: state => state.ui.navDivision,
  99. langAbout: state => state.language.home.about
  100. })
  101. },
  102. mounted () {
  103. this.timeout = setTimeout(() => {
  104. luxy.init({
  105. wrapperSpeed: 0.06
  106. })
  107. let height = getPosition(this.$refs.aboutLayout).y
  108. let items = Array.from(this.$refs.aboutLayout.querySelectorAll('.plate'))
  109. this.scrollHandle = function () {
  110. items.forEach((item, index) => {
  111. let addHeight = item.offsetParent && (item.offsetParent.nodeName).toLowerCase() === 'body' ? (item.offsetTop + height) : (item.offsetTop + item.offsetParent.offsetTop + height)
  112. if (addHeight <= window.innerHeight + (window.scrollY || window.pageYOffset) - 300) {
  113. item.classList.remove(`hide${index + 1}`)
  114. } else {
  115. item.classList.add(`hide${index + 1}`)
  116. }
  117. })
  118. }
  119. window.addEventListener('scroll', this.scrollHandle)
  120. this.scrollHandle()
  121. }, 100)
  122. },
  123. destroyed () {
  124. clearTimeout(this.timeout)
  125. window.removeEventListener('scroll', this.scrollHandle)
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. @import "./style.scss";
  131. </style>