import{_ as g,c as _,d as h}from"./icon_discount.535f7618.js";import{_ as v,a as T}from"./share-vip-tips.16c5753d.js";import{_ as y}from"./share-banner.3808bbad.js";import{_ as w}from"./wx_bg.cce2a6c0.js";import{d as b,w as r,f as l,g as m,A as n,v as d,n as u,D,y as I,j as t,E as S,B as C}from"./ResizeObserver.es.62ab429c.js";import{C as $}from"./index.d707363d.js";import{S as f}from"./index.7f3f7360.js";import{U}from"./index.58a086a9.js";import{C as x}from"./index.105e15bd.js";import{s as H}from"./share.d1ca65b8.js";import"./index.4b0cb3c8.js";/* empty css             */import"./tcplayer.v4.8.0.min.87d92d44.js";import"./index.d7a13e47.js";import"./index.e24f8570.js";import"./index.021584f9.js";import"./icon_teacher.40b6f077.js";import"./index.a6e5e68b.js";const N="_introduction_1vd6e_1",E="_wxpopup_1vd6e_9";var c={"live-detail":"_live-detail_1vd6e_1",introduction:N,wxpopup:E};const P=e=>{const s=`../images/${e}`;return{"../images/icon-cert.png":g,"../images/icon_discount.png":_,"../images/icon_music.png":h,"../images/music-share-banner.png":v,"../images/share-banner.png":y,"../images/share-vip-tips.png":T,"../images/wx_bg.png":w}[s].default};var X=b({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,p;const e=this.live,s=e.planList||[],o=((i=s[0])==null?void 0:i.startTime)||new Date,a=((p=s[0])==null?void 0:p.endTime)||new Date;return{headUrl:e.avatar,username:e.userName,isDegree:!!e.degreeFlag,isTeacher:!!e.teacherFlag,id:e.teacherId,startTime:`${r(o).format("YYYY-MM-DD")} ${r(o).format("HH:mm")}~${r(a).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=[];return(this.live.planList||[]).forEach(o=>{const a=o.startTime||new Date,i=o.endTime||new Date;e.push({courseTime:`${r(a).format("YYYY-MM-DD")} ${r(a).format("HH:mm")}~${r(i).format("HH:mm")}`,coursePlan:o.plan,roomUid:o.roomUid,liveState:o.liveState,id:o.courseId})}),e||[]}},created(){if(l().isApp)if(m.platformType==="STUDENT"){const e=this.$route.query;e.recomUserId=e.userType&&e.userType=="STUDENT"?"":e.recomUserId,l().ios?window.location.replace(`${n()}/student/#/liveDetail??${d.stringify(e)}`):(u({api:"openWebView",content:{url:`${n()}/student/#/liveDetail??${d.stringify(e)}`,orientation:1,isHideTitle:!1}}),u({api:"back"}))}else m.platformType==="TEACHER"&&D.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 I.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=n()+"/student/#/liveDetail";const s=this.$route.query;e+=`?recomUserId=${s.userType&&s.userType=="STUDENT"?"":this.recomUserId}&groupId=${s.groupId}&p=${s.p}`,H(e,{})},onShare(){if(l().weixin){this.wxStatus=!0;return}this.reCall(),setTimeout(()=>{window.location.href=n()+"/student/#/download"},3e3)}},render(){return t("div",{class:[c["live-detail"],"mb12"]},[t(U,{userInfo:this.userInfo,showBuy:!1},null),t(f,{border:!0},{default:()=>[t("p",{class:c.introduction},[this.userInfo.lessonDesc])]}),t(f,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},{default:()=>[t($,{courseInfo:this.courseInfo,hideVideo:!0},null)]}),t(x,{position:"bottom"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(S,{block:!0,round:!0,type:"primary",onClick:this.onShare},{default:()=>[C("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B")]})])]}),this.wxStatus&&t("div",{class:c.wxpopup,onClick:()=>{this.wxStatus=!1}},[t("img",{src:P("wx_bg.png"),alt:""},null)])])}});export{X as default,P as getAssetsHomeFile};
