1 |
- import{d as g,u as i,w as u,g as f,n as I,T as n,j as t,C as T,F as y,B as l,z as c,aR as S}from"./index.e6d6174e.js";import{C as v}from"./index.80fb0739.js";import{S as m}from"./index.884a0e76.js";import{U as L}from"./index.af98ec6d.js";import{U as C}from"./index.4fe76fee.js";import{C as N}from"./index.88fe9143.js";import{C as d}from"./index.b0eda115.js";import{L as U}from"./live-item.7738586b.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as D,a as b}from"./index.54627972.js";import"./index.4a53da74.js";import"./plyr.623e6d1e.js";import"./index.af99cf22.js";import"./index.4aea64de.js";import"./index.67c54471.js";import"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./icon_student.bbb32387.js";import"./code-down-load.3acfa024.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";import"./use-id.f239f36f.js";import"./use-tab-status.e9ba8498.js";import"./use-refs.eb803454.js";const k="_introduction_1bpz3_1",P="_shareCourse_1bpz3_9";var p={"live-detail":"_live-detail_1bpz3_1",introduction:k,shareCourse:P},re=g({name:"LiveDetail",data(){const e=this.$route.query;return{share:e.share,joinRoom:e.joinRoom,groupId:e.groupId,courseId:e.classId,live:{},shareStatus:!1,shareUrl:"",myself:!1}},computed:{userInfo(){var a,h;const e=this.live,s=e.planList||[],r=((a=s[0])==null?void 0:a.startTime)||new Date,o=((h=s[0])==null?void 0:h.endTime)||new Date;return{headUrl:e.avatar,avatar:e.avatar,username:e.userName,id:e.teacherId,startTime:`${i(r).format("YYYY-MM-DD")} ${i(r).format("HH:mm")}~${i(o).format("HH:mm")}`||"",lessonPrice:e.coursePrice,buyNum:e.studentCount||0,lessonId:e.courseGroupId,lessonNum:e.courseNum||0,lessonDesc:e.courseIntroduce,lessonCoverUrl:e.backgroundPic||e.backgroundPicTemplate,lessonName:e.courseGroupName,subjectName:e.subjectName,courseStartTime:e.courseStartTime,auditVersion:e.auditVersion||0,isDegree:!!e.degreeFlag,isTeacher:!!e.teacherFlag}},courseInfo(){const e=[];return(this.live.planList||[]).forEach(r=>{const o=r.startTime||new Date,a=r.endTime||new Date;e.push({courseTime:`${i(o).format("YYYY-MM-DD")} ${i(o).format("HH:mm")}~${i(a).format("HH:mm")}`,coursePlan:r.plan,roomUid:r.roomUid,liveState:r.liveState,id:r.courseId})}),e||[]},liveStatus(){const e=this.live.planList||[],s={status:!1,liveStatus:0,roomUid:""};return e.forEach(r=>{r.courseId===Number(this.courseId)&&(s.status=!0,s.liveStatus=r.liveStatus,s.roomUid=r.roomUid)}),s},studentList(){return this.live.studentList||[]},courseOffStatus(){const e=this.live;let s=!1;return(e.status==="APPLY"&&e.studentList.length===0||e.status==="NOT_SALE")&&(s=!0),s}},async mounted(){var e;try{const s=await u.get("/api-teacher/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}});this.live=s.data||{},f.platformType==="TEACHER"&&(this.myself=!s.data.myself),this.shareUrl=`${location.origin}/teacher/#/shareLive?recomUserId=${(e=f.user.data)==null?void 0:e.userId}&groupId=${this.groupId}`}catch{}},methods:{async onJoinRoom(){try{const r=((await u.get("/api-teacher/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}})).data||{}).planList||[];let o={};r.forEach(a=>{a.courseId===Number(this.courseId)&&(o=a)}),o&&o.liveState===1?I({api:"joinLiveRoom",content:{roomId:o.roomUid,teacherId:this.live.teacherId}}):o&&o.liveState===2?setTimeout(()=>{n("\u8BFE\u7A0B\u5DF2\u7ED3\u675F")},100):setTimeout(()=>{n("\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019")},100)}catch{}},async cancelCourseGroup(){try{await u.get("/api-teacher/courseGroup/cancelCourseGroup",{params:{groupId:this.groupId}}),n("\u53D6\u6D88\u8BFE\u7A0B\u6210\u529F"),setTimeout(()=>{I({api:"back",content:{}})},500)}catch{}}},render(){return t("div",{class:[p["live-detail"],"mb12"]},[t(L,{userInfo:this.userInfo},null),t(m,{border:!0},{default:()=>[t("p",{class:p.introduction},[this.userInfo.lessonDesc])]}),this.myself?t(m,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},{default:()=>[t(v,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}):t(m,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",titleShow:!1,contentStyle:{paddingTop:"0"}},{default:()=>[t(D,{color:"var(--van-primary)",lineWidth:20,sticky:!0},{default:()=>[t(b,{title:"\u8BFE\u7A0B",titleClass:"van-hairline--bottom"},{default:()=>[t(v,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}),t(b,{title:"\u5B66\u5458\u5217\u8868",titleClass:"van-hairline--bottom"},{default:()=>[this.studentList.map(e=>t(C,{class:"mb12",users:{avatar:e.avatar,studentId:e.studentId,studentName:e.userName,createTime:e.createTime}},null)),this.studentList.length===0&&t(T,{tips:"\u6682\u65E0\u8D2D\u4E70\u5B66\u5458",classImgSize:"SMALL",btnStatus:!1},null)]})]})]}),this.live.status!=="OUT_SALE"&&t(y,null,[this.courseOffStatus&&t(d,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(l,{block:!0,round:!0,type:"primary",onClick:this.cancelCourseGroup},{default:()=>[c("\u53D6\u6D88\u8BFE\u7A0B")]})])]}),this.joinRoom=="1"&&this.liveStatus.liveStatus!==2&&t(d,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(l,{block:!0,round:!0,type:"primary",onClick:this.onJoinRoom},{default:()=>[c("\u8FDB\u5165\u76F4\u64AD\u95F4")]})])]}),this.share=="1"&&this.courseInfo.length>0&&t(d,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(l,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[c("\u5206\u4EAB")]})])]})]),t(S,{show:this.shareStatus,"onUpdate:show":e=>this.shareStatus=e,style:{background:"transparent"}},{default:()=>[t(N,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"live"},{default:()=>[t(U,{class:p.shareCourse,liveInfo:{backgroundPic:this.userInfo.lessonCoverUrl,courseGroupId:this.userInfo.lessonId,courseGroupName:this.userInfo.lessonName,courseNum:this.userInfo.lessonNum,coursePrice:this.userInfo.lessonPrice,teacherName:this.userInfo.username,teacherId:this.userInfo.id,avatar:this.userInfo.avatar,studentCount:this.userInfo.buyNum,courseStartTime:this.userInfo.courseStartTime,existBuy:0,subjectName:this.userInfo.subjectName}},null)]})]})])}});export{re as default};
|