noticeDetail.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <div class="pb_content">
  3. <div class="pb_content_body">
  4. <div class="body_student">
  5. <!-- <div class="student_head">
  6. <div class="box_course">
  7. <div class="wheel"><img src="../assets/tx.png" alt="" /></div>
  8. <div class="right_box">
  9. <div class="right_box_title">张子林</div>
  10. <div class="people">
  11. <div>
  12. <span>班级:</span><span style="color: #999">六年3班</span>
  13. </div>
  14. <div style="margin-left: 50px">
  15. <span>所属学校:</span
  16. ><span style="color: #999">罗浮名剑中学</span>
  17. </div>
  18. </div>
  19. <div>
  20. <span>手机号码:</span
  21. ><span style="color: #999">13751117529</span>
  22. </div>
  23. </div>
  24. </div>
  25. </div> -->
  26. <div class="student_body">
  27. <div class="project_box">
  28. <div class="detail_content_top">
  29. <div class="detail_title">{{ newDetailMessage.title }}</div>
  30. <div class="detail_time">{{ newDetailMessage.creatTime }}</div>
  31. </div>
  32. <div
  33. class="detail_content"
  34. v-html="newDetailMessage.newscontent"
  35. ></div>
  36. </div>
  37. <div class="returnPage" @click="goTo('/notice?userid=' + userid)">
  38. 返回
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. studentMessage: [],
  50. newDetailMessage: [],
  51. tx: require("../assets/tx.png"),
  52. newsid: this.$route.query.newsid,
  53. userid: this.$route.query.userid,
  54. };
  55. },
  56. methods: {
  57. goTo(path) {
  58. this.$router.push(path);
  59. },
  60. selectSDetail() {
  61. let params = {
  62. uid: this.userid,
  63. };
  64. this.ajax
  65. .get(this.$store.state.api + "selectSDetail", params)
  66. .then((res) => {
  67. this.studentMessage = res.data[0][0];
  68. })
  69. .catch((err) => {
  70. console.error(err);
  71. });
  72. },
  73. selectNewDetail() {
  74. let params = {
  75. nid: this.newsid,
  76. };
  77. this.ajax
  78. .get(this.$store.state.api + "selectNewDetail", params)
  79. .then((res) => {
  80. this.newDetailMessage = res.data[0][0];
  81. })
  82. .catch((err) => {
  83. console.error(err);
  84. });
  85. },
  86. },
  87. created() {
  88. this.selectSDetail();
  89. this.selectNewDetail();
  90. document.scrollingElement.scrollTop = 0;
  91. },
  92. };
  93. </script>
  94. <style scoped>
  95. .body_student {
  96. margin: 0px auto;
  97. width: 80%;
  98. height: 100%;
  99. }
  100. .student_head {
  101. width: 80%;
  102. margin: 0 auto;
  103. background: #fff;
  104. height: 30%;
  105. }
  106. .wheel > img,
  107. .project > img {
  108. width: 100%;
  109. height: 100%;
  110. }
  111. .box_course {
  112. display: flex;
  113. padding: 35px 0 25px 60px;
  114. align-items: center;
  115. }
  116. .wheel {
  117. width: 210px;
  118. }
  119. .right_box {
  120. display: flex;
  121. flex-direction: column;
  122. margin-left: 30px;
  123. /* justify-content: space-around; */
  124. }
  125. .right_box_title {
  126. font-size: 23px;
  127. }
  128. .people {
  129. display: flex;
  130. margin: 30px 0 20px 0px;
  131. }
  132. .student_body {
  133. width: 100%;
  134. margin: 0 auto;
  135. background: #fff;
  136. margin-top: 20px;
  137. min-height: 800px;
  138. position: relative;
  139. }
  140. .project {
  141. width: 165px;
  142. }
  143. .project_box {
  144. padding: 0 30px 10px 30px;
  145. }
  146. .detail_content_top {
  147. width: 100%;
  148. padding: 25px 0 25px 0;
  149. border-bottom: 1px solid #ccc;
  150. }
  151. .detail_title {
  152. text-align: center;
  153. font-size: 24px;
  154. }
  155. .detail_time {
  156. font-size: 13px;
  157. padding: 15px 0 0 40px;
  158. }
  159. .detail_content {
  160. width: 90%;
  161. line-height: 2pc;
  162. margin: 0 auto;
  163. padding-top: 30px;
  164. text-indent: 30px;
  165. }
  166. .returnPage {
  167. position: absolute;
  168. bottom: 30px;
  169. right: 10%;
  170. background: #41cda6;
  171. width: 100px;
  172. color: #fff;
  173. height: 25px;
  174. border-radius: 3px;
  175. text-align: center;
  176. line-height: 25px;
  177. font-size: 13px;
  178. cursor: pointer;
  179. }
  180. </style>