live-detail.efd4a8f4.js 9.1 KB

1
  1. import{d as v,u as i,g as n,w as d,n as Y,T as h,D as m,j as r,f as g,M as E,z as c,B as I,aR as F}from"./index.e6d6174e.js";import{C as D}from"./index.80fb0739.js";import{S as f}from"./index.884a0e76.js";import{U as T}from"./index.af98ec6d.js";import{o as u,a as b}from"./orderStatus.fea01d83.js";import{C as U}from"./index.045f03fd.js";import{C as A}from"./index.b0eda115.js";import{C as y}from"./index.88fe9143.js";import{L as B}from"./live-item.7738586b.js";import{i as C}from"./icon-share.4e09e300.js";import"./index.4a53da74.js";import"./plyr.623e6d1e.js";import"./index.af99cf22.js";import"./index.4aea64de.js";import"./index.67c54471.js";import"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.b4a53c6a.js";import"./code-down-load.3acfa024.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const N="_introduction_zn2gv_1",S="_tips_zn2gv_12",P="_btnMore_zn2gv_35",j="_shareCourse_zn2gv_42";var l={"live-detail":"_live-detail_zn2gv_1",introduction:N,tips:S,btnMore:P,shareCourse:j},L="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==",ae=v({name:"LiveDetail",data(){const e=this.$route.query;return{joinRoom:e.joinRoom,recomUserId:e.recomUserId,groupId:e.groupId,courseId:e.classId,live:{},shareStatus:!1,shareUrl:""}},computed:{userInfo(){var a,p;const e=this.live;console.log("live",e);const o=e.planList||[],t=((a=o[0])==null?void 0:a.startTime)||new Date,s=((p=o[0])==null?void 0:p.endTime)||new Date;return{avatar:e.avatar,headUrl:e.avatar,username:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,id:e.teacherId,startTime:`${i(t).format("YYYY-MM-DD")} ${i(t).format("HH:mm")}~${i(s).format("HH:mm")}`||"",buyNum:e.studentCount,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}},courseInfo(){const e=[];return(this.live.planList||[]).forEach(t=>{const s=t.startTime||new Date,a=t.endTime||new Date;e.push({courseTime:`${i(s).format("YYYY-MM-DD")} ${i(s).format("HH:mm")}~${i(a).format("HH:mm")}`,coursePlan:t.plan,roomUid:t.roomUid,liveState:t.liveState,id:t.courseId})}),e||[]},salesEndDate(){const e=this.live;return i(e.salesEndDate||new Date).format("YYYY-MM-DD")},liveStatus(){const e=this.live.planList||[],o={status:!1,liveStatus:0,roomUid:""};return e.forEach(t=>{t.courseId===Number(this.courseId)&&(o.status=!0,o.liveStatus=t.liveStatus,o.roomUid=t.roomUid)}),o}},async mounted(){var e,o;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}`:this.shareUrl=`${location.origin}/teacher/#/shareLive?recomUserId=${(o=n.user.data)==null?void 0:o.userId}&groupId=${this.groupId}&userType=${n.platformType}`},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 t=((await d.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{groupId:this.groupId}})).data||{}).planList||[];let s={};t.forEach(a=>{a.courseId===Number(this.courseId)&&(s=a)}),console.log(s,this.live,"tempObj"),s&&s.liveState===1?Y({api:"joinLiveRoom",content:{roomId:s.roomUid,teacherId:this.live.teacherId}}):s&&s.liveState===2?setTimeout(()=>{h("\u8BFE\u7A0B\u5DF2\u7ED3\u675F")},100):setTimeout(()=>{h("\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019")},100)}catch{}},async onBuy(){try{const e=this.live;if(u.orderObject.orderType="LIVE",u.orderObject.orderName="\u76F4\u64AD\u8BFE\u8D2D\u4E70",u.orderObject.orderDesc="\u76F4\u64AD\u8BFE\u8D2D\u4E70",u.orderObject.actualPrice=e.coursePrice,u.orderObject.recomUserId=this.recomUserId,u.orderObject.orderNo="",u.orderObject.orderList=[{orderType:"LIVE",goodsName:"\u76F4\u64AD\u8BFE\u8D2D\u4E70",courseGroupId:e.courseGroupId,courseGroupName:e.courseGroupName,coursePrice:e.coursePrice,teacherName:e.userName||`\u6E38\u5BA2${e.teacherId||""}`,teacherId:e.teacherId,avatar:e.avatar,courseInfo:this.courseInfo,recomUserId:this.recomUserId}],e.coursePrice<=0){await b(()=>{m.alert({message:"\u9886\u53D6\u6210\u529F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"#2dc7aa"}).then(()=>{this._init()})});return}const t=(await d.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"LIVE",bizId:this.groupId}})).data;t?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()=>{u.orderObject.orderNo=t.orderNo,u.orderObject.actualPrice=t.actualPrice,u.orderObject.discountPrice=t.discountPrice,this.routerTo()}).catch(()=>{m.close(),this.cancelPayment(t.orderNo)}):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 r("div",{class:[l["live-detail"],"mb12"]},[r(U,null,{right:()=>r("img",{src:C,onClick:()=>this.shareStatus=!0},null)}),r(T,{userInfo:this.userInfo,showBuy:!1,onUserDetail:e=>{n.platformType==="STUDENT"&&g().isApp&&this.$router.push({path:"/teacherHome",query:{teacherId:e.id,tabs:"live"}})}},null),r(f,{border:!0},{default:()=>[r("p",{class:l.introduction},[this.userInfo.lessonDesc])]}),r(f,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0,contentStyle:{paddingTop:"0"}},{default:()=>[this.courseInfo.length>0&&r(D,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null)]}),r("div",{class:l.tips},[r("h3",null,[r(E,{name:L,size:15},null),c("\u6E29\u99A8\u63D0\u793A")]),r("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"),r("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"),r("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&&r(A,{position:"bottom",background:"white"},{default:()=>[r("div",{class:["btnGroup",l.btnMore]},[r(I,{block:!0,round:!0,type:"primary",onClick:this.onBuy},{default:()=>[this.live.coursePrice<=0?"\u514D\u8D39\u9886\u53D6":"\u7ACB\u5373\u8D2D\u4E70"]})])]}),this.joinRoom=="1"&&this.liveStatus.liveStatus!==2&&r(A,{position:"bottom",background:"white"},{default:()=>[r("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[r(I,{block:!0,round:!0,type:"primary",onClick:this.onJoinRoom},{default:()=>[c("\u8FDB\u5165\u76F4\u64AD\u95F4")]})])]}),r(F,{show:this.shareStatus,"onUpdate:show":e=>this.shareStatus=e,style:{background:"transparent"}},{default:()=>[r(y,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"live"},{default:()=>[r(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{ae as default};