liveClassDetail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <el-page-header @back="onCancel" content="直播详情"></el-page-header>
  5. </h2>
  6. <div class="m-core">
  7. <div class="titleWrap">
  8. <h2 class="squrtTitle">
  9. <div class="squrt"></div>
  10. 直播数据
  11. </h2>
  12. <el-row class="row">
  13. <p class="teacherName">
  14. 主讲人:<span>{{ detail.speakerName }}</span>
  15. </p>
  16. <p class="teacherName sub">
  17. 主题:<span>{{ detail.roomTitle }}</span>
  18. </p>
  19. <el-button type="text" class="fontBtn"
  20. >直播回放 <i class="el-icon-video-play"></i
  21. ></el-button>
  22. </el-row>
  23. <p class="liveRemark">
  24. 直播内容:<span>{{ detail.liveRemark }}</span>
  25. </p>
  26. </div>
  27. <div class="infoWrap">
  28. <statistic class="statistic" :cols="0">
  29. <statistic-item>
  30. <span> 参与学员 </span>
  31. <span>{{ detail.totalLookNum }}</span>
  32. </statistic-item>
  33. <statistic-item>
  34. <span> 累计点赞 </span>
  35. <span>{{ detail.totalLikeNum }}</span>
  36. </statistic-item>
  37. <statistic-item>
  38. <span> 直播时长(分钟) </span>
  39. <span>{{ detail.totalLiveTime }}</span>
  40. </statistic-item>
  41. </statistic>
  42. </div>
  43. <save-form
  44. :inline="true"
  45. :model="searchForm"
  46. @submit="search"
  47. @reset="onReSet"
  48. >
  49. <el-form-item>
  50. <el-input
  51. v-model.trim="searchForm.search"
  52. clearable
  53. @keyup.enter.native="search"
  54. placeholder="直播间编号/标题"
  55. ></el-input>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button native-type="submit" type="primary">搜索</el-button>
  59. <el-button native-type="reset" type="danger">重置</el-button>
  60. </el-form-item>
  61. </save-form>
  62. <div class="tableWrap">
  63. <el-table
  64. style="width: 100%"
  65. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  66. :data="tableList"
  67. >
  68. <el-table-column
  69. align="center"
  70. prop="studentId"
  71. label="学员编号"
  72. ></el-table-column>
  73. <el-table-column
  74. align="center"
  75. prop="studentName"
  76. label="学员姓名"
  77. ></el-table-column>
  78. <el-table-column
  79. align="center"
  80. prop="phone"
  81. label="手机号"
  82. ></el-table-column>
  83. <el-table-column
  84. align="center"
  85. prop="subName"
  86. label="声部"
  87. ></el-table-column>
  88. <el-table-column
  89. align="center"
  90. prop="joinTime"
  91. label="进入时间"
  92. ></el-table-column>
  93. <el-table-column
  94. align="center"
  95. prop="totalViewTime"
  96. label="观看时长"
  97. ></el-table-column>
  98. </el-table>
  99. <pagination
  100. sync
  101. :total.sync="rules.total"
  102. :page.sync="rules.page"
  103. :limit.sync="rules.limit"
  104. :page-sizes="rules.page_size"
  105. @pagination="getList"
  106. />
  107. </div>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import pagination from "@/components/Pagination/index";
  113. import {
  114. getLiveBroadcastRoomDetail,
  115. getLiveBroadcastRoomDetailList,
  116. } from "./api";
  117. export default {
  118. components: { pagination },
  119. data() {
  120. return {
  121. searchForm: {},
  122. tableList: [],
  123. detail: {
  124. list: null,
  125. liveRemark: "",
  126. roomTitle: "",
  127. roomUid: "",
  128. speakerName: "",
  129. totalLikeNum: 0,
  130. totalLiveTime: 0,
  131. totalLookNum: 0,
  132. },
  133. rules: {
  134. // 分页规则
  135. limit: 10, // 限制显示条数
  136. page: 1, // 当前页
  137. total: 0, // 总条数
  138. page_size: [10, 20, 40, 50], // 选择限制显示条数
  139. },
  140. };
  141. },
  142. mounted() {
  143. this.getDetail();
  144. this.getList();
  145. },
  146. methods: {
  147. onCancel() {
  148. this.$router.push("/liveClassManager");
  149. this.$store.dispatch("delVisitedViews", this.$route);
  150. },
  151. search() {},
  152. onReSet() {},
  153. async getList() {
  154. try {
  155. let obj = {
  156. rows: this.rules.limit,
  157. page: this.rules.page,
  158. roomUid: this.$route.query.roomUid,
  159. search: this.searchForm.search,
  160. };
  161. const res = await getLiveBroadcastRoomDetailList(obj);
  162. this.tableList = res.data.rows;
  163. this.rules.total = res.data.total
  164. } catch (e) {
  165. console.log(e);
  166. }
  167. },
  168. async getDetail() {
  169. try {
  170. let obj = {
  171. roomUid: this.$route.query.roomUid,
  172. };
  173. const res = await getLiveBroadcastRoomDetail(obj);
  174. this.detail = {...res.data}
  175. } catch (e) {
  176. console.log(e);
  177. }
  178. },
  179. },
  180. };
  181. </script>
  182. <style lang="scss" scoped>
  183. .infoWrap {
  184. // width: 500px;
  185. }
  186. .sub.teacherName {
  187. margin-right: 10px;
  188. }
  189. .fontBtn {
  190. font-size: 18px;
  191. }
  192. .teacherName,
  193. .liveRemark {
  194. font-size: 16px;
  195. color: #222325;
  196. line-height: 30px;
  197. font-weight: 600;
  198. margin-right: 60px;
  199. span {
  200. color: #666666;
  201. font-weight: 400;
  202. }
  203. }
  204. .titleWrap {
  205. position: relative;
  206. // display: flex;
  207. // flex-direction: row;
  208. // align-items: center;
  209. padding: 5px;
  210. h2 {
  211. margin-right: 10px;
  212. }
  213. .squrtTitle {
  214. position: relative;
  215. font-size: 18px;
  216. font-family: PingFangSC-Medium, PingFang SC;
  217. font-weight: 600;
  218. color: #222325;
  219. line-height: 25px;
  220. margin-bottom: 25px;
  221. .squrt {
  222. position: absolute;
  223. left: -12px;
  224. top: 5px;
  225. width: 3px;
  226. height: 16px;
  227. background-color: var(--color-primary);
  228. }
  229. }
  230. .row {
  231. display: flex;
  232. flex-direction: row;
  233. align-items: center;
  234. }
  235. }
  236. .statistic .statistic-content > span {
  237. font-size: 16px;
  238. }
  239. </style>