teacher-elegant.b9a467bd.js 5.5 KB

1
  1. var b=Object.defineProperty;var h=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var d=(t,e,a)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,r=(t,e)=>{for(var a in e||(e={}))j.call(e,a)&&d(t,a,e[a]);if(h)for(var a of h(e))v.call(e,a)&&d(t,a,e[a]);return t};import{C as S}from"./index.9a4c80cd.js";import{r as u,s as n,C as I}from"./index.9e4b607f.js";import{C as N}from"./index.2d1e9e4b.js";import{d as L,a as s,S as C,K as U,M as x,I as c,j as m,x as w,P as y}from"./vendor.3506a68e.js";/* empty css *//* empty css *//* empty css */import{O as D}from"./organ-search.5633eb2e.js";import{I as E}from"./icon_teacher.cb128c00.js";import{i as T}from"./icon_upload_poster.81da3a98.js";import{b as H}from"./bars.4f1962a6.js";import{u as _,S as g}from"./hooks.6a14d51f.js";/* empty css *//* empty css *//* empty css *//* empty css */const k="_classHeader_7iogr_1",F="_label_7iogr_9",P="_elegant_7iogr_21",A="_itemBg_7iogr_27",O="_tedeoItem_7iogr_36",V="_teCover_7iogr_44",B="_teSection_7iogr_54",q="_teTitle_7iogr_57",z="_info_7iogr_62",G="_teUserInfo_7iogr_67",M="_teUserLogo_7iogr_74",$="_teUserName_7iogr_81",J="_teUserNum_7iogr_86",K="_searchContainer_7iogr_89",R="_item_7iogr_27",Q="_searchItem_7iogr_98",W="_title_7iogr_102",X="_content_7iogr_110",Y="_searchFollow_7iogr_116",Z="_active_7iogr_120",ee="_searchLive_7iogr_124",te="_active2_7iogr_128",se="_searchDefault_7iogr_132",ae="_star_7iogr_142",oe="_video_7iogr_145",ie="_living_7iogr_154",re="_animation_7iogr_171";var o={classHeader:k,"teacher-elegant":"_teacher-elegant_7iogr_4",label:F,elegant:P,itemBg:A,tedeoItem:O,teCover:V,teSection:B,teTitle:q,info:z,teUserInfo:G,teUserLogo:M,teUserName:$,teUserNum:J,searchContainer:K,item:R,searchItem:Q,title:W,content:X,searchFollow:Y,active:Z,searchLive:ee,active2:te,searchDefault:se,star:ae,video:oe,living:ie,animation:re};function ne(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!w(t)}var Ue=L({data(){return{searchStatus:!1,openStatus:!1,subjectList:[],params:{username:"",page:1,subjectId:null,subjectName:"\u5168\u90E8\u58F0\u90E8"},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{}const t=_(g.ELEGANT);if(t.id)this.params.subjectId=Number(t.id),this.params.subjectName=t.name;else{const a=this.subjectList,l=((e=n.user.data)==null?void 0:e.subjectId)||"",p=l?Number(l.split(",")[0]):null;a.forEach(f=>{(f.subjects||[]).forEach(i=>{i.id===Number(p)&&(this.params.subjectId=i.id,this.params.subjectName=i.name)})})}await this.getList(),sessionStorage.removeItem("teacherHomeTabs")},computed:{filterDot(){return!!this.params.subjectId}},methods:{async getList(){try{const t=r({},this.params);n.version&&(t.version=n.version||"",t.platform="ios-student");const e=await u.post("/api-student/teacher/stylePage",{data:r({},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.params.subjectId&&_(g.ELEGANT,JSON.stringify({id:this.params.subjectId,name:this.params.subjectName}),"set"),this.getList()},onSearch(t){this.params.username=t,this.onSort()},onDetail(t){this.$router.push({path:"/teacherHome",query:{teacherId:t.userId}})}},render(){let t;return s("div",{class:o["teacher-elegant"]},[s(C,{offsetTop:0,position:"top"},{default:()=>[s("div",{ref:"header"},[s(S,{class:o.classHeader,border:!1,background:"transparent",isFixed:!1},null),s(N,{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(U,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})])]}),this.dataShow?s(x,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,class:[o.elegant],onLoad:this.getList},ne(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(c,{src:e.cover||T,fit:"cover"},null),e.living===1&&s("div",{class:o.living},[s(c,{src:H,class:o.animation},null),s("span",null,[m("\u76F4\u64AD\u4E2D")])])]),s("div",{class:o.teSection},[s("div",{class:o.info},[s("div",{class:o.teUserInfo},[s(c,{src:e.avatar||E,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,m("\u6D4F\u89C8")])])])])))?t:{default:()=>[t]}):s(I,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8001\u5E08\u98CE\u91C7"},null),s(y,{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(D,{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{Ue as default};