index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="live-config-container">
  3. <el-card class="box-card live-config-header">
  4. <div class="detail-header">
  5. <div class="header-left-area">
  6. <img :src="liveInfo.liveImgUrl" alt="直播封面">
  7. <!-- 加载遮罩 -->
  8. <div class="ss-loading-mask" style="display: none;">
  9. <div class="ss-loading-spinner is-module-loading">
  10. <div class="ss-loading-dot-flashing"></div>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="header-middle-area">
  15. <div class="live-info-title">
  16. <div class="title-text">{{ liveInfo.liveName }}</div>
  17. </div>
  18. <div class="live-info-desc">
  19. <div class="live-type">{{ liveInfo.liveType == 1 ? '视频直播' : '录播' }}</div>
  20. <div class="line"></div>
  21. <div class="live-mode">{{ liveInfo.showType == 1 ? '横屏' : '竖屏' }}</div>
  22. <div class="big-screen-info">
  23. <div class="dataLarge">
  24. <a class="dataLarge__screen ss-popover__reference" aria-describedby="ss-popover-7614" tabindex="0" data-auth-id="818">
  25. <span class="dataLarge__screen__icon"></span>
  26. <span class="dataLarge__screen__txt">实时大屏</span>
  27. </a>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="live-info-state">
  32. <div class="info-state-text live-time">直播时间:{{ liveInfo.startTime }} 至 {{ liveInfo.finishTime }}</div>
  33. <div class="line"></div>
  34. <div class="info-state-text live-state">{{ liveInfo.status == 3 ? '已结束' : liveInfo.status == 2 ? '直播中' : '未开始'}}</div>
  35. <div class="line"></div>
  36. <div class="info-state-text live-active-state">{{ liveInfo.isShow == 1 ? '上架' : '下架' }}</div>
  37. <div class="line"></div>
  38. </div>
  39. </div>
  40. </div>
  41. </el-card>
  42. <el-card class="box-card live-config-left">
  43. <div class="container">
  44. <!-- 左边菜单 -->
  45. <div class="left-menu">
  46. <el-menu default-active="1" class="el-menu-vertical-demo" @select="handleSelect">
  47. <el-menu-item :index="item.index" v-for="item in menuList" >
  48. <span>{{item.name}}</span>
  49. </el-menu-item>
  50. </el-menu>
  51. </div>
  52. <!-- 右边信息 -->
  53. <div class="right-info">
  54. <!-- 动态组件 -->
  55. <component :is="currentComponent" ></component>
  56. </div>
  57. </div>
  58. </el-card>
  59. </div>
  60. </template>
  61. <script>
  62. import WatchReward from './watchReward.vue';
  63. import Answer from './answer.vue';
  64. import Goods from './goods.vue';
  65. import IdCard from './idCard.vue';
  66. import Task from './task.vue';
  67. import LiveRedConf from './liveRedConf.vue'
  68. import LiveLotteryConf from './liveLotteryConf.vue'
  69. import LiveReplay from './liveReplay.vue'
  70. import Preview from './preview.vue'
  71. import LiveCoupon from './liveCoupon.vue'
  72. import Barrage from './barrage.vue'
  73. import { listLive, getLive, delLive, addLive, updateLive, exportLive,selectCompanyTalent,handleShelfOrUn,handleDeleteSelected } from "@/api/live/live";
  74. export default {
  75. name: 'LiveConfig',
  76. components: {
  77. WatchReward,
  78. LiveRedConf,
  79. LiveLotteryConf,
  80. LiveReplay,
  81. Answer,
  82. Goods,
  83. IdCard,
  84. Task,
  85. LiveCoupon,
  86. Barrage,
  87. Preview
  88. },
  89. data() {
  90. return {
  91. activeTab: 'watchReward',
  92. liveId: null,
  93. liveInfo: {},
  94. currentComponent: WatchReward,
  95. menuList:[
  96. { name: '观看奖励', label: '观看奖励', index: 'watchReward'},
  97. { name: '直播预告', label: '直播预告', index: 'preview'},
  98. { name: '红包配置', label: '红包配置', index: 'liveRedConf'},
  99. { name: '抽奖配置', label: '抽奖配置', index: 'liveLotteryConf'},
  100. { name: '优惠券配置', label: '优惠券配置', index: 'liveCoupon'},
  101. // { name: '答题', label: '答题', index: 'answer'},
  102. { name: '直播商品', label: '直播商品', index: 'goods'},
  103. { name: '回放设置', label: '回放设置', index: 'liveReplay'},
  104. { name: '运营自动化', label: '运营自动化', index: 'task'},
  105. { name: '弹幕脚本', label: '弹幕脚本', index: 'barrage'},
  106. { name: '身份认证', label: '身份认证', index: 'idCard'},
  107. ],
  108. }
  109. },
  110. created() {
  111. this.liveId = this.$route.params.liveId
  112. this.getLiving()
  113. },
  114. methods: {
  115. handleSelect(index){
  116. this.currentComponent = index; // 切换当前显示的组件
  117. },
  118. getLiving() {
  119. getLive(this.liveId).then(res => {
  120. this.liveInfo = res.data
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <style scoped>
  127. .el-tabs__header .is-top {
  128. display: none !important;
  129. }
  130. .live-config-header{
  131. padding: 5px;
  132. border: 1px solid #ebeef5;
  133. }
  134. .detail-header {
  135. display: flex;
  136. padding: 20px;
  137. border-bottom: 1px solid #ebeef5;
  138. }
  139. .header-left-area {
  140. flex: 0 0 120px;
  141. position: relative;
  142. }
  143. .header-left-area img {
  144. width: 100px;
  145. height: 100px;
  146. border-radius: 4px;
  147. }
  148. .header-middle-area {
  149. flex: 1;
  150. padding: 0 20px;
  151. }
  152. .header-right-area {
  153. flex: 0 0 200px;
  154. }
  155. .live-info-title .title-text {
  156. font-size: 20px;
  157. font-weight: 500;
  158. color: #303133;
  159. }
  160. .live-info-desc {
  161. display: flex;
  162. align-items: center;
  163. margin-top: 10px;
  164. }
  165. .live-info-desc .line {
  166. width: 1px;
  167. height: 12px;
  168. background: #c0c4cc;
  169. margin: 0 10px;
  170. }
  171. .live-info-state {
  172. display: flex;
  173. align-items: center;
  174. margin-top: 10px;
  175. }
  176. .live-info-state .line {
  177. width: 1px;
  178. height: 12px;
  179. background: #c0c4cc;
  180. margin: 0 10px;
  181. }
  182. .live-state-dot {
  183. width: 8px;
  184. height: 8px;
  185. border-radius: 50%;
  186. }
  187. .live-state-dot-liveEnd {
  188. background: #909399;
  189. }
  190. .info-state-text {
  191. font-size: 14px;
  192. color: #606266;
  193. }
  194. .operation-wrapper {
  195. display: flex;
  196. align-items: center;
  197. }
  198. .operation-item {
  199. display: flex;
  200. flex-direction: column;
  201. align-items: center;
  202. cursor: pointer;
  203. }
  204. .operation-item-text {
  205. font-size: 12px;
  206. color: #606266;
  207. margin-top: 4px;
  208. }
  209. .operation-wrapper .line {
  210. width: 1px;
  211. height: 20px;
  212. background: #c0c4cc;
  213. margin: 0 10px;
  214. }
  215. .container {
  216. display: flex;
  217. height: 100%;
  218. }
  219. .left-menu {
  220. width: 200px;
  221. border-right: 1px solid #e4e7ed;
  222. flex-shrink: 0; /* 不收缩 */
  223. }
  224. .right-info {
  225. flex: 1;
  226. padding: 20px;
  227. }
  228. .right-tabs {
  229. height: 100%;
  230. }
  231. </style>