index.3e829339.js 5.8 KB

1
  1. var N=Object.defineProperty;var h=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var p=(s,e,a)=>e in s?N(s,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[e]=a,u=(s,e)=>{for(var a in e||(e={}))g.call(e,a)&&p(s,a,e[a]);if(h)for(var a of h(e))C.call(e,a)&&p(s,a,e[a]);return s};import{C as I}from"./index.f39b5a8e.js";import{C as U}from"./index.a64b1b02.js";import{d as m,a as t,I as v,j as n,F as d,S as L,K as x,M as y,x as T,P as E}from"./vendor.cd162bf7.js";/* empty css *//* empty css *//* empty css */import{I as V}from"./icon_teacher.cb128c00.js";import{s as r,r as f,C as P}from"./index.3f446802.js";import{O as D}from"./organ-search.05995c84.js";import{u as b,S as j}from"./hooks.db7ebbde.js";/* empty css *//* empty css *//* empty css *//* empty css */const w="_videoClass_1udm0_1",F="_label_1udm0_9",k="_classHeader_1udm0_21",O="_banner_1udm0_24",H="_videoList_1udm0_28";var l={videoClass:w,label:F,classHeader:k,banner:O,videoList:H};const $="_videoItem_ln5uh_1",A="_viCover_ln5uh_8",q="_viSection_ln5uh_13",B="_viTitle_ln5uh_16",G="_viUserInfo_ln5uh_21",R="_viUserLogo_ln5uh_28",z="_viUserName_ln5uh_35",J="_viUserNum_ln5uh_44",K="_viPrice_ln5uh_47",M="_subjectName_ln5uh_52";var i={videoItem:$,viCover:A,viSection:q,viTitle:B,viUserInfo:G,viUserLogo:R,viUserName:z,viUserNum:J,viPrice:K,subjectName:M},Q=m({name:"VideoItem",props:{item:Object,onClick:{type:Function,default:s=>{}}},render(){const s=this.item;return t("div",{class:i.videoItem,onClick:()=>{this.onClick(s)}},[t("div",{style:{position:"relative"}},[t(v,{class:i.viCover,fit:"cover",src:s==null?void 0:s.lessonCoverUrl},null),t("span",{class:i.subjectName},[s==null?void 0:s.lessonSubjectName])]),t("div",{class:i.viSection},[t("div",{class:[i.viTitle,"van-ellipsis"]},[s==null?void 0:s.lessonName]),t("div",{class:i.viUserInfo},[t(v,{src:(s==null?void 0:s.avatar)||V,class:i.viUserLogo},null),t("span",{class:[i.viUserName,"van-hairline--right"]},[(s==null?void 0:s.userName)||(s==null?void 0:s.username)||`\u6E38\u5BA2${(s==null?void 0:s.teacherId)||""}`]),t("span",{class:i.viUserNum},[s==null?void 0:s.countStudent,n("\u4EBA\u5DF2"),(s==null?void 0:s.lessonPrice)<=0&&s.auditVersion===0?"\u9886\u53D6":"\u8D2D\u4E70"])]),t("div",{class:i.viPrice},[(s==null?void 0:s.lessonPrice)>0&&t(d,null,[n("\uFFE5"),s==null?void 0:s.lessonPrice,n("/")]),(s==null?void 0:s.lessonPrice)<=0&&s.auditVersion!==0&&t(d,null,[n("\uFFE5"),0,n("/")]),(s==null?void 0:s.lessonPrice)<=0&&s.auditVersion===0&&t(d,null,[n("\u514D\u8D39/")]),s==null?void 0:s.lessonCount,n("\u8BFE\u65F6")])])])}});function W(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!T(s)}var ps=m({name:"VideoClass",data(){return{apiSuffix:r.platformType==="STUDENT"?"/api-student":"/api-teacher",search:"",list:[],dataShow:!0,loading:!1,finished:!1,params:{search:"",lessonSubject:null,subjectName:"\u5168\u90E8\u58F0\u90E8",page:1,rows:20},searchStatus:!1,openStatus:!1,subjectList:[]}},async mounted(){var e;try{const a=await f.get(`${this.apiSuffix}/subject/subjectSelect?type=VIDEO`);this.subjectList=a.data||[]}catch{}const s=b(j.VIDEO);if(s.id)this.params.lessonSubject=Number(s.id),this.params.subjectName=s.name;else{const a=this.subjectList,o=((e=r.user.data)==null?void 0:e.subjectId)||"",S=o?Number(o.split(",")[0]):null;a.forEach(_=>{(_.subjects||[]).forEach(c=>{c.id===Number(S)&&(this.params.lessonSubject=c.id,this.params.subjectName=c.name)})})}this.getList()},methods:{async getList(){try{const s=u({},this.params);r.version&&(s.version=r.version||"",s.platform=r.platformType==="STUDENT"?"ios-student":"ios-teacher");const e=r.platformType==="STUDENT"?"/api-student/videoLesson/selectGroup":"/api-teacher/videoLessonGroup/page";s.myself=!1;const a=await f.post(e,{data:u({},s)});this.loading=!1;const o=a.data||{};if(this.list.length>0&&o.pageNo===1)return;this.list=this.list.concat(o.rows||[]),this.finished=o.pageNo>=o.totalPage,this.params.page=o.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.params.lessonSubject&&b(j.VIDEO,JSON.stringify({id:this.params.lessonSubject,name:this.params.subjectName}),"set"),this.getList()},onSearch(s){this.params.search=s,this.onSort()},onDetail(s){const e={groupId:s.id};r.platformType==="TEACHER"&&(e.share=1),this.$router.push({path:"/videoDetail",query:e})}},render(){let s;return t("div",{class:l.videoClass},[t(L,{offsetTop:0,position:"top"},{default:()=>[t(I,{class:l.classHeader,border:!1,isFixed:!1,background:"transparent"},null),t(U,{placeholder:"\u8BF7\u8F93\u5165\u8001\u5E08\u540D\u79F0/\u8BFE\u7A0B\u540D\u79F0",onSearch:this.onSearch},{left:()=>t("div",{class:l.label,onClick:()=>{this.searchStatus=!this.searchStatus,this.openStatus=!this.openStatus}},[this.params.subjectName,t(x,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})]}),t("div",null,[this.dataShow?t(y,{class:l.videoList,loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:this.getList,immediateCheck:!1},W(s=this.list.map(e=>t(Q,{item:e,onClick:this.onDetail},null)))?s:{default:()=>[s]}):t(P,{btnStatus:!1,tips:"\u6682\u65E0\u89C6\u9891\u8BFE"},null)]),t(E,{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&&t(D,{subjectList:this.subjectList,onSort:this.onSort,modelValue:this.params.lessonSubject,"onUpdate:modelValue":e=>this.params.lessonSubject=e,subjectName:this.params.subjectName,"onUpdate:subjectName":e=>this.params.subjectName=e},null)]})])}});export{ps as default};