video-detail.01b9722a.js 6.2 KB

1
  1. var g=Object.defineProperty;var d=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var u=(e,o,s)=>o in e?g(e,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[o]=s,h=(e,o)=>{for(var s in o||(o={}))y.call(o,s)&&u(e,s,o[s]);if(d)for(var s of d(o))I.call(o,s)&&u(e,s,o[s]);return e};import{C as c}from"./index.84afa5a4.js";import{S as r}from"./index.2778830d.js";import{U as j}from"./index.fdb44d83.js";import{U as L}from"./index.56698ed0.js";import{d as C,D as S,T as U,a as t,x as G,v as x,w as p,M as N,F as _,B as m,j as f,P as T}from"./vendor.3506a68e.js";/* empty css *//* empty css *//* empty css *//* empty css */import{r as n,s as b,p as w,C as P}from"./index.9e4b607f.js";import{C as k}from"./index.be471456.js";import{C as v}from"./index.e311a214.js";import{L as D}from"./live-item.4c8a6f40.js";/* empty css *//* empty css */import"./bars.4f1962a6.js";/* empty css */import"./icon_teacher.cb128c00.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./icon_student.bbb32387.js";import"./code-down-load.328a30fb.js";import"./logo.bcac726b.js";import"./browser.ebb85846.js";const F="_introduction_f64bq_1",B="_shareCourse_f64bq_9",V="_coverClass_f64bq_17";var i={"video-detail":"_video-detail_f64bq_1",introduction:F,shareCourse:B,coverClass:V};function l(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!G(e)}var ds=C({name:"VideoDetail",data(){const e=this.$route.query;return{userInfo:{},detailList:[],buyUserList:[],dataShow:!0,loading:!1,finished:!1,share:e.share,params:{videoLessonGroupId:e.groupId,page:1,rows:20},shareStatus:!1,shareUrl:"",shelvesFlag:0,myself:!1}},async mounted(){var e;try{const s=(await n.get("/api-teacher/videoLessonGroup/selectVideoLesson",{params:{groupId:this.params.videoLessonGroupId}})).data||{};b.platformType==="TEACHER"&&(this.myself=!s.myself),this.userInfo={id:s.lessonGroup.teacherId,username:s.lessonGroup.username,headUrl:s.lessonGroup.avatar,buyNum:s.lessonGroup.countStudent,lessonId:s.lessonGroup.id,lessonNum:s.lessonGroup.lessonCount,lessonName:s.lessonGroup.lessonName,lessonDesc:s.lessonGroup.lessonDesc,lessonPrice:s.lessonGroup.lessonPrice,lessonCoverUrl:s.lessonGroup.lessonCoverUrl,lessonSubjectName:s.lessonGroup.lessonSubjectName,auditVersion:s.lessonGroup.auditVersion,isDegree:!!s.degreeFlag,isTeacher:!!s.teacherFlag},this.shelvesFlag=s.lessonGroup.shelvesFlag,this.detailList=s.detailList||[],this.shareUrl=`${location.origin}/teacher#/shareVideo?recomUserId=${(e=b.user.data)==null?void 0:e.userId}&groupId=${this.params.videoLessonGroupId}`,this.getList()}catch(o){console.log(o)}},methods:{async getList(){try{const e=this.params,o=await n.post("/api-teacher/videoLesson/pageStudent",{data:h({},e)});this.loading=!1;const s=o.data||{};if(this.buyUserList.length>0&&s.pageNo===1)return;this.buyUserList=this.buyUserList.concat(s.rows||[]),this.finished=s.pageNo>=s.totalPage,this.params.page=s.pageNo+1,this.dataShow=this.buyUserList.length>0}catch{this.dataShow=!1,this.finished=!0}},onPlay(e){this.$router.push({path:"/videoClassDetail",query:{groupId:this.params.videoLessonGroupId,classId:e.id}})},async updateShelves(){S.confirm({title:"\u63D0\u793A",message:"\u786E\u8BA4\u4E0B\u67B6\u8BE5\u8BFE\u7A0B\u5417\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{await n.post("/api-teacher/videoLessonGroup/updateShelves",{data:{id:this.userInfo.lessonId,shelvesFlag:0}}),U("\u4E0B\u67B6\u6210\u529F"),setTimeout(()=>{w({api:"back"})},800)}catch{}})}},render(){let e,o,s;return t("div",{class:[i["video-detail"],"mb12"]},[this.userInfo.id&&t(j,{userInfo:this.userInfo},null),t(r,{border:!0},{default:()=>[t("p",{class:i.introduction},[this.userInfo.lessonDesc])]}),this.myself?t(r,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},l(e=this.detailList.map(a=>t(c,{class:"mb12",detail:{id:a.id,title:a.videoTitle,content:a.videoContent,imgUrl:a.coverUrl},onPlay:this.onPlay},null)))?e:{default:()=>[e]}):t(r,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",titleShow:!1,contentStyle:{paddingTop:"0"}},{default:()=>[t(x,{color:"var(--van-primary)",lineWidth:20,sticky:!0},{default:()=>[t(p,{title:"\u8BFE\u7A0B",titleClass:"van-hairline--bottom"},l(o=this.detailList.map(a=>t(c,{class:"mb12",detail:{id:a.id,title:a.videoTitle,content:a.videoContent,imgUrl:a.coverUrl},onPlay:this.onPlay},null)))?o:{default:()=>[o]}),t(p,{title:"\u5B66\u5458\u5217\u8868",titleClass:"van-hairline--bottom"},{default:()=>[this.dataShow?t(N,{loading:this.loading,"onUpdate:loading":a=>this.loading=a,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:this.getList},l(s=this.buyUserList.map(a=>t(L,{class:"mb12",users:{avatar:a.avatar,studentId:a.userId,studentName:a.username,createTime:a.createTime}},null)))?s:{default:()=>[s]}):t(P,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5B66\u751F\u8D2D\u4E70"},null)]})]})]}),this.shelvesFlag===1&&t(_,null,[this.share=="1"&&this.detailList.length>0&&t(v,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(m,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[f("\u5206\u4EAB\u8BFE\u7A0B")]})])]}),this.share!="1"&&this.detailList.length>0&&t(v,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[t(m,{block:!0,round:!0,type:"primary",onClick:this.updateShelves},{default:()=>[f("\u4E0B\u67B6")]})])]})]),t(T,{show:this.shareStatus,"onUpdate:show":a=>this.shareStatus=a,style:{background:"transparent"}},{default:()=>[t(k,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"video"},{default:()=>[t(D,{class:i.shareCourse,coverClass:i.coverClass,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.headUrl,studentCount:this.userInfo.buyNum,existBuy:0,subjectName:this.userInfo.lessonSubjectName}},null)]})]})])}});export{ds as default};