index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <div id="technical">
  3. <el-col :span="24" class="main">
  4. <el-col :span="12" class="left">
  5. <el-col :span="1" class="leftTitle">
  6. <p>专<br />题<br />研<br />讨</p>
  7. <p></p>
  8. </el-col>
  9. <el-col :span="23" class="infoLeft">
  10. <el-col class="infoLeftList" :span="24" v-for="(item, index) in zhuantiList" :key="index">
  11. <p>{{ item.publish_time }}</p>
  12. <p>
  13. <span @click="clickzhuanti(item.id)" class="textOver">{{ item.title }}</span>
  14. <span>{{ item.content }}</span>
  15. </p>
  16. </el-col>
  17. </el-col>
  18. <el-col :span="24" class="leftListDown"><span></span><span @click="turnToList('专题研讨')">MORE</span></el-col>
  19. </el-col>
  20. <el-col :span="12" class="right">
  21. <el-col :span="24" class="rightListTop"><span @click="turnToList('技术问答')">MORE</span><span></span></el-col>
  22. <el-col :span="23" class="infoRight">
  23. <el-col class="infoRightList" :span="24" v-for="(item, index) in jishuList" :key="index">
  24. <p>
  25. <span class="textOver" @click="clickjishu(item.id)">{{ item.title }}</span
  26. ><span class="textOver">{{ item.publish_time }}</span>
  27. </p>
  28. </el-col>
  29. </el-col>
  30. <el-col :span="1" class="rightTitle">
  31. <p></p>
  32. <p>技<br />术<br />问<br />答</p>
  33. </el-col>
  34. </el-col>
  35. <el-col :span="24">
  36. <el-image :src="jishuImage" class="jishuImage"></el-image>
  37. </el-col>
  38. <el-col :span="12" class="left">
  39. <el-col :span="1" class="leftTitle">
  40. <p>行<br />业<br />研<br />究</p>
  41. <p></p>
  42. </el-col>
  43. <el-col :span="23" class="infoRight">
  44. <el-col class="infoRightList" :span="24" v-for="(item, index) in hangyeList" :key="index">
  45. <p>
  46. <span class="textOver" @click="clickhangye(item.id)">{{ item.title }}</span
  47. ><span class="textOver">{{ item.publish_time }}</span>
  48. </p>
  49. </el-col>
  50. </el-col>
  51. <el-col :span="24" class="leftListDown"><span></span><span @click="turnToList('行业研究')">MORE</span></el-col>
  52. </el-col>
  53. <el-col :span="12" class="right">
  54. <el-col :span="24" class="rightListTop"><span @click="turnToList('教育培训')">MORE</span><span></span></el-col>
  55. <el-col :span="23" class="infoLeft">
  56. <el-col class="infoLeftList" :span="24" v-for="(item, index) in jiaoyuList" :key="index">
  57. <p>{{ item.publish_time }}</p>
  58. <p>
  59. <span class="textOver" @click="clickjiaoyu(item.id)">{{ item.title }}</span>
  60. <span>{{ item.content }}</span>
  61. </p>
  62. </el-col>
  63. </el-col>
  64. <el-col :span="1" class="rightTitle">
  65. <p></p>
  66. <p>教<br />育<br />培<br />训</p>
  67. </el-col>
  68. </el-col>
  69. </el-col>
  70. </div>
  71. </template>
  72. <script>
  73. import _ from 'lodash';
  74. import { mapState, createNamespacedHelpers } from 'vuex';
  75. const { mapActions: news } = createNamespacedHelpers('news');
  76. export default {
  77. name: 'technical',
  78. props: {},
  79. components: {},
  80. data: () => ({
  81. jishuImage: require('@/assets/live/main2.png'),
  82. zhuantiList: [],
  83. jishuList: [],
  84. hangyeList: [],
  85. jiaoyuList: [],
  86. }),
  87. created() {
  88. this.searchInfo();
  89. },
  90. computed: {},
  91. methods: {
  92. ...news(['query']),
  93. async searchInfo() {
  94. let res = await this.query({ skip: 0, limit: 6, column_name: '专题研讨' });
  95. if (this.$checkRes(res)) this.$set(this, `zhuantiList`, res.data);
  96. res = await this.query({ skip: 0, limit: 10, column_name: '技术问答' });
  97. if (this.$checkRes(res)) this.$set(this, `jishuList`, res.data);
  98. res = await this.query({ skip: 0, limit: 10, column_name: '行业研究' });
  99. if (this.$checkRes(res)) this.$set(this, `hangyeList`, res.data);
  100. res = await this.query({ skip: 0, limit: 6, column_name: '教育培训' });
  101. if (this.$checkRes(res)) this.$set(this, `jiaoyuList`, res.data);
  102. },
  103. turnToList(column_name) {
  104. this.$router.push({ path: '/technical/list', query: { column_name: column_name } });
  105. },
  106. clickzhuanti(id) {
  107. this.$router.push({ path: '/live/detail', query: { id: id } });
  108. console.log(id);
  109. },
  110. clickjishu(id) {
  111. this.$router.push({ path: '/live/detail', query: { id: id } });
  112. console.log(id);
  113. },
  114. clickhangye(id) {
  115. this.$router.push({ path: '/live/detail', query: { id: id } });
  116. console.log(id);
  117. },
  118. clickjiaoyu(id) {
  119. this.$router.push({ path: '/live/detail', query: { id: id } });
  120. console.log(id);
  121. },
  122. },
  123. };
  124. </script>
  125. <style lang="less" scoped>
  126. .jishuImage {
  127. width: 100%;
  128. height: 100%;
  129. }
  130. .main {
  131. width: 80%;
  132. margin: 0 auto;
  133. float: none;
  134. }
  135. .left {
  136. float: left;
  137. height: 500px;
  138. margin: 30px 0 30px 0;
  139. overflow: hidden;
  140. }
  141. .leftTitle {
  142. text-align: center;
  143. position: relative;
  144. }
  145. .leftTitle p:first-child {
  146. font-size: 18px;
  147. color: #044b79;
  148. font-weight: bold;
  149. }
  150. .leftTitle p:last-child {
  151. float: left;
  152. width: 2px;
  153. height: 402px;
  154. background-color: #044b79;
  155. margin: 0 5px;
  156. position: absolute;
  157. left: 9px;
  158. }
  159. .infoLeft {
  160. height: 480px;
  161. padding: 0 10px;
  162. }
  163. .infoLeftList {
  164. float: left;
  165. width: 95%;
  166. border-bottom: 1px dashed #ccc;
  167. padding: 8px 0 8px 0;
  168. height: 80px;
  169. margin: 0 0 0 5px;
  170. }
  171. .infoLeftList:nth-child(6) {
  172. float: left;
  173. width: 95%;
  174. border-bottom: none;
  175. padding: 8px 0 8px 0;
  176. height: 81px;
  177. margin: 0 0 15px 5px;
  178. }
  179. .infoLeftList:hover p:last-child span:first-child {
  180. -webkit-transform: translateY(-3px);
  181. -ms-transform: translateY(-3px);
  182. transform: translateY(-3px);
  183. -webkit-box-shadow: 0 0 6px #999;
  184. box-shadow: 0 0 6px #999;
  185. -webkit-transition: all 0.5s ease-out;
  186. transition: all 0.5s ease-out;
  187. color: #005293;
  188. cursor: pointer;
  189. }
  190. .infoLeftList p:first-child {
  191. float: left;
  192. width: 20%;
  193. font-size: 15px;
  194. background: #044b79;
  195. text-align: center;
  196. color: #fff;
  197. font-weight: bold;
  198. padding: 4px 0px;
  199. margin: 0 0 0 5px;
  200. }
  201. .infoLeftList p:last-child {
  202. float: right;
  203. width: 70%;
  204. padding: 0 0 0 10px;
  205. }
  206. .infoLeftList p:last-child span:first-child {
  207. float: left;
  208. width: 90%;
  209. font-size: 18px;
  210. }
  211. .infoLeftList p:last-child span:last-child {
  212. float: left;
  213. width: 90%;
  214. font-size: 16px;
  215. overflow: hidden;
  216. text-overflow: ellipsis;
  217. -webkit-line-clamp: 2;
  218. word-break: break-all;
  219. display: -webkit-box;
  220. -webkit-box-orient: vertical;
  221. margin: 5px 0 0 0;
  222. color: #666;
  223. }
  224. .leftListDown {
  225. position: relative;
  226. }
  227. .leftListDown span:first-child {
  228. display: inline-block;
  229. width: 80%;
  230. height: 3px;
  231. background: rgba(4, 75, 121, 0.37);
  232. margin: 0 10px 0 0;
  233. position: absolute;
  234. left: -10px;
  235. top: 10px;
  236. }
  237. .leftListDown span:last-child {
  238. font-size: 16px;
  239. float: right;
  240. padding: 0 15px 0 0;
  241. color: #044b79;
  242. font-weight: 700;
  243. cursor: pointer;
  244. }
  245. .right {
  246. float: right;
  247. height: 500px;
  248. overflow: hidden;
  249. margin: 30px 0 30px 0;
  250. }
  251. .rightListTop {
  252. position: relative;
  253. }
  254. .rightListTop span:first-child {
  255. font-size: 16px;
  256. float: left;
  257. padding: 0 0 0 15px;
  258. color: #044b79;
  259. font-weight: 700;
  260. cursor: pointer;
  261. }
  262. .rightListTop span:last-child {
  263. display: inline-block;
  264. width: 80%;
  265. height: 3px;
  266. background: rgba(4, 75, 121, 0.37);
  267. margin: 0 10px 0 0;
  268. position: absolute;
  269. right: -10px;
  270. top: 10px;
  271. }
  272. .infoRight {
  273. height: 480px;
  274. padding: 0 10px;
  275. }
  276. .infoRightList {
  277. float: left;
  278. width: 95%;
  279. padding: 11px 0;
  280. }
  281. .infoRightList:nth-child(5) {
  282. border-bottom: 1px solid #ccc;
  283. padding: 0 0 17px 0;
  284. }
  285. .infoRightList:nth-child(6) {
  286. padding: 11px 0 0 0;
  287. }
  288. .infoRightList:hover p span:first-child {
  289. -webkit-transform: translateY(-3px);
  290. -ms-transform: translateY(-3px);
  291. transform: translateY(-3px);
  292. -webkit-box-shadow: 0 0 6px #999;
  293. box-shadow: 0 0 6px #999;
  294. -webkit-transition: all 0.5s ease-out;
  295. transition: all 0.5s ease-out;
  296. color: #005293;
  297. cursor: pointer;
  298. }
  299. .infoRightList p {
  300. font-size: 18px;
  301. }
  302. .infoRightList p span:first-child {
  303. display: inline-block;
  304. width: 70%;
  305. margin: 0 20px 0 10px;
  306. }
  307. .infoRightList p span:last-child {
  308. display: inline-block;
  309. width: 21%;
  310. text-align: center;
  311. font-size: 16px;
  312. }
  313. .rightTitle {
  314. text-align: center;
  315. }
  316. .rightTitle p:first-child {
  317. width: 2px;
  318. height: 370px;
  319. background: #044b79;
  320. position: relative;
  321. left: 10px;
  322. top: -20px;
  323. }
  324. .rightTitle p:last-child {
  325. font-size: 18px;
  326. font-weight: bold;
  327. color: #044b79;
  328. }
  329. </style>