var h=Object.defineProperty;var d=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var c=(s,t,e)=>t in s?h(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,n=(s,t)=>{for(var e in t||(t={}))m.call(t,e)&&c(s,e,t[e]);if(d)for(var e of d(t))p.call(t,e)&&c(s,e,t[e]);return s};import{C as f}from"./index.fc7d34d1.js";import{C as b}from"./index.ccfa57ee.js";import{d as j,a,S,u as g,I as v,w as C,x as _,P as x}from"./vendor.a0144ce9.js";/* empty css               *//* empty css               *//* empty css               */import{V as L}from"./video-item.279fcc47.js";import{b as N}from"./banner.db59be99.js";import{s as o,r as u,C as w}from"./index.3d95a92c.js";import{O as I}from"./organ-search.a2c2f321.js";/* empty css               *//* empty css               *//* empty css               */import"./icon_teacher.40b6f077.js";/* empty css                */const y="_videoClass_1udm0_1",V="_label_1udm0_9",H="_classHeader_1udm0_21",k="_banner_1udm0_24",O="_videoList_1udm0_28";var i={videoClass:y,label:V,classHeader:H,banner:k,videoList:O};function P(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!_(s)}var W=j({name:"VideoClass",data(){var t;const s=sessionStorage.getItem("videoClassSubjectId");return{search:"",list:[],dataShow:!0,loading:!1,finished:!1,sessionSubjectId:s,params:{search:"",lessonSubject:s||((t=o.user.data)==null?void 0:t.subjectId)||null,subjectName:"",page:1,rows:20},searchStatus:!1,openStatus:!1,subjectList:[]}},async mounted(){var t;try{const e=await u.get("/api-student/subject/subjectSelect");this.subjectList=e.data||[]}catch{}let s="";this.subjectList.forEach(e=>{var r;(r=e.subjects)==null||r.forEach(l=>{l.id===Number(this.sessionSubjectId)&&(s=l.name)})}),this.params.subjectName=s||((t=o.user.data)==null?void 0:t.subjectName)||"",sessionStorage.removeItem("videoClassSubjectId")},methods:{async getList(){try{const s=n({},this.params);o.version&&(s.version=o.version||"",s.platform="ios-student");const t=await u.post("/api-student/videoLesson/selectGroup",{data:n({},s)});this.loading=!1;const e=t.data||{};if(console.log(e),this.list.length>0&&e.pageNo===1)return;this.list=this.list.concat(e.rows||[]),this.finished=e.pageNo>=e.totalPage,this.params.page=e.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}},onSort(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.searchStatus=!1,this.getList()},onSearch(s){this.params.search=s,this.onSort()},onDetail(s){this.$router.push({path:"/videoDetail",query:{groupId:s.id}})}},render(){let s;return a("div",{class:i.videoClass},[a(S,{offsetTop:0,position:"top"},{default:()=>[a(f,{class:i.classHeader,border:!1,isFixed:!1,background:"transparent"},null),a(b,{placeholder:"\u8BF7\u8F93\u5165\u8001\u5E08\u540D\u79F0/\u8BFE\u7A0B\u540D\u79F0",onSearch:this.onSearch},{left:()=>a("div",{class:i.label,onClick:()=>{this.searchStatus=!this.searchStatus,this.openStatus=!this.openStatus}},[this.params.subjectName,a(g,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})]}),a("div",{class:i.banner},[a(v,{src:N},null)]),a("div",null,[this.dataShow?a(C,{class:i.videoList,loading:this.loading,"onUpdate:loading":t=>this.loading=t,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:this.getList},P(s=this.list.map(t=>a(L,{item:t,onClick:this.onDetail},null)))?s:{default:()=>[s]}):a(w,{btnStatus:!1,tips:"\u6682\u65E0\u89C6\u9891\u8BFE"},null)]),a(x,{show:this.searchStatus,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>this.searchStatus=!1,onClosed:()=>this.openStatus=!1},{default:()=>[this.openStatus&&a(I,{subjectList:this.subjectList,onSort:this.onSort,modelValue:this.params.lessonSubject,"onUpdate:modelValue":t=>this.params.lessonSubject=t,subjectName:this.params.subjectName,"onUpdate:subjectName":t=>this.params.subjectName=t},null)]})])}});export{W as default};
