1 |
- import{d as _,y as l,g as r,j as t,N as p,A as h,C as g,aS as b,$ as S}from"./ResizeObserver.es.b7226882.js";import{C as v}from"./index.969bba7f.js";import{S as j}from"./index.521acd0b.js";import{L as I}from"./index.9fec2202.js";import{S as N}from"./index.f6c44874.js";import{I as n}from"./index.20c0f4c5.js";import{O as L}from"./organ-search.59e9ff38.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.a4ed20cb.js";import"./index.40f703b6.js";import"./index.021f1c7b.js";import"./use-id.5d5e6e63.js";import"./use-tab-status.db1f6d2e.js";import"./index.ed3a5560.js";const y="_classHeader_1s2fr_1",T="_label_1s2fr_9",D="_elegant_1s2fr_21",E="_itemBg_1s2fr_27",F="_tedeoItem_1s2fr_36",H="_teCover_1s2fr_44",k="_teSection_1s2fr_54",x="_teTitle_1s2fr_57",A="_info_1s2fr_62",O="_teUserInfo_1s2fr_67",P="_teUserLogo_1s2fr_74",V="_teUserName_1s2fr_81",B="_teUserNum_1s2fr_86",$="_searchContainer_1s2fr_90",q="_item_1s2fr_27",z="_searchItem_1s2fr_99",G="_title_1s2fr_103",J="_content_1s2fr_111",M="_searchFollow_1s2fr_117",R="_active_1s2fr_121",K="_searchLive_1s2fr_125",Q="_active2_1s2fr_129",W="_searchDefault_1s2fr_133",X="_star_1s2fr_143",Y="_video_1s2fr_146",Z="_living_1s2fr_155",tt="_animation_1s2fr_172";var a={classHeader:y,"teacher-elegant":"_teacher-elegant_1s2fr_4",label:T,elegant:D,itemBg:E,tedeoItem:F,teCover:H,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 st(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!S(e)}var St=_({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 s;try{const o=await l.get("/api-student/subject/subjectSelect");this.subjectList=o.data||[]}catch{}const e=u(d.ELEGANT);if(e.id)this.params.subjectId=Number(e.id),this.params.subjectName=e.name;else{const o=this.subjectList,c=((s=r.user.data)==null?void 0:s.subjectId)||"",f=c?Number(c.split(",")[0]):null;o.forEach(m=>{(m.subjects||[]).forEach(i=>{i.id===Number(f)&&(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 e={...this.params};r.version&&(e.version=r.version||"",e.platform="ios-student");const s=await l.post("/api-student/teacher/stylePage",{data:{...e}});this.loading=!1;const o=s.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(e){this.params.username=e,this.onSort()},onDetail(e){this.$router.push({path:"/teacher-style",query:{teacherId:e.userId}})}},render(){let e;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":s=>this.loading=s,finished:this.finished,finishedText:" ",immediateCheck:!1,class:[a.elegant],onLoad:this.getList},st(e=this.list.map(s=>t("div",{class:a.tedeoItem},[t("div",{class:a.itemBg,onClick:()=>{this.onDetail(s)}},null),t("div",{class:a.teCover},[t(n,{src:s.cover||C,fit:"cover"},null),s.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:s.avatar||U,class:a.teUserLogo},null),t("span",{class:[a.teUserName,"van-hairline--right van-ellipsis"]},[(s==null?void 0:s.username)||`\u6E38\u5BA2${(s==null?void 0:s.userId)||""}`])]),t("span",{class:a.teUserNum},[s.browse,h("\u6D4F\u89C8")])])])])))?e:{default:()=>[e]}):t(g,{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":s=>this.params.subjectId=s,subjectName:this.params.subjectName,"onUpdate:subjectName":s=>this.params.subjectName=s},null)]})])}});export{St as default};
|