semDetail.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <div id="semDetail">
  3. <el-row>
  4. <div class="w_1200">
  5. <el-col :span="24" class="main">
  6. <el-col :span="24" class="one">
  7. <el-image :src="gongqiuImage"></el-image>
  8. </el-col>
  9. <el-col :span="24" class="two">
  10. <el-col :span="24" class="twoTop">
  11. <el-col :span="3" class="left">
  12. 浏览次数:1
  13. </el-col>
  14. <el-col :span="21" class="right"> [专题] {{ detail.title }} </el-col>
  15. </el-col>
  16. <el-col :span="24" class="twoInfo">
  17. <el-col class="list">
  18. <el-col :span="3" class="left">
  19. <el-col :span="24" class="leftTop">
  20. 会员名称
  21. </el-col>
  22. <el-col :span="24" class="leftDown">
  23. <el-image :src="squareImage"></el-image>
  24. <el-col :span="24" class="jobname">
  25. {{ detail.name }}
  26. </el-col>
  27. </el-col>
  28. </el-col>
  29. <el-col :span="21" class="right">
  30. <el-col :span="24" class="date">
  31. <i class="el-icon-user icon"></i>
  32. <span>文章发表于{{ detail.meta | getDate }}</span>
  33. <span>1楼</span>
  34. </el-col>
  35. <el-col :span="24" class="info">
  36. <p>{{ detail.content }}</p>
  37. </el-col>
  38. <el-col :span="24" class="jubao">
  39. <span>举报</span>
  40. </el-col>
  41. </el-col>
  42. </el-col>
  43. <el-col class="list" v-for="(item, index) in list" :key="index">
  44. <el-col :span="3" class="left">
  45. <el-col :span="24" class="leftTop">
  46. 会员名称
  47. </el-col>
  48. <el-col :span="24" class="leftDown">
  49. <el-image :src="squareImage"></el-image>
  50. <el-col :span="24" class="jobname">
  51. {{ item.name }}
  52. </el-col>
  53. </el-col>
  54. </el-col>
  55. <el-col :span="21" class="right">
  56. <el-col :span="24" class="date">
  57. <i class="el-icon-user icon"></i>
  58. <span>评论发布于{{ item.date }}</span>
  59. <span>{{ index + 2 }}楼</span>
  60. </el-col>
  61. <el-col :span="24" class="info">
  62. <p>{{ item.content }}</p>
  63. </el-col>
  64. <el-col :span="24" class="jubao">
  65. <span>举报</span>
  66. </el-col>
  67. </el-col>
  68. </el-col>
  69. </el-col>
  70. <el-col :span="24" class="twoPage">
  71. <page :total="total" position="right"></page>
  72. </el-col>
  73. <el-col :span="24" class="twoInput">
  74. <el-col :span="3" class="left"> </el-col>
  75. <el-col :span="21" class="right">
  76. <el-col :span="24" class="waneditor">
  77. <wang-editor v-model="inputInfo" ref="editor"></wang-editor>
  78. </el-col>
  79. <el-col :span="24" class="btn">
  80. <el-button type="primary">发表评论</el-button>
  81. </el-col>
  82. </el-col>
  83. </el-col>
  84. </el-col>
  85. </el-col>
  86. </div>
  87. </el-row>
  88. </div>
  89. </template>
  90. <script>
  91. import wangEditor from '@/components/wang-editor.vue';
  92. import page from '@/components/pagination.vue';
  93. import { mapState, createNamespacedHelpers } from 'vuex';
  94. const { mapActions: news } = createNamespacedHelpers('news');
  95. export default {
  96. name: 'semDetail',
  97. props: {},
  98. components: { page, wangEditor },
  99. data: () => ({
  100. gongqiuImage: require('@/assets/live/111.png'),
  101. squareImage: require('@/assets/live/222.png'),
  102. detail: {},
  103. list: [
  104. {
  105. name: '测试人员',
  106. date: '2020-02-02',
  107. content: '测试内容',
  108. },
  109. {
  110. name: '测试人员',
  111. date: '2020-02-02',
  112. content: '测试内容',
  113. },
  114. {
  115. name: '测试人员',
  116. date: '2020-02-02',
  117. content: '测试内容',
  118. },
  119. ],
  120. print: { name: '管理员', date: '2020-05-02', content: '测试内容' },
  121. total: 0,
  122. inputInfo: '',
  123. }),
  124. created() {
  125. this.search();
  126. },
  127. computed: {
  128. id() {
  129. return this.$route.query.id;
  130. },
  131. ...mapState(['user']),
  132. pageTitle() {
  133. return `${this.$route.meta.title}`;
  134. },
  135. },
  136. methods: {
  137. ...news(['fetch']),
  138. async search() {
  139. const res = await this.fetch(this.id);
  140. this.$set(this, `detail`, res.data);
  141. },
  142. },
  143. filters: {
  144. getDate(meta) {
  145. let createdAt = _.get(meta, `createdAt`);
  146. let date = new Date(createdAt)
  147. .toLocaleDateString()
  148. .replace('/', '-')
  149. .replace('/', '-');
  150. return date;
  151. },
  152. },
  153. };
  154. </script>
  155. <style lang="less" scoped>
  156. .w_1200 {
  157. width: 80%;
  158. margin: 0 auto;
  159. }
  160. .main {
  161. float: left;
  162. width: 100%;
  163. min-height: 600px;
  164. margin: 30px 0;
  165. }
  166. .main .one {
  167. float: left;
  168. width: 100%;
  169. height: 160px;
  170. margin: 0 0 30px 0;
  171. }
  172. .main .two {
  173. float: left;
  174. width: 100%;
  175. }
  176. .main .two .twoTop {
  177. float: left;
  178. width: 100%;
  179. height: 60px;
  180. }
  181. .main .two .twoTop .left {
  182. float: left;
  183. height: 60px;
  184. line-height: 50px;
  185. text-align: center;
  186. font-size: 18px;
  187. color: #00316e;
  188. background: #a5d2f5;
  189. border-bottom: 10px solid #044b79;
  190. }
  191. .main .two .twoTop .right {
  192. float: left;
  193. height: 60px;
  194. line-height: 50px;
  195. padding: 0 15px;
  196. font-size: 30px;
  197. color: #023658;
  198. border-bottom: 10px solid #5096d2;
  199. }
  200. .main .two .twoInfo {
  201. float: left;
  202. width: 100%;
  203. }
  204. .main .two .twoInfo .left {
  205. background: #5096d2;
  206. border-bottom: 10px solid #044b79;
  207. }
  208. .main .two .twoInfo .left .leftTop {
  209. height: 60px;
  210. line-height: 60px;
  211. text-align: center;
  212. color: #fff;
  213. font-size: 22px;
  214. border-bottom: 1px dashed #ccc;
  215. }
  216. .main .two .twoInfo .left .leftDown {
  217. height: 420px;
  218. }
  219. .main .two .twoInfo .left .leftDown .el-image {
  220. margin: 40px 18px;
  221. width: auto;
  222. height: auto;
  223. max-width: 100%;
  224. max-height: 100%;
  225. }
  226. .main .two .twoInfo .left .leftDown .jobname {
  227. text-align: center;
  228. font-size: 22px;
  229. color: #fffcae;
  230. }
  231. .main .two .twoInfo .right {
  232. padding: 0 20px;
  233. }
  234. .main .two .twoInfo .right .date {
  235. padding: 0 20px;
  236. height: 60px;
  237. line-height: 60px;
  238. border-bottom: 1px dashed #ccc;
  239. }
  240. .main .two .twoInfo .right .date .icon {
  241. font-size: 30px;
  242. color: #b6dd59;
  243. }
  244. .main .two .twoInfo .right .date span:nth-child(2) {
  245. font-size: 20px;
  246. padding: 0px 10px;
  247. position: relative;
  248. top: -2px;
  249. }
  250. .main .two .twoInfo .right .date span:last-child {
  251. font-size: 20px;
  252. float: right;
  253. }
  254. .main .two .twoInfo .right .info {
  255. height: 300px;
  256. overflow: hidden;
  257. border: 2px solid #044b79;
  258. border-radius: 10px;
  259. margin: 30px 0;
  260. padding: 20px;
  261. }
  262. .main .two .twoInfo .right .info p {
  263. font-size: 20px;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. -webkit-line-clamp: 8;
  267. word-break: break-all;
  268. display: -webkit-box;
  269. -webkit-box-orient: vertical;
  270. line-height: 32px;
  271. }
  272. .main .two .twoInfo .right .jubao {
  273. height: 70px;
  274. line-height: 60px;
  275. border-top: 1px dashed #ff8b0f;
  276. border-bottom: 10px solid #5096d2;
  277. }
  278. .main .two .twoInfo .right .jubao span {
  279. float: right;
  280. color: #ff0000;
  281. font-size: 20px;
  282. }
  283. .main .two .twoPage {
  284. margin: 20px 0;
  285. }
  286. .main .two .twoInput {
  287. height: 270px;
  288. border: 2px solid #5096d2;
  289. }
  290. .main .two .twoInput .left {
  291. height: 266px;
  292. background-color: #5096d2;
  293. }
  294. .main .two .twoInput .right {
  295. padding: 20px 20px 0 20px;
  296. }
  297. /deep/.main .two .twoInput .right .waneditor .w-e-text-container {
  298. height: 140px !important;
  299. }
  300. .main .two .twoInput .right .btn {
  301. margin: 10px 0;
  302. }
  303. /deep/.main .two .twoInput .right .btn .el-button {
  304. margin: 10px 0;
  305. }
  306. </style>