live-detail.0868611f.js 9.2 KB

1
  1. import{d as v,w as a,g as n,y as d,n as Y,T as p,D as m,j as t,f as E,N as F,A as c,B as I,aS as g}from"./ResizeObserver.es.b7226882.js";import{C as D}from"./index.11374099.js";import{S as f}from"./index.a841fff0.js";import{U as T}from"./index.c1be15b1.js";import{o as i,a as y}from"./orderStatus.1ca966f0.js";import{C as U}from"./index.969bba7f.js";import{C as A}from"./index.0b42adfa.js";import{C as b}from"./index.0b85a0cc.js";import{L as B}from"./live-item.77220bb5.js";import{i as C}from"./icon-share.4e09e300.js";import{t as S}from"./tradeOrder.b3e670b0.js";import"./index.2476b303.js";/* empty css */import"./tcplayer.v4.8.0.min.aee5aab1.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";import"./index.cf00521e.js";import"./code-down-load.95f00a21.js";import"./logo.bcac726b.js";import"./browser.b3690ea1.js";import"./html2canvas.esm.3d083717.js";const N="_introduction_13imh_1",L="_tips_13imh_12",P="_btnMore_13imh_35",w="_shareCourse_13imh_42";var l={"live-detail":"_live-detail_13imh_1",introduction:N,tips:L,btnMore:P,shareCourse:w},j="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==",ie=v({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 u,h;const e=this.live,s=e.planList||[],r=((u=s[0])==null?void 0:u.startTime)||new Date,o=((h=s[0])==null?void 0:h.endTime)||new Date;return{avatar:e.avatar,headUrl:e.avatar,username:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,id:e.teacherId,startTime:`${a(r).format("YYYY-MM-DD")} ${a(r).format("HH:mm")}~${a(o).format("HH:mm")}`||"",buyNum:e.studentCount,type:"live",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,s=this.$route.query;return e.tenantId>0&&s.p=="tenant"},courseInfo(){const e=[];return(this.live.planList||[]).forEach(r=>{const o=r.startTime||new Date,u=r.endTime||new Date;e.push({courseTime:`${a(o).format("YYYY-MM-DD")} ${a(o).format("HH:mm")}~${a(u).format("HH:mm")}`,coursePlan:r.plan,roomUid:r.roomUid,liveState:r.liveState,id:r.courseId})}),e||[]},salesEndDate(){const e=this.live;return a(e.salesEndDate||new Date).format("YYYY-MM-DD")},liveStatus(){const e=this.live.planList||[],s={status:!1,liveStatus:0,roomUid:""};return e.forEach(r=>{r.courseId===Number(this.courseId)&&(s.status=!0,s.liveStatus=r.liveStatus,s.roomUid=r.roomUid)}),s}},async mounted(){var e,s;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=${(s=n.user.data)==null?void 0:s.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 r=((await d.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}})).data||{}).planList||[];let o={};r.forEach(u=>{u.courseId===Number(this.courseId)&&(o=u)}),o&&o.liveState===1?Y({api:"joinLiveRoom",content:{roomId:o.roomUid,teacherId:this.live.teacherId}}):o&&o.liveState===2?setTimeout(()=>{p("\u8BFE\u7A0B\u5DF2\u7ED3\u675F")},100):setTimeout(()=>{p("\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019")},100)}catch{}},initLive(){const e=this.live;i.orderObject.orderType="LIVE",i.orderObject.orderName="\u76F4\u64AD\u8BFE\u8D2D\u4E70",i.orderObject.orderDesc="\u76F4\u64AD\u8BFE\u8D2D\u4E70",i.orderObject.actualPrice=e.coursePrice,i.orderObject.recomUserId=this.recomUserId,i.orderObject.orderNo="",i.orderObject.orderList=[{orderType:"LIVE",goodsName:"\u76F4\u64AD\u8BFE\u8D2D\u4E70",courseGroupId:e.courseGroupId,courseGroupName:e.courseGroupName,coursePrice:e.coursePrice,price:e.coursePrice,teacherName:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,teacherId:e.teacherId,avatar:e.avatar,courseInfo:this.courseInfo,recomUserId:this.recomUserId}]},async onBuy(){try{if(this.live.coursePrice<=0){this.initLive(),await y(()=>{m.alert({message:"\u9886\u53D6\u6210\u529F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"#2dc7aa"}).then(()=>{this._init()})});return}const r=(await d.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"LIVE",bizId:this.groupId}})).data;r?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()=>{S(r,this.routerTo)}).catch(()=>{m.close(),this.cancelPayment(r.orderNo)}):(this.initLive(),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 t("div",{class:[l["live-detail"],"mb12"]},[t(U,null,{right:()=>t("img",{src:C,onClick:()=>this.shareStatus=!0},null)}),t(T,{userInfo:this.userInfo,showBuy:!1,onUserDetail:e=>{n.platformType==="STUDENT"&&E().isApp&&this.$router.push({path:"/teacherHome",query:{teacherId:e.id,tabs:"live"}})}},null),t(f,{border:!0},{default:()=>[t("p",{class:l.introduction},[this.userInfo.lessonDesc])]}),t(f,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0,contentStyle:{paddingTop:"0"}},{default:()=>[this.courseInfo.length>0&&t(D,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}),t("div",{class:l.tips},[t("h3",null,[t(F,{name:j,size:15},null),c("\u6E29\u99A8\u63D0\u793A")]),t("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"),t("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"),t("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&&t(A,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup",l.btnMore]},[t(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&&t(A,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(I,{block:!0,round:!0,type:"primary",onClick:this.onJoinRoom},{default:()=>[c("\u8FDB\u5165\u76F4\u64AD\u95F4")]})])]}),t(g,{show:this.shareStatus,"onUpdate:show":e=>this.shareStatus=e,style:{background:"transparent"}},{default:()=>[t(b,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"live"},{default:()=>[t(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{ie as default};