1 |
- import{C as f}from"./index.b068f0f0.js";import{S as u}from"./index.cdcb8b18.js";import{U as T}from"./index.bf2a894b.js";import{U as g}from"./index.d4124222.js";import{d as y,x as i,e as n,s as I,p as v,T as l,i as t,C as S,F as L,B as c,A as m,aT as C}from"./index.6b776f4b.js";import{C as N}from"./index.f8224084.js";import{C as d}from"./index.5070a0ba.js";import{L as U}from"./live-item.07457117.js";import"./index.998c3386.js";import"./index.570314c1.js";import{T as D,a as b}from"./index.21339447.js";import"./index.1032b0ae.js";import"./plyr.623e6d1e.js";import"./index.7486196c.js";import"./index.aa464e80.js";import"./index.7cc0b0e7.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.ece1391b.js";import"./logo.bcac726b.js";import"./browser.ff6962bf.js";import"./use-id.40b6af6b.js";import"./use-tab-status.ad41a764.js";import"./use-refs.a68d4385.js";const k="_introduction_1bpz3_1",P="_shareCourse_1bpz3_9";var p={"live-detail":"_live-detail_1bpz3_1",introduction:k,shareCourse:P},se=y({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 n.get("/api-teacher/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}});this.live=s.data||{},I.platformType==="TEACHER"&&(this.myself=!s.data.myself),this.shareUrl=`${location.origin}/teacher/#/shareLive?recomUserId=${(e=I.user.data)==null?void 0:e.userId}&groupId=${this.groupId}`}catch{}},methods:{async onJoinRoom(){try{const r=((await n.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?v({api:"joinLiveRoom",content:{roomId:o.roomUid,teacherId:this.live.teacherId}}):o&&o.liveState===2?setTimeout(()=>{l("\u8BFE\u7A0B\u5DF2\u7ED3\u675F")},100):setTimeout(()=>{l("\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019")},100)}catch{}},async cancelCourseGroup(){try{await n.get("/api-teacher/courseGroup/cancelCourseGroup",{params:{groupId:this.groupId}}),l("\u53D6\u6D88\u8BFE\u7A0B\u6210\u529F"),setTimeout(()=>{v({api:"back",content:{}})},500)}catch{}}},render(){return t("div",{class:[p["live-detail"],"mb12"]},[t(T,{userInfo:this.userInfo},null),t(u,{border:!0},{default:()=>[t("p",{class:p.introduction},[this.userInfo.lessonDesc])]}),this.myself?t(u,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},{default:()=>[t(f,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}):t(u,{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(f,{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(g,{class:"mb12",users:{avatar:e.avatar,studentId:e.studentId,studentName:e.userName,createTime:e.createTime}},null)),this.studentList.length===0&&t(S,{tips:"\u6682\u65E0\u8D2D\u4E70\u5B66\u5458",classImgSize:"SMALL",btnStatus:!1},null)]})]})]}),this.live.status!=="OUT_SALE"&&t(L,null,[this.courseOffStatus&&t(d,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(c,{block:!0,round:!0,type:"primary",onClick:this.cancelCourseGroup},{default:()=>[m("\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(c,{block:!0,round:!0,type:"primary",onClick:this.onJoinRoom},{default:()=>[m("\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(c,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[m("\u5206\u4EAB")]})])]})]),t(C,{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{se as default};
|