teacher-elegant.b176e715.js 5.2 KB

12
  1. import{d as g,w as l,g as r,j as t,M as p,z as h,C as f,aR as b,Z as S}from"./index.e6d6174e.js";import{C as v}from"./index.045f03fd.js";import{S as j}from"./index.c42f80e3.js";import{L as I}from"./index.f904775d.js";import{S as N}from"./index.9093bc60.js";import{I as n}from"./index.67c54471.js";import{O as L}from"./organ-search.02ca21ae.js";import{i as U}from"./icon_teacher.40b6f077.js";import{i as C}from"./icon_upload_poster.81da3a98.js";import{b as w}from"./bars.4f1962a6.js";import{a as u,S as d}from"./hooks.00b5b341.js";import"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.af99cf22.js";import"./index.17d70acf.js";import"./use-id.f239f36f.js";import"./use-tab-status.e9ba8498.js";import"./index.05f2b7dd.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",O="_info_7iogr_62",P="_teUserInfo_7iogr_67",V="_teUserLogo_7iogr_74",A="_teUserName_7iogr_81",B="_teUserNum_7iogr_86",z="_searchContainer_7iogr_89",q="_item_7iogr_27",G="_searchItem_7iogr_98",M="_title_7iogr_102",R="_content_7iogr_110",$="_searchFollow_7iogr_116",J="_active_7iogr_120",Z="_searchLive_7iogr_124",K="_active2_7iogr_128",Q="_searchDefault_7iogr_132",W="_star_7iogr_142",X="_video_7iogr_145",Y="_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:O,teUserInfo:P,teUserLogo:V,teUserName:A,teUserNum:B,searchContainer:z,item:q,searchItem:G,title:M,content:R,searchFollow:$,active:J,searchLive:Z,active2:K,searchDefault:Q,star:W,video:X,living:Y,animation:tt};function et(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!S(s)}var jt=g({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(v,{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(p,{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||C,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||U,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(f,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u8001\u5E08\u98CE\u91C7"},null),t(b,{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};