import{_ as d,c as g,d as f}from"./icon_discount.535f7618.js";import{_,a as h}from"./share-vip-tips.16c5753d.js";import{_ as T}from"./share-banner.3808bbad.js";import{_ as v}from"./wx_bg.cce2a6c0.js";import{d as y,w as a,f as l,g as p,v as m,n as u,D as w,y as b,j as o,B as D,A as I}from"./ResizeObserver.es.b7226882.js";import{S}from"./index.a841fff0.js";import{U as $}from"./index.2798762e.js";import{C as U}from"./index.0b42adfa.js";import{s as x}from"./share.3859aca0.js";import{G as C}from"./index.58e0f077.js";import"./index.40f703b6.js";import"./index.9269bf1e.js";import"./index.20c0f4c5.js";import"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./index.1eaf642c.js";const N="_introduction_1vd6e_1",H="_wxpopup_1vd6e_9";var c={"live-detail":"_live-detail_1vd6e_1",introduction:N,wxpopup:H};const E=e=>{const t=`../images/${e}`;return{"../images/icon-cert.png":d,"../images/icon_discount.png":g,"../images/icon_music.png":f,"../images/music-share-banner.png":_,"../images/share-banner.png":T,"../images/share-vip-tips.png":h,"../images/wx_bg.png":v}[t].default};var K=y({name:"LiveDetail",data(){const e=this.$route.query;return{recomUserId:e.recomUserId,groupId:e.groupId,platform:e.p,live:{},wxStatus:!1}},computed:{userInfo(){var i,n;const e=this.live,t=e.planList||[],s=((i=t[0])==null?void 0:i.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:`${a(s).format("YYYY-MM-DD")} ${a(s).format("HH:mm")}~${a(r).format("HH:mm")}`||"",type:"live",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 i=r.startTime||new Date,n=r.endTime||new Date;e.push({courseTime:`${a(i).format("YYYY-MM-DD")} ${a(i).format("HH:mm")}~${a(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(`${location.origin}/student/#/groupDetail??${m.stringify(e)}`):(u({api:"openWebView",content:{url:`${location.origin}/student/#/groupDetail??${m.stringify(e)}`,orientation:1,isHideTitle:!1}}),u({api:"back"}))}else p.platformType==="TEACHER"&&w.alert({title:"\u63D0\u793A",message:"\u8BF7\u4F7F\u7528\u9177\u4E50\u79C0\u5B66\u751F\u7AEF\u626B\u7801\u6253\u5F00",confirmButtonColor:"#2dc7aa"}).then(()=>{u({api:"back"})});else this.reCall()},async mounted(){try{const e=await b.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(){const{origin:e}=location;let t=e+"/student/#/groupDetail";const s=this.$route.query;t+=`?recomUserId=${s.userType&&s.userType=="STUDENT"?"":this.recomUserId}&groupId=${s.groupId}&p=${s.p}`,x(t,{})},onShare(){if(l().weixin){this.wxStatus=!0;return}this.reCall(),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)}},render(){return o("div",{class:[c["live-detail"],"mb12"]},[o($,{userInfo:this.userInfo,showBuy:!1},null),o(S,{border:!0},{default:()=>[o("p",{class:c.introduction},[this.userInfo.lessonDesc])]}),o(C,{courseInfo:this.courseInfo},null),o(U,{position:"bottom"},{default:()=>[o("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[o(D,{block:!0,round:!0,type:"primary",onClick:this.onShare},{default:()=>[I("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B")]})])]}),this.wxStatus&&o("div",{class:c.wxpopup,onClick:()=>{this.wxStatus=!1}},[o("img",{src:E("wx_bg.png"),alt:""},null)])])}});export{K as default,E as getAssetsHomeFile};