video.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="video-w">
  3. <div class="container">
  4. <ul class="setion">
  5. <li class="common-title" :class="{'is-active': activeTab === i}" v-for="(item,i) in langVideoCourse" @click="activeTab=i" :key="i">{{item.name}}</li>
  6. </ul>
  7. <h-row class="i-ul" :gutter="20">
  8. <h-col :span="langVideoCourse[activeTab].items.length > 2 ? 6 : 12" v-for="(sub,idx) in langVideoCourse[activeTab].items" :key="idx">
  9. <div class="i-li" :class="{small: langVideoCourse[activeTab].items.length > 2}" @click="itemHandle(sub)">
  10. <div class="img-w">
  11. <img class="li-img" :src="`${$cdn}course/img/${sub.code}.jpg?version=1`" alt="">
  12. <div class="hover-item">
  13. <img :src="`${$cdn}course/img/video-play.png`" alt="">
  14. <p>{{sub.name}}</p>
  15. </div>
  16. </div>
  17. <p class="li-p" >{{sub.name}}</p>
  18. </div>
  19. </h-col>
  20. </h-row>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import { mapState } from 'vuex'
  26. export default {
  27. computed: {
  28. ...mapState({
  29. language: state => state.language.current,
  30. langVideoCourse: state => state.language.home.videoCourse.content
  31. })
  32. },
  33. data () {
  34. return {
  35. activeTab: 0
  36. }
  37. },
  38. methods: {
  39. itemHandle (item) {
  40. this.$bus.$emit('toggleVideo', {
  41. status: true,
  42. url: this.language === 'en' ? `en/${item.code}` : item.code
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .video-w {
  50. background: #F7F7F7;
  51. }
  52. .container{
  53. // width: 1200px;
  54. margin: 0 auto;
  55. padding: 0 0 124px;
  56. .setion{
  57. margin: 0 0 0;
  58. padding-top: 86px;
  59. display: flex;
  60. .common-title {
  61. margin: 0;
  62. padding-right: 34px;
  63. margin-right: 32px;
  64. position: relative;
  65. font-weight: 200;
  66. color: #909090;
  67. cursor: pointer;
  68. &.is-active {
  69. color: #202020;
  70. &::after {
  71. display: block;
  72. }
  73. }
  74. &::after {
  75. display: none;
  76. }
  77. &:last-child {
  78. &::before {
  79. display: none;
  80. }
  81. }
  82. &::before {
  83. content: '';
  84. display: block;
  85. height: 33px;
  86. width: 1px;
  87. background: #909090;
  88. position: absolute;
  89. right: 0;
  90. top: 50%;
  91. transform: translateY(-50%);
  92. }
  93. }
  94. }
  95. .i-ul{
  96. // display: flex;
  97. // justify-content: space-between;
  98. // align-items: center;
  99. // flex-wrap: wrap;
  100. width: 100%;
  101. margin-top: 64px;
  102. .i-li {
  103. position: relative;
  104. margin-bottom: 33px;
  105. background: #fff;
  106. .li-img{
  107. width: 100%;
  108. cursor: pointer;
  109. vertical-align: middle;
  110. }
  111. .bofang{
  112. width: 36px;
  113. height: 36px;
  114. position: absolute;
  115. right: 15px;
  116. bottom: 15px;
  117. cursor: pointer;
  118. }
  119. .li-p{
  120. font-size: 24px;
  121. color: #202020;
  122. line-height: 66px;
  123. padding: 0 15px;
  124. position: relative;
  125. }
  126. .img-w {
  127. position: relative;
  128. overflow: hidden;
  129. }
  130. &:hover {
  131. .hover-item {
  132. top: 0;
  133. }
  134. }
  135. .hover-item {
  136. background: rgba(0,0,0,0.5);
  137. position: absolute;
  138. top: -100%;
  139. left: 0;
  140. width: 100%;
  141. height: 100%;
  142. cursor: pointer;
  143. text-align: center;
  144. // padding-top: 125px;
  145. transition: top 0.2s linear;
  146. display: flex;
  147. flex-direction: column;
  148. justify-content: center;
  149. img {
  150. width: 70px;
  151. height: 70px;
  152. margin: 0 auto 9px;
  153. }
  154. p {
  155. font-size: 40px;
  156. color: #fff;
  157. }
  158. }
  159. &.small {
  160. .li-p{
  161. line-height: 50px;
  162. font-size: 16px;
  163. padding: 0 9px;
  164. }
  165. .bofang{
  166. width: 30px;
  167. height: 30px;
  168. position: absolute;
  169. right: 9px;
  170. bottom: 10px;
  171. cursor: pointer;
  172. }
  173. .hover-item {
  174. // padding-top: 50px;
  175. img {
  176. width: 50px;
  177. height: 50px;
  178. }
  179. p {
  180. font-size: 24px;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
  187. </style>