notice.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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">
  8. <img
  9. :src="
  10. studentMessage.headportrait != null
  11. ? studentMessage.headportrait
  12. : tx
  13. "
  14. alt=""
  15. />
  16. </div>
  17. <div class="right_box">
  18. <div class="right_box_title">{{ studentMessage.name }}</div>
  19. <div class="people">
  20. <div>
  21. <span>班级:</span
  22. ><span style="color: #999">{{ studentMessage.cname }}</span>
  23. </div>
  24. <div style="margin-left: 50px">
  25. <span>所属学校:</span
  26. ><span style="color: #999">{{ studentMessage.sname }}</span>
  27. </div>
  28. </div>
  29. <div>
  30. <span>手机号码:</span
  31. ><span style="color: #999">{{
  32. studentMessage.phonenumber
  33. }}</span>
  34. </div>
  35. </div>
  36. </div>
  37. </div> -->
  38. <div class="student_body">
  39. <div class="noticeTitle">通知内容</div>
  40. <div class="project_box">
  41. <div class="notice_box">
  42. <div
  43. class="notice_message"
  44. v-for="(item, index) in newMessage"
  45. :key="index"
  46. >
  47. <div
  48. class="notice_title"
  49. @click="
  50. goTo(
  51. '/noticeDetail?newsid=' +
  52. item.newsid +
  53. '&userid=' +
  54. userid
  55. )
  56. "
  57. >
  58. {{ item.title }}
  59. </div>
  60. <div class="notice_time">{{ item.creatTime }}</div>
  61. </div>
  62. <!-- <div class="notice_message">
  63. <div class="notice_title" @click="goTo('/noticeDetail')">
  64. 关于'一校一案'劳动有关通知
  65. </div>
  66. <div class="notice_time">2021-09-08 10:01</div>
  67. </div>
  68. <div class="notice_message">
  69. <div class="notice_title" @click="goTo('/noticeDetail')">
  70. 实践出真知,最光荣
  71. </div>
  72. <div class="notice_time">2021-09-08 10:01</div>
  73. </div>
  74. <div class="notice_message">
  75. <div class="notice_title" @click="goTo('/noticeDetail')">
  76. 基于项目学习Shine相关通知
  77. </div>
  78. <div class="notice_time">2021-09-08 10:01</div>
  79. </div> -->
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. studentMessage: [],
  92. newMessage: [],
  93. tx: require("../assets/tx.png"),
  94. page: 1,
  95. userid: this.$route.query.userid,
  96. };
  97. },
  98. methods: {
  99. goTo(path) {
  100. this.$router.push(path);
  101. },
  102. selectSDetail() {
  103. let params = {
  104. uid: this.userid,
  105. };
  106. this.ajax
  107. .get(this.$store.state.api + "selectSDetail", params)
  108. .then((res) => {
  109. this.studentMessage = res.data[0][0];
  110. })
  111. .catch((err) => {
  112. console.error(err);
  113. });
  114. },
  115. getNews() {
  116. let params = {
  117. uid: this.userid,
  118. page: this.page,
  119. };
  120. this.ajax
  121. .get(this.$store.state.api + "getNewsTeacher", params)
  122. .then((res) => {
  123. this.newMessage = res.data[0];
  124. })
  125. .catch((err) => {
  126. console.error(err);
  127. });
  128. },
  129. },
  130. created() {
  131. this.selectSDetail();
  132. this.getNews();
  133. document.scrollingElement.scrollTop = 0;
  134. },
  135. };
  136. </script>
  137. <style scoped>
  138. .body_student {
  139. margin: 20px auto;
  140. width: 98%;
  141. height: 100%;
  142. }
  143. .student_head {
  144. width: 80%;
  145. margin: 0 auto;
  146. background: #fff;
  147. height: 30%;
  148. }
  149. .wheel > img,
  150. .project > img {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. .box_course {
  155. display: flex;
  156. padding: 35px 0 25px 60px;
  157. align-items: center;
  158. }
  159. .wheel {
  160. width: 210px;
  161. }
  162. .right_box {
  163. display: flex;
  164. flex-direction: column;
  165. margin-left: 30px;
  166. /* justify-content: space-around; */
  167. }
  168. .right_box_title {
  169. font-size: 23px;
  170. }
  171. .people {
  172. display: flex;
  173. margin: 30px 0 20px 0px;
  174. }
  175. .student_body {
  176. width: 100%;
  177. background: #fff;
  178. min-height: 1000px;
  179. position: relative;
  180. }
  181. .project {
  182. width: 165px;
  183. }
  184. .project_box {
  185. margin: 0 0 10px 30px;
  186. padding-top: 40px;
  187. }
  188. .notice_message {
  189. padding: 30px 0;
  190. border-bottom: 1px solid #ccc;
  191. }
  192. .notice_time {
  193. font-size: 14px;
  194. margin-top: 15px;
  195. }
  196. .notice_title {
  197. cursor: pointer;
  198. }
  199. .noticeTitle {
  200. background: #eeeeee;
  201. width: 95%;
  202. position: absolute;
  203. top: 15px;
  204. left: 20px;
  205. font-weight: 600;
  206. height: 35px;
  207. line-height: 35px;
  208. padding-left: 10px;
  209. }
  210. </style>