1 |
- import{C as g}from"./index.33f0ddb9.js";import{d as p,e as l,s as r,i as t,N as f,A as h,C as b,aT as v,$ as S}from"./index.6b776f4b.js";import{C as j}from"./index.1c64afe2.js";import{L as I}from"./index.9b1da5d2.js";import{S as N}from"./index.998c3386.js";import{I as n}from"./index.7cc0b0e7.js";import{O as L}from"./organ-search.97411f26.js";import{i as C}from"./icon_teacher.40b6f077.js";import{i as U}from"./icon_upload_poster.81da3a98.js";import{b as w}from"./bars.82474962.js";import{a as u,S as d}from"./hooks.ad006126.js";import"./index.f0306d29.js";import"./use-height.c83159bc.js";import"./index.7486196c.js";import"./index.ef17e812.js";import"./use-id.40b6af6b.js";import"./use-tab-status.ad41a764.js";import"./index.beb9a25a.js";const y="_classHeader_7iogr_1",T="_label_7iogr_9",D="_elegant_7iogr_21",E="_itemBg_7iogr_27",H="_tedeoItem_7iogr_36",F="_teCover_7iogr_44",k="_teSection_7iogr_54",x="_teTitle_7iogr_57",A="_info_7iogr_62",O="_teUserInfo_7iogr_67",P="_teUserLogo_7iogr_74",V="_teUserName_7iogr_81",B="_teUserNum_7iogr_86",$="_searchContainer_7iogr_89",q="_item_7iogr_27",z="_searchItem_7iogr_98",G="_title_7iogr_102",J="_content_7iogr_110",M="_searchFollow_7iogr_116",R="_active_7iogr_120",K="_searchLive_7iogr_124",Q="_active2_7iogr_128",W="_searchDefault_7iogr_132",X="_star_7iogr_142",Y="_video_7iogr_145",Z="_living_7iogr_154",tt="_animation_7iogr_171";var a={classHeader:y,"teacher-elegant":"_teacher-elegant_7iogr_4",label:T,elegant:D,itemBg:E,tedeoItem:H,teCover:F,teSection:k,teTitle:x,info:A,teUserInfo:O,teUserLogo:P,teUserName:V,teUserNum:B,searchContainer:$,item:q,searchItem:z,title:G,content:J,searchFollow:M,active:R,searchLive:K,active2:Q,searchDefault:W,star:X,video:Y,living:Z,animation:tt};function et(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!S(s)}var jt=p({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 o=await l.get("/api-student/subject/subjectSelect");this.subjectList=o.data||[]}catch{}const s=u(d.ELEGANT);if(s.id)this.params.subjectId=Number(s.id),this.params.subjectName=s.name;else{const o=this.subjectList,c=((e=r.user.data)==null?void 0:e.subjectId)||"",m=c?Number(c.split(",")[0]):null;o.forEach(_=>{(_.subjects||[]).forEach(i=>{i.id===Number(m)&&(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 s={...this.params};r.version&&(s.version=r.version||"",s.platform="ios-student");const e=await l.post("/api-student/teacher/stylePage",{data:{...s}});this.loading=!1;const o=e.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.subjectId&&u(d.ELEGANT,JSON.stringify({id:this.params.subjectId,name:this.params.subjectName}),"set"),this.getList()},onSearch(s){this.params.username=s,this.onSort()},onDetail(s){this.$router.push({path:"/teacherHome",query:{teacherId:s.userId}})}},render(){let s;return t("div",{class:a["teacher-elegant"]},[t(N,{offsetTop:0,position:"top"},{default:()=>[t("div",{ref:"header"},[t(g,{class:a.classHeader,border:!1,background:"transparent",isFixed:!1},null),t(j,{placeholder:"\u8BF7\u8F93\u5165\u8001\u5E08\u540D\u79F0",onSearch:this.onSearch},{left:()=>t("div",{class:a.label,onClick:()=>{this.searchStatus=!this.searchStatus,this.openStatus=!this.openStatus}},[this.params.subjectName,t(f,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])})])]}),this.dataShow?t(I,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,class:[a.elegant],onLoad:this.getList},et(s=this.list.map(e=>t("div",{class:a.tedeoItem},[t("div",{class:a.itemBg,onClick:()=>{this.onDetail(e)}},null),t("div",{class:a.teCover},[t(n,{src:e.cover||U,fit:"cover"},null),e.living===1&&t("div",{class:a.living},[t(n,{src:w,class:a.animation},null),t("span",null,[h("\u76F4\u64AD\u4E2D")])])]),t("div",{class:a.teSection},[t("div",{class:a.info},[t("div",{class:a.teUserInfo},[t(n,{src:e.avatar||C,class:a.teUserLogo},null),t("span",{class:[a.teUserName,"van-hairline--right van-ellipsis"]},[(e==null?void 0:e.username)||`\u6E38\u5BA2${(e==null?void 0:e.userId)||""}`])]),t("span",{class:a.teUserNum},[e.browse,h("\u6D4F\u89C8")])])])])))?s:{default:()=>[s]}):t(b,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8001\u5E08\u98CE\u91C7"},null),t(v,{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(L,{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{jt as default};
|