liveRoom.vue 6.0 KB

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