import{d as Y,u as i,g as n,w as d,n as v,T as h,D as m,j as r,f as E,M as g,z as c,B as I,aR as F}from"./index.394decd7.js";import{C as y}from"./index.f65267e5.js";import{S as f}from"./index.63f283ba.js";import{U as D}from"./index.6c72fde6.js";import{o as u,a as b}from"./orderStatus.535346ee.js";import{C as T}from"./index.e6e212d8.js";import{C as A}from"./index.45d094fa.js";import{C as U}from"./index.52a60bda.js";import{L as B}from"./live-item.d72fb44d.js";import{i as C}from"./icon-share.4e09e300.js";import"./index.f53ab473.js";import"./plyr.623e6d1e.js";import"./index.9e0d46e4.js";import"./index.9462d7c5.js";import"./index.ae2dd816.js";import"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./index.f1b52763.js";import"./code-down-load.37c8e9cc.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const N="_introduction_13imh_1",S="_tips_13imh_12",P="_btnMore_13imh_35",j="_shareCourse_13imh_42";var l={"live-detail":"_live-detail_13imh_1",introduction:N,tips:S,btnMore:P,shareCourse:j},L="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAAXNSR0IArs4c6QAAASNQTFRFAAAA/wAA/4AA/6pV/5kz/4Ar/4BA/49A/445/4BA/4xA/4VD/4pA/4U9/4lA/4g7/4M+/4Y5/4Y9/4VA/4g+/4U9/4g8/4Y8/4Q+/4U//4U9/4g8/4Y+/4c9/4Y9/4c8/4c+/4c+/4U9/4Y+/4Y9/4Y8/4c+/4Y+/4c9/4Y9/4Y8/4Y9/4c9/4Y9/4Y8/4Y+/4U+/4U9/4c9/4Y8/4U+/4Y9/4c8/4Y8/4Y+/4Y9/4Y+/4c+/4c9/4Y9/4c+/4Y9/4Y9/4Y8/4c9/4Y9/4Y8/4Y9/4U9/4c9/4Y8/4c9/4Y9/4Y9/4Y9/4c9/4Y8/4Y+/4Y9/4Y9/4U8/4Y9/4Y9/4Y9/4Y8/4Y9/4Y9/4Y8/4Y9/4Y9/4Y9/4c9/4Y8/4Y9/4Y9qWZ60gAAAGB0Uk5TAAECAwUGEBASFBQXGBkcHiUoKiwtLi83OkFLTU5TVFVXYmRnaXJzdH1+h42Ok5SUlZeXmJmgoaWlp6qusLGys7u+w8rL0NbW19jZ3d7j5OTn7O3t8vP19/j5+fr7/P3+TBv5LQAAAThJREFUOMvF1OszQkEYx/FK6KakXMpBSDfkknIJSYUuKIVOl+P7//8VXmiOc057mDHTeF7t85vP7uzu7KzFMrE6eY3/jhQebD8Lf7IMdMtJvynx5oaMapjzik2oBdxnEonjO6AVEhmpD4Wlr/HiNfSlcRPsIG99t5tdOkGjsZb4WNcGawolqwFFYE+f7ELEgIq0Z/XJzAtFfeIYkDHu4IiBQxeEYewwEoR1QRTGzhKAqC6IgceIPBDTBXFwG5Eb4v+JUmKU0rS2LGJE1qa9AKXpNCJnU9FeQpW6T/TEfHWqatMjLX6saXrquEHNJTKuGg21SYD8LCgZkiqyX2JSV3bNwqvpU0EdSNY//QJzGwujidMr2/MmqA7tm7P9w4vbN3g0QUXtjvMmaGo5lq88vcutyvlOYEIf2ydPMlkWBCFozgAAAABJRU5ErkJggg==",se=Y({name:"LiveDetail",data(){const e=this.$route.query;return{joinRoom:e.joinRoom,recomUserId:e.recomUserId,groupId:e.groupId,courseId:e.classId,platform:e.p,live:{},shareStatus:!1,shareUrl:""}},computed:{userInfo(){var a,p;const e=this.live;console.log("live",e);const o=e.planList||[],t=((a=o[0])==null?void 0:a.startTime)||new Date,s=((p=o[0])==null?void 0:p.endTime)||new Date;return{avatar:e.avatar,headUrl:e.avatar,username:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,id:e.teacherId,startTime:`${i(t).format("YYYY-MM-DD")} ${i(t).format("HH:mm")}~${i(s).format("HH:mm")}`||"",buyNum:e.studentCount,lessonId:e.courseGroupId,lessonPrice:e.coursePrice,lessonNum:e.courseNum,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}},platformStatus(){const e=n.user.data,o=this.$route.query;return e.tenantId>0&&o.p=="tenant"},courseInfo(){const e=[];return(this.live.planList||[]).forEach(t=>{const s=t.startTime||new Date,a=t.endTime||new Date;e.push({courseTime:`${i(s).format("YYYY-MM-DD")} ${i(s).format("HH:mm")}~${i(a).format("HH:mm")}`,coursePlan:t.plan,roomUid:t.roomUid,liveState:t.liveState,id:t.courseId})}),e||[]},salesEndDate(){const e=this.live;return i(e.salesEndDate||new Date).format("YYYY-MM-DD")},liveStatus(){const e=this.live.planList||[],o={status:!1,liveStatus:0,roomUid:""};return e.forEach(t=>{t.courseId===Number(this.courseId)&&(o.status=!0,o.liveStatus=t.liveStatus,o.roomUid=t.roomUid)}),o}},async mounted(){var e,o;await this._init(),/(localhost|192)/g.test(location.origin)?this.shareUrl=`https://dev.colexiu.com/teacher/#/shareLive?recomUserId=${(e=n.user.data)==null?void 0:e.userId}&groupId=${this.groupId}&userType=${n.platformType}&p=tenant`:this.shareUrl=`${location.origin}/teacher/#/shareLive?recomUserId=${(o=n.user.data)==null?void 0:o.userId}&groupId=${this.groupId}&userType=${n.platformType}&p=tenant`},methods:{async _init(){try{const e=await d.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}});this.live=e.data||{}}catch{}},async onJoinRoom(){try{const t=((await d.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}})).data||{}).planList||[];let s={};t.forEach(a=>{a.courseId===Number(this.courseId)&&(s=a)}),console.log(s,this.live,"tempObj"),s&&s.liveState===1?v({api:"joinLiveRoom",content:{roomId:s.roomUid,teacherId:this.live.teacherId}}):s&&s.liveState===2?setTimeout(()=>{h("\u8BFE\u7A0B\u5DF2\u7ED3\u675F")},100):setTimeout(()=>{h("\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019")},100)}catch{}},async onBuy(){try{const e=this.live;if(u.orderObject.orderType="LIVE",u.orderObject.orderName="\u76F4\u64AD\u8BFE\u8D2D\u4E70",u.orderObject.orderDesc="\u76F4\u64AD\u8BFE\u8D2D\u4E70",u.orderObject.actualPrice=e.coursePrice,u.orderObject.recomUserId=this.recomUserId,u.orderObject.orderNo="",u.orderObject.orderList=[{orderType:"LIVE",goodsName:"\u76F4\u64AD\u8BFE\u8D2D\u4E70",courseGroupId:e.courseGroupId,courseGroupName:e.courseGroupName,coursePrice:e.coursePrice,teacherName:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,teacherId:e.teacherId,avatar:e.avatar,courseInfo:this.courseInfo,recomUserId:this.recomUserId}],e.coursePrice<=0){await b(()=>{m.alert({message:"\u9886\u53D6\u6210\u529F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"#2dc7aa"}).then(()=>{this._init()})});return}const t=(await d.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"LIVE",bizId:this.groupId}})).data;t?m.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{u.orderObject.orderNo=t.orderNo,u.orderObject.actualPrice=t.actualPrice,u.orderObject.discountPrice=t.discountPrice,u.orderObject.paymentConfig={...t.paymentConfig,paymentVendor:t.paymentVendor,paymentVersion:t.paymentVersion},this.routerTo()}).catch(()=>{m.close(),this.cancelPayment(t.orderNo)}):this.routerTo()}catch{}},routerTo(){const e=this.live;this.$router.push({path:"/orderDetail",query:{orderType:"LIVE",courseGroupId:e.courseGroupId}})},async cancelPayment(e){try{await d.post("/api-student/userOrder/orderCancel",{data:{orderNo:e}})}catch{}}},render(){return r("div",{class:[l["live-detail"],"mb12"]},[r(T,null,{right:()=>r("img",{src:C,onClick:()=>this.shareStatus=!0},null)}),r(D,{userInfo:this.userInfo,showBuy:!1,onUserDetail:e=>{n.platformType==="STUDENT"&&E().isApp&&this.$router.push({path:"/teacherHome",query:{teacherId:e.id,tabs:"live"}})}},null),r(f,{border:!0},{default:()=>[r("p",{class:l.introduction},[this.userInfo.lessonDesc])]}),r(f,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0,contentStyle:{paddingTop:"0"}},{default:()=>[this.courseInfo.length>0&&r(y,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}),r("div",{class:l.tips},[r("h3",null,[r(g,{name:L,size:15},null),c("\u6E29\u99A8\u63D0\u793A")]),r("p",null,[c("1\u3001\u8BE5\u76F4\u64AD\u8BFE\u7A0B\u9500\u552E\u622A\u6B62\u540E\uFF0C\u62A5\u540D\u4EBA\u6570\u82E5\u5C11\u4E8E"),this.live.mixStudentNum||0,c("\u4EBA\u5C06\u53D6\u6D88\u5F00\u8BFE\uFF0C\u5DF2\u8D2D\u4E70\u5B66\u5458\u4ED8\u8D39\u91D1\u989D\u5C06\u81EA\u52A8\u8FD4\u8FD8\uFF0C\u8BF7\u60A8\u653E\u5FC3\u8D2D\u4E70\uFF1B"),r("br",null,null),c("2\u3001\u76F4\u64AD\u8BFE\u6559\u5B66\u8BA1\u5212\u4E2D\u7684\u4E0A\u8BFE\u65F6\u95F4\u4E3A\u8001\u5E08\u9884\u8BA1\u65F6\u95F4\uFF0C\u5B9E\u9645\u4E0A\u8BFE\u65F6\u95F4\u4EE5\u8001\u5E08\u5F00\u542F\u76F4\u64AD\u65F6\u95F4\u4E3A\u51C6\uFF1B"),r("br",null,null),c("3\u3001\u82E5\u60A8\u9519\u8FC7\u8001\u5E08\u76F4\u64AD\uFF0C\u53EF\u901A\u8FC7\u89C6\u9891\u56DE\u653E\u89C2\u770B\u5B8C\u6574\u8BFE\u7A0B\u3002")])]),this.courseInfo.length>0&&this.live.existBuy!==1&&r(A,{position:"bottom",background:"white"},{default:()=>[r("div",{class:["btnGroup",l.btnMore]},[r(I,{block:!0,round:!0,type:"primary",onClick:this.onBuy,disabled:this.platformStatus},{default:()=>[this.live.coursePrice<=0?"\u514D\u8D39\u9886\u53D6":"\u7ACB\u5373\u8D2D\u4E70"]})])]}),this.joinRoom=="1"&&this.liveStatus.liveStatus!==2&&r(A,{position:"bottom",background:"white"},{default:()=>[r("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[r(I,{block:!0,round:!0,type:"primary",onClick:this.onJoinRoom},{default:()=>[c("\u8FDB\u5165\u76F4\u64AD\u95F4")]})])]}),r(F,{show:this.shareStatus,"onUpdate:show":e=>this.shareStatus=e,style:{background:"transparent"}},{default:()=>[r(U,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"live"},{default:()=>[r(B,{class:l.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};