import{_ as f,c as g,d as _}from"./icon_discount.535f7618.js";import{_ as h,a as T}from"./share-vip-tips.16c5753d.js";import{_ as v}from"./share-banner.3808bbad.js";import{_ as y}from"./wx_bg.cce2a6c0.js";import{d as w,w as o,f as l,g as p,A as u,v as d,n as c,D as b,y as D,j as s,E as I,B as S}from"./ResizeObserver.es.62ab429c.js";import{S as $}from"./index.7f3f7360.js";import{U}from"./index.58a086a9.js";import{C as x}from"./index.105e15bd.js";import{s as C}from"./share.d1ca65b8.js";import{G as N}from"./index.66bf1d0a.js";import"./index.d7a13e47.js";import"./index.e24f8570.js";import"./index.021584f9.js";import"./icon_teacher.40b6f077.js";import"./index.a6e5e68b.js";const H="_introduction_1vd6e_1",Y="_wxpopup_1vd6e_9";var m={"live-detail":"_live-detail_1vd6e_1",introduction:H,wxpopup:Y};const E=e=>{const t=`../images/${e}`;return{"../images/icon-cert.png":f,"../images/icon_discount.png":g,"../images/icon_music.png":_,"../images/music-share-banner.png":h,"../images/share-banner.png":v,"../images/share-vip-tips.png":T,"../images/wx_bg.png":y}[t].default};var J=w({name:"LiveDetail",data(){const e=this.$route.query;return{recomUserId:e.recomUserId,groupId:e.groupId,platform:e.p,live:{},wxStatus:!1}},computed:{userInfo(){var a,n;const e=this.live,t=e.planList||[],i=((a=t[0])==null?void 0:a.startTime)||new Date,r=((n=t[0])==null?void 0:n.endTime)||new Date;return{headUrl:e.avatar,username:e.userName,isDegree:!!e.degreeFlag,isTeacher:!!e.teacherFlag,id:e.teacherId,startTime:`${o(i).format("YYYY-MM-DD")} ${o(i).format("HH:mm")}~${o(r).format("HH:mm")}`||"",type:"live",courseStartTime:o(e.courseStartTime).format("YYYY-MM-DD HH:mm"),lessonPrice:e.coursePrice,buyNum:e.studentCount||0,lessonNum:e.courseNum||0,lessonDesc:e.courseIntroduce,lessonCoverUrl:e.backgroundPic||e.backgroundPicTemplate,lessonName:e.courseGroupName,auditVersion:0}},courseInfo(){const e=[],t=this.live;return(this.live.planList||[]).forEach(r=>{const a=r.startTime||new Date,n=r.endTime||new Date;e.push({courseTime:`${o(a).format("YYYY-MM-DD")} ${o(a).format("HH:mm")}~${o(n).format("HH:mm")}`,coursePlan:r.plan,teacherName:t.userName,subjectName:t.subjectName,roomUid:r.roomUid,liveState:r.liveState,id:r.courseId})}),e||[]}},created(){if(l().isApp)if(p.platformType==="STUDENT"){const e=this.$route.query;e.recomUserId=e.userType&&e.userType=="STUDENT"?"":e.recomUserId,l().ios?window.location.replace(`${u()}/student/#/groupDetail??${d.stringify(e)}`):(c({api:"openWebView",content:{url:`${u()}/student/#/groupDetail??${d.stringify(e)}`,orientation:1,isHideTitle:!1}}),c({api:"back"}))}else p.platformType==="TEACHER"&&b.alert({title:"\u63D0\u793A",message:"\u8BF7\u4F7F\u7528\u9177\u4E50\u79C0\u5B66\u751F\u7AEF\u626B\u7801\u6253\u5F00",confirmButtonColor:"#2dc7aa"}).then(()=>{c({api:"back"})});else this.reCall()},async mounted(){try{const e=await D.post("/api-teacher/open/liveShareProfit",{data:{bizId:this.groupId,userId:this.recomUserId}});this.live=e.data.liveCourseGroup||{}}catch{}},methods:{locationReplace(e){history.replaceState?(history.replaceState(null,document.title,e),window.location.reload()):location.replace(e)},reCall(){let e=u()+"/student/#/groupDetail";const t=this.$route.query;e+=`?recomUserId=${t.userType&&t.userType=="STUDENT"?"":this.recomUserId}&groupId=${t.groupId}&p=${t.p}`,C(e,{})},onShare(){if(l().weixin){this.wxStatus=!0;return}this.reCall(),setTimeout(()=>{window.location.href=u()+"/student/#/download"},3e3)}},render(){return s("div",{class:[m["live-detail"],"mb12"]},[s(U,{userInfo:this.userInfo,showBuy:!1},null),s($,{border:!0},{default:()=>[s("p",{class:m.introduction},[this.userInfo.lessonDesc])]}),s(N,{courseInfo:this.courseInfo},null),s(x,{position:"bottom"},{default:()=>[s("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[s(I,{block:!0,round:!0,type:"primary",onClick:this.onShare},{default:()=>[S("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B")]})])]}),this.wxStatus&&s("div",{class:m.wxpopup,onClick:()=>{this.wxStatus=!1}},[s("img",{src:E("wx_bg.png"),alt:""},null)])])}});export{J as default,E as getAssetsHomeFile};
