photo.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div id="photo">
  3. <el-row>
  4. <el-col :span="24" class="top">
  5. <el-col :span="10">
  6. <el-image style="width:100%;height:40px;" :src="left"></el-image>
  7. </el-col>
  8. <el-col :span="4" class="topTitle">
  9. {{ title }}
  10. </el-col>
  11. <el-col :span="10">
  12. <el-image style="width:100%;height:40px;" :src="right"></el-image>
  13. </el-col>
  14. </el-col>
  15. <el-col :span="24" class="info">
  16. <el-col :span="24" class="list" v-loading="loading">
  17. <el-col :span="6" class="tujiList" v-for="(item, index) in infoList" :key="index" @click.native="turnTo(item)">
  18. <el-col :span="24" class="image">
  19. <el-image style="width:270px;height:180px;" :src="item.pic"></el-image>
  20. </el-col>
  21. <el-col :span="24" class="title">
  22. <p class="textOver">{{ item.title }}</p>
  23. </el-col>
  24. </el-col>
  25. </el-col>
  26. <el-col :span="24" class="link">
  27. <el-link :underline="false" href="http://www.dangjian.com/djw2016sy/djw2016wkztl/wkztl2016djzzwk/" class="image" target="_blank">
  28. <el-image style="width:285px;height:140px;" :src="link1"></el-image>
  29. </el-link>
  30. <el-link :underline="false" href="http://xuexi.12371.cn/xxhywx/" class="image" target="_blank">
  31. <el-image style="width:285px;height:140px;" :src="link2"></el-image>
  32. </el-link>
  33. <el-link :underline="false" href="http://www.dangjian.com/specials/" class="image" target="_blank">
  34. <el-image style="width:285px;height:140px;" :src="link3"></el-image>
  35. </el-link>
  36. <el-link :underline="false" href="http://dwlm.12371.cn/" class="image" target="_blank">
  37. <el-image style="width:285px;height:140px;" :src="link4"></el-image>
  38. </el-link>
  39. </el-col>
  40. </el-col>
  41. </el-row>
  42. </div>
  43. </template>
  44. <script>
  45. import _ from 'lodash';
  46. export default {
  47. name: 'photo',
  48. props: {
  49. tujiList: null,
  50. },
  51. components: {},
  52. data: () => ({
  53. title: '活动图集',
  54. left: require('@/assets/messageLeft.jpg'),
  55. right: require('@/assets/messageRight.jpg'),
  56. link1: require('@/assets/tuji5.jpg'),
  57. link2: require('@/assets/tuji6.jpg'),
  58. link3: require('@/assets/tuji7.jpg'),
  59. link4: require('@/assets/tuji8.jpg'),
  60. infoList: [],
  61. loading: true,
  62. }),
  63. watch: {
  64. tujiList: {
  65. handler(val) {
  66. if (val) this.assignData(val);
  67. },
  68. },
  69. },
  70. created() {},
  71. computed: {},
  72. methods: {
  73. assignData(data) {
  74. let infoList = _.get(data, 'children');
  75. this.$set(this, `infoList`, infoList);
  76. this.loading = false;
  77. },
  78. turnTo(item) {
  79. if (item.url !== undefined) {
  80. window.open(item.url);
  81. } else {
  82. let route = this.$route.path;
  83. this.$router.push({ path: `/memberDetail?id=${item.id}` });
  84. }
  85. },
  86. },
  87. };
  88. </script>
  89. <style lang="less" scoped>
  90. p {
  91. padding: 0;
  92. margin: 0;
  93. }
  94. .textOver {
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. white-space: nowrap;
  98. }
  99. .top {
  100. height: 40px;
  101. line-height: 40px;
  102. margin: 0 0 40px 0;
  103. }
  104. .top .topTitle {
  105. font-size: 38px;
  106. color: #bd010b;
  107. text-align: center;
  108. font-weight: bold;
  109. font-family: '微软雅黑';
  110. }
  111. .link {
  112. height: 140px;
  113. overflow: hidden;
  114. }
  115. .link .image {
  116. width: 285px;
  117. height: 140px;
  118. margin: 0 15px;
  119. }
  120. .link .image:last-child {
  121. margin: 0 0 0 15px;
  122. }
  123. .list {
  124. margin: 0 0 40px 0;
  125. }
  126. .tujiList {
  127. width: 270px;
  128. height: 210px;
  129. overflow: hidden;
  130. margin: 0px 25px 0 25px;
  131. }
  132. .tujiList:last-child {
  133. margin: 0px 0 0 25px;
  134. }
  135. .tujiList .image {
  136. width: 270px;
  137. height: 180px;
  138. overflow: hidden;
  139. }
  140. .tujiList .title {
  141. height: 30px;
  142. line-height: 30px;
  143. padding: 0 10px;
  144. text-align: center;
  145. }
  146. .tujiList .title p {
  147. font-size: 16px;
  148. color: #333;
  149. }
  150. .tujiList:hover {
  151. cursor: pointer;
  152. }
  153. .tujiList:hover .title p {
  154. color: #bd010b;
  155. }
  156. </style>