import{_ as f,c as g,d as _}from"./icon_discount.535f7618.js";import{_ as h,a as v}from"./share-vip-tips.16c5753d.js";import{_ as T}from"./share-banner.3808bbad.js";import{_ as y}from"./wx_bg.cce2a6c0.js";import{d as w,w as s,f as n,g as p,v as m,n as l,D as b,y as D,j as o,B as I,A as S}from"./ResizeObserver.es.f28023e0.js";import{C}from"./index.b5a4aa90.js";import{S as d}from"./index.07a2a95f.js";import{U as $}from"./index.d9fd7ad5.js";import{C as U}from"./index.8c937010.js";import{s as x}from"./share.630c329d.js";import"./index.070305bf.js";/* empty css */import"./tcplayer.v4.8.0.min.97e1acba.js";/* empty css */import"./index.3b2e70c8.js";import"./index.2a22730e.js";import"./index.7a1af785.js";import"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./index.9a41251d.js";const H="_introduction_1vd6e_1",N="_wxpopup_1vd6e_9";var u={"live-detail":"_live-detail_1vd6e_1",introduction:H,wxpopup:N};const E=e=>{const r=`../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":T,"../images/share-vip-tips.png":v,"../images/wx_bg.png":y}[r].default};var ee=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,c;const e=this.live,r=e.planList||[],t=((a=r[0])==null?void 0:a.startTime)||new Date,i=((c=r[0])==null?void 0:c.endTime)||new Date;return{headUrl:e.avatar,username:e.userName,isDegree:!!e.degreeFlag,isTeacher:!!e.teacherFlag,id:e.teacherId,startTime:`${s(t).format("YYYY-MM-DD")} ${s(t).format("HH:mm")}~${s(i).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(t=>{const i=t.startTime||new Date,a=t.endTime||new Date;e.push({courseTime:`${s(i).format("YYYY-MM-DD")} ${s(i).format("HH:mm")}~${s(a).format("HH:mm")}`,coursePlan:t.plan,roomUid:t.roomUid,liveState:t.liveState,id:t.courseId})}),e||[]}},created(){if(n().isApp)if(p.platformType==="STUDENT"){const e=this.$route.query;e.recomUserId=e.userType&&e.userType=="STUDENT"?"":e.recomUserId,n().ios?window.location.replace(`${location.origin}/student/#/liveDetail??${m.stringify(e)}`):(l({api:"openWebView",content:{url:`${location.origin}/student/#/liveDetail??${m.stringify(e)}`,orientation:1,isHideTitle:!1}}),l({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(()=>{l({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(){const{origin:e}=location;let r=e+"/student/#/liveDetail";const t=this.$route.query;r+=`?recomUserId=${t.userType&&t.userType=="STUDENT"?"":this.recomUserId}&groupId=${t.groupId}&p=${t.p}`,x(r,{})},onShare(){if(n().weixin){this.wxStatus=!0;return}this.reCall(),setTimeout(()=>{window.location.href=location.origin+"/student/#/download"},3e3)}},render(){return o("div",{class:[u["live-detail"],"mb12"]},[o($,{userInfo:this.userInfo,showBuy:!1},null),o(d,{border:!0},{default:()=>[o("p",{class:u.introduction},[this.userInfo.lessonDesc])]}),o(d,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},{default:()=>[o(C,{courseInfo:this.courseInfo,hideVideo:!0},null)]}),o(U,{position:"bottom"},{default:()=>[o("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[o(I,{block:!0,round:!0,type:"primary",onClick:this.onShare},{default:()=>[S("\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B")]})])]}),this.wxStatus&&o("div",{class:u.wxpopup,onClick:()=>{this.wxStatus=!1}},[o("img",{src:E("wx_bg.png"),alt:""},null)])])}});export{ee as default,E as getAssetsHomeFile};