project.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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><span>{{ studentMessage.cname }}</span>
  22. </div>
  23. <div style="margin-left: 50px">
  24. <span>所属学校:</span><span>{{ studentMessage.sname }}</span>
  25. </div>
  26. </div>
  27. <div>
  28. <span>手机号码:</span
  29. ><span>{{ studentMessage.phonenumber }}</span>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="student_body">
  35. <div class="myProject">我的项目</div>
  36. <div class="project_box">
  37. <div
  38. class="three_box_inthis"
  39. v-for="(item, index) in myCourse"
  40. :key="index"
  41. >
  42. <div
  43. class="project"
  44. @click="
  45. goTo(
  46. '/courseDetail?courseId=' +
  47. item.courseid +
  48. '&userid=' +
  49. userid + '&oid=' + oid
  50. )
  51. "
  52. >
  53. <!-- <img
  54. :src="
  55. item.cover != null && item.cover != ''
  56. ? JSON.parse(item.cover)[0].url
  57. : mpj
  58. "
  59. alt=""
  60. /> -->
  61. <img
  62. :src="
  63. mpj
  64. "
  65. alt=""
  66. />
  67. </div>
  68. <div class="projct_nav">
  69. <div
  70. style="font-size: 18px"
  71. @click="
  72. goTo(
  73. '/courseDetail?courseId=' +
  74. item.courseid +
  75. '&userid=' +
  76. userid + '&oid=' + oid
  77. )
  78. "
  79. >
  80. {{ item.title }}
  81. </div>
  82. <div style="color: #2FDB88">
  83. 共{{ JSON.parse(item.chapters).length }}讲
  84. </div>
  85. <div>
  86. <span style="color: #999">{{ item.createTime }}</span>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. myCourse: [],
  101. studentMessage: [],
  102. tx: require("../assets/avatar.png"),
  103. mpj: require("../assets/project.png"),
  104. userid: this.$route.query.userid,
  105. oid:this.$route.query.oid,
  106. };
  107. },
  108. methods: {
  109. goTo(path) {
  110. this.$router.push(path);
  111. },
  112. selectSDetail() {
  113. let params = {
  114. uid: this.userid,
  115. };
  116. this.ajax
  117. .get(this.$store.state.api + "selectSDetail", params)
  118. .then((res) => {
  119. this.studentMessage = res.data[0][0];
  120. })
  121. .catch((err) => {
  122. this.isLoading = false;
  123. console.error(err);
  124. });
  125. },
  126. selectMyCourse() {
  127. let params = {
  128. uid: this.userid,
  129. };
  130. this.ajax
  131. .get(this.$store.state.api + "selectMyCourseBycid", params)
  132. .then((res) => {
  133. this.myCourse = res.data[0];
  134. })
  135. .catch((err) => {
  136. console.error(err);
  137. });
  138. },
  139. },
  140. created() {
  141. this.selectSDetail();
  142. this.selectMyCourse();
  143. document.scrollingElement.scrollTop = 0;
  144. },
  145. };
  146. </script>
  147. <style scoped>
  148. .body_student {
  149. margin: 0px auto;
  150. width: 98%;
  151. height: 100%;
  152. }
  153. .student_head {
  154. width: 100%;
  155. margin: 0 auto;
  156. height: 30%;
  157. background-image: linear-gradient(90deg, #30c499, #75ceba);
  158. color: #fff;
  159. }
  160. .wheel > img,
  161. .project > img {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. .box_course {
  166. display: flex;
  167. padding: 35px 0 25px 60px;
  168. align-items: center;
  169. }
  170. .wheel {
  171. width: 210px;
  172. }
  173. .right_box {
  174. display: flex;
  175. flex-direction: column;
  176. margin-left: 30px;
  177. /* justify-content: space-around; */
  178. }
  179. .right_box_title {
  180. font-size: 23px;
  181. }
  182. .people {
  183. display: flex;
  184. margin: 30px 0 20px 0px;
  185. }
  186. .student_body {
  187. width: 100%;
  188. margin: 0 auto;
  189. background: #fff;
  190. margin-top: 20px;
  191. padding: 0 0 20px;
  192. min-height: 1000px;
  193. }
  194. .project {
  195. width: 100%;
  196. }
  197. .project_box {
  198. display: flex;
  199. width: 100%;
  200. flex-direction: row;
  201. flex-wrap: wrap;
  202. }
  203. .three_box_inthis {
  204. display: flex;
  205. width: 21%;
  206. flex-direction: column;
  207. align-items: flex-start;
  208. border: 1px solid #ccc;
  209. margin: 15px;
  210. }
  211. .projct_nav {
  212. margin-left: 5px;
  213. display: flex;
  214. flex-direction: column;
  215. flex-wrap: nowrap;
  216. justify-content: space-around;
  217. }
  218. .projct_nav > div:nth-child(1) {
  219. cursor: pointer;
  220. }
  221. .projct_nav > div{
  222. margin-bottom: 5px;
  223. }
  224. .myProject {
  225. padding: 20px 20px 10px 0;
  226. border-bottom: 1px solid #ccc;
  227. margin-left: 20px;
  228. width: 95%;
  229. }
  230. </style>