teacher-elegant.b7438fb7.js 5.5 KB

1
  1. var m=Object.defineProperty;var h=Object.getOwnPropertySymbols;var p=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var d=(t,e,a)=>e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,n=(t,e)=>{for(var a in e||(e={}))p.call(e,a)&&d(t,a,e[a]);if(h)for(var a of h(e))f.call(e,a)&&d(t,a,e[a]);return t};import{C as g}from"./index.17721876.js";import{s as i,r as u,C as b}from"./index.c610da41.js";import{C as j}from"./index.17e611e1.js";import{d as v,a as s,S,u as I,w as N,I as r,j as _,x as C,P as L}from"./vendor.7fdfd452.js";/* empty css *//* empty css *//* empty css */import{O as U}from"./organ-search.9f014bcf.js";import{i as w}from"./icon_teacher.40b6f077.js";import{i as x}from"./icon_upload_poster.81da3a98.js";import{b as y}from"./bars.4f1962a6.js";/* empty css *//* empty css *//* empty css *//* empty css */const D="_classHeader_169h0_1",T="_label_169h0_9",H="_elegant_169h0_21",P="_itemBg_169h0_27",k="_tedeoItem_169h0_36",E="_teCover_169h0_44",F="_teSection_169h0_54",V="_teTitle_169h0_57",B="_info_169h0_62",O="_teUserInfo_169h0_67",q="_teUserLogo_169h0_74",z="_teUserName_169h0_81",A="_teUserNum_169h0_86",$="_searchContainer_169h0_89",M="_item_169h0_27",R="_searchItem_169h0_98",G="_title_169h0_102",J="_content_169h0_110",K="_searchFollow_169h0_116",Q="_active_169h0_120",W="_searchLive_169h0_124",X="_active2_169h0_128",Y="_searchDefault_169h0_132",Z="_star_169h0_142",ee="_video_169h0_145",te="_living_169h0_154",se="_animation_169h0_171";var o={classHeader:D,"teacher-elegant":"_teacher-elegant_169h0_4",label:T,elegant:H,itemBg:P,tedeoItem:k,teCover:E,teSection:F,teTitle:V,info:B,teUserInfo:O,teUserLogo:q,teUserName:z,teUserNum:A,searchContainer:$,item:M,searchItem:R,title:G,content:J,searchFollow:K,active:Q,searchLive:W,active2:X,searchDefault:Y,star:Z,video:ee,living:te,animation:se};function ae(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!C(t)}var ve=v({data(){var e;const t=sessionStorage.getItem("elegantSubjectId");return{sessionSubjectId:t,searchStatus:!1,openStatus:!1,subjectList:[],params:{username:"",page:1,subjectId:t||((e=i.user.data)==null?void 0:e.subjectId)||null,subjectName:""},dataShow:!0,loading:!1,finished:!1,list:[],height:"auto"}},async mounted(){var e;try{const a=await u.get("/api-student/subject/subjectSelect");this.subjectList=a.data||[]}catch{}let t="";this.subjectList.forEach(a=>{var c;(c=a.subjects)==null||c.forEach(l=>{l.id===Number(this.sessionSubjectId)&&(t=l.name)})}),this.params.subjectName=t||((e=i.user.data)==null?void 0:e.subjectName)||"",await this.getList(),sessionStorage.removeItem("teacherHomeTabs"),sessionStorage.removeItem("elegantSubjectId")},computed:{filterDot(){return!!this.params.subjectId}},methods:{async getList(){try{const t=n({},this.params);i.version&&(t.version=i.version||"",t.platform="ios-student");const e=await u.post("/api-student/teacher/stylePage",{data:n({},t)});this.loading=!1;const a=e.data||{};if(this.list.length>0&&a.pageNo===1)return;this.list=this.list.concat(a.rows||[]),this.finished=a.pageNo>=a.totalPage,this.params.page=a.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(t){this.params.username=t,this.onSort()},onDetail(t){this.params.subjectId&&sessionStorage.setItem("elegantSubjectId",this.params.subjectId),this.$router.push({path:"/teacherHome",query:{teacherId:t.userId}})}},render(){let t;return s("div",{class:o["teacher-elegant"]},[s(S,{offsetTop:0,position:"top"},{default:()=>[s("div",{ref:"header"},[s(g,{class:o.classHeader,border:!1,background:"transparent",isFixed:!1},null),s(j,{placeholder:"\u8BF7\u8F93\u5165\u8001\u5E08\u540D\u79F0",onSearch:this.onSearch},{left:()=>s("div",{class:o.label,onClick:()=>{this.searchStatus=!this.searchStatus,this.openStatus=!this.openStatus}},[this.params.subjectName,s(I,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})])]}),this.dataShow?s(N,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,class:[o.elegant],onLoad:this.getList},ae(t=this.list.map(e=>s("div",{class:o.tedeoItem},[s("div",{class:o.itemBg,onClick:()=>{this.onDetail(e)}},null),s("div",{class:o.teCover},[s(r,{src:e.cover||x,fit:"cover"},null),e.living===1&&s("div",{class:o.living},[s(r,{src:y,class:o.animation},null),s("span",null,[_("\u64AD\u653E\u4E2D")])])]),s("div",{class:o.teSection},[s("div",{class:[o.teTitle,"van-ellipsis"]},[e.lessonName]),s("div",{class:o.info},[s("div",{class:o.teUserInfo},[s(r,{src:e.avatar||w,class:o.teUserLogo},null),s("span",{class:[o.teUserName,"van-hairline--right van-ellipsis"]},[(e==null?void 0:e.username)||`\u6E38\u5BA2${(e==null?void 0:e.userId)||""}`])]),s("span",{class:o.teUserNum},[e.browse,_("\u6D4F\u89C8")])])])])))?t:{default:()=>[t]}):s(b,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8001\u5E08\u98CE\u91C7"},null),s(L,{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&&s(U,{subjectList:this.subjectList,onSort:this.onSort,modelValue:this.params.subjectId,"onUpdate:modelValue":e=>this.params.subjectId=e,subjectName:this.params.subjectName,"onUpdate:subjectName":e=>this.params.subjectName=e},null)]})])}});export{ve as default};