teacher-home.279a30e8.js 32 KB

1
  1. var me=Object.defineProperty,pe=Object.defineProperties;var ge=Object.getOwnPropertyDescriptors;var ae=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var ie=(e,s,a)=>s in e?me(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,I=(e,s)=>{for(var a in s||(s={}))fe.call(s,a)&&ie(e,a,s[a]);if(ae)for(var a of ae(s))_e.call(s,a)&&ie(e,a,s[a]);return e},X=(e,s)=>pe(e,ge(s));import{_ as N,a as w,b as D,c as P,d as F,e as E,f as B,g as A,h as $,i as U,j as G,k as q,l as H,m as O,n as M,o as V,p as Y,q as z,r as R,s as i,I as ve}from"./teacher-header.module.deeefda7.js";import{C as be}from"./index.9d97786a.js";import{d as v,T as oe,a as t,F as m,j as o,C as j,I as u,G as Ie,B as C,K as ne,x as Q,P as W,g as d,D as J,y as re,Y as je,U as ye,N as Ce,M as ce,J as Se,t as Te,v as Le,w as L}from"./vendor.cd162bf7.js";/* empty css *//* empty css *//* empty css */import{S as Z}from"./index.292571c9.js";import{C as xe}from"./index.af272712.js";import{r as p,p as ee,s as S,l as le,C as te,m as ke}from"./index.1abcff74.js";/* empty css *//* empty css *//* empty css */import{i as Ne}from"./icon_upload_poster.81da3a98.js";import{C as we}from"./index.f92b6537.js";/* empty css *//* empty css *//* empty css *//* empty css */import{o as T}from"./orderStatus.314960ca.js";import{t as De}from"./tradeOrder.b8ac1e2e.js";/* empty css */import{i as Pe}from"./icon_timer2.5fb1750d.js";import{I as se}from"./icon_teacher.cb128c00.js";import Fe from"./index.054a0336.js";import{m as Ee}from"./music.e692d8ba.js";import{u as Be,a as Ae}from"./index.a576332b.js";/* empty css */import{I as $e,a as Ue}from"./icon-jiaozi.20e415ca.js";/* empty css *//* empty css */import"./index.aec0a459.js";import"./index.a64b1b02.js";import"./item.c2a5e2e3.js";import"./index.926ca9c5.js";import"./music-icon.c20abf48.js";import"./init-user-icon.6387573f.js";import"./favorite.cb69f4f9.js";import"./index.fc271e03.js";import"./code-down-load.47d90056.js";import"./logo.bcac726b.js";import"./browser.ebb85846.js";import"./select-tag.d9ab7c74.js";/* empty css *//* empty css */import"./index.module.da27480e.js";import"./select-subject.55dedf94.js";import"./hooks.98aa8438.js";import"./index.339fc024.js";const Ge="_bgImg_nb6q8_22",qe="_bg_nb6q8_22",He="_teacherHeader_nb6q8_40";var K={"teacher-record":"_teacher-record_nb6q8_1",bgImg:Ge,bg:qe,teacherHeader:He};const Oe="_single_14ksn_1",Me="_introduction_14ksn_4",Ve="_videoList_14ksn_10",Ye="_itemBg_14ksn_16",ze="_videoItem_14ksn_25",Re="_video_14ksn_10",We="_fansGroup_14ksn_55",Je="_fansImage_14ksn_71",Ke="_fansTitle_14ksn_77",Xe="_videoGroup_14ksn_83";var f={single:Oe,introduction:Me,videoList:Ve,itemBg:Ye,videoItem:ze,"icon-upload":"_icon-upload_14ksn_34",video:Re,fansGroup:We,fansImage:Je,fansTitle:Ke,videoGroup:Xe};const Qe="_filterTitle_cir06_1",Ze="_fansGroup_cir06_9",et="_introduce_cir06_19",tt="_fansImage_cir06_25",st="_fansTitle_cir06_31",at="_joinContainer_cir06_37",it="_joinText_cir06_40";var y={filterTitle:Qe,fansGroup:Ze,introduce:et,fansImage:tt,fansTitle:st,joinContainer:at,joinText:it};const ot=e=>{const s=`../images/${e}`;return{"../images/cert_active.png":N,"../images/cert_default.png":w,"../images/follow_bg.png":D,"../images/head_bg.png":P,"../images/icon-chat.png":F,"../images/icon-close.png":E,"../images/icon_fans.png":B,"../images/icon_subject.png":A,"../images/icon_video.png":$,"../images/live_active.png":U,"../images/live_bg.png":G,"../images/live_default.png":q,"../images/music_active.png":H,"../images/music_default.png":O,"../images/teacher-icon.png":M,"../images/video_active.png":V,"../images/video_default.png":Y,"../images/vip_active.png":z,"../images/vip_default.png":R}[s].default};var nt=v({name:"joinChat",props:{item:{type:Object,default:{}},onClose:{type:Function,default:e=>{}}},data(){return{desc:""}},methods:{async onJoinChat(){try{await p.post("/api-student/imGroupMemberAudit/apply",{data:{groupId:this.item.id,auditStatus:"AUDITING",roleType:"STUDENT",desc:this.desc}}),oe("\u7533\u8BF7\u6210\u529F"),this.desc="",this.onClose&&this.onClose(this.item.id)}catch{}}},render(){return t(m,null,[t("div",{class:[y.filterTitle,"van-hairline--bottom"]},[o("\u7533\u8BF7\u5165\u7FA4")]),t("div",{class:y.joinContainer},[t(j,{center:!0,class:y.fansGroup,border:!1},{icon:()=>t(u,{src:this.item.img||ot("icon_fans.png"),fit:"cover",class:y.fansImage},null),title:()=>t("div",{class:y.fansTitle},[t("div",{class:y.title},[this.item.name]),t("p",{class:["van-ellipsis",y.introduce]},[this.item.introduce])])}),t(Ie,{type:"textarea",class:y.joinText,rows:2,maxlength:200,modelValue:this.desc,"onUpdate:modelValue":e=>this.desc=e,placeholder:"\u8BF7\u586B\u5199\u60A8\u7684\u5165\u7FA4\u7533\u8BF7\uFF0C\u4F1A\u66F4\u5FEB\u7684\u88AB\u901A\u8FC7\u5594\uFF5E"},null)]),t("div",{class:"btnGroup"},[t(C,{type:"primary",block:!0,round:!0,style:{width:"70%",margin:"0 auto"},onClick:this.onJoinChat},{default:()=>[o("\u786E\u8BA4")]})])])}});function rt(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Q(e)}const ue=e=>{const s=`../images/${e}`;return{"../images/cert_active.png":N,"../images/cert_default.png":w,"../images/follow_bg.png":D,"../images/head_bg.png":P,"../images/icon-chat.png":F,"../images/icon-close.png":E,"../images/icon_fans.png":B,"../images/icon_subject.png":A,"../images/icon_video.png":$,"../images/live_active.png":U,"../images/live_bg.png":G,"../images/live_default.png":q,"../images/music_active.png":H,"../images/music_default.png":O,"../images/teacher-icon.png":M,"../images/video_active.png":V,"../images/video_default.png":Y,"../images/vip_active.png":z,"../images/vip_default.png":R}[s].default};var ct=v({name:"single",props:{userInfo:{type:Object,default:{}}},data(){const e=this.$route.query;return{videoStatus:!1,chatStatus:!1,teacherId:e.teacherId,fansList:[],chatItem:{},videoItem:{},isAddBrowse:!1}},async mounted(){try{const e=await p.post("/api-student/imGroup/queryTeacherGroup",{data:{type:"FAN",createUserId:this.teacherId}});this.fansList=e.data||[]}catch{}},methods:{async onDetail(e){if(!e.hasWaitAuditFlag&&!e.existFlag){this.chatStatus=!0,this.chatItem=e;return}e.existFlag&&ee({api:"joinChatGroup",content:{type:"multi",id:e.id}})},async onPlay(){try{if(!this.isAddBrowse)return;await p.get("/api-student/teacher/addVideoBrowse",{hideLoading:!0,params:{videoId:this.videoItem.id}}),this.isAddBrowse=!1}catch{}}},render(){let e;const s=this.userInfo;return t("div",{class:f.single},[s.introduction&&t(Z,{icon:"personal",title:"\u4E2A\u4EBA\u4ECB\u7ECD",size:24,border:!1},{default:()=>[t("p",{class:f.introduction},[s.introduction])]}),s.styleVideo&&s.styleVideo.length>0&&t(Z,{icon:"elegant",title:"\u8001\u5E08\u98CE\u91C7",size:24,border:!1},{default:()=>[t("div",{class:f.videoList},[s.styleVideo.map(a=>t("div",{class:f.videoItem},[t("div",{class:f.itemBg,onClick:()=>{this.videoStatus=!0,this.isAddBrowse=!0,this.videoItem=a}},null),t(ne,{class:f["icon-upload"],name:ue("icon_video.png"),size:26},null),t(u,{src:a.cover||Ne,fit:"cover"},null)]))])]}),this.fansList&&this.fansList.length>0&&t(Z,{icon:"fans",title:"\u7C89\u4E1D\u7FA4",size:24,border:!1},rt(e=this.fansList.map(a=>t(j,{center:!0,class:f.fansGroup,border:!1},{icon:()=>t(u,{src:a.img||ue("icon_fans.png"),fit:"cover",class:f.fansImage},null),title:()=>t("div",{class:f.fansTitle},[t("div",{class:f.title},[a.name]),t("p",{class:"van-ellipsis"},[a.introduce])]),default:()=>t(C,{type:"primary",size:"small",round:!0,disabled:a.hasWaitAuditFlag,onClick:()=>this.onDetail(a)},{default:()=>[a.existFlag?"\u53BB\u804A\u5929":"",a.hasWaitAuditFlag?"\u5BA1\u6838\u4E2D":"",!a.hasWaitAuditFlag&&!a.existFlag?"\u7533\u8BF7\u5165\u7FA4":""]})})))?e:{default:()=>[e]}),t(W,{show:this.chatStatus,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:()=>this.chatStatus=!1},{default:()=>[t(nt,{item:this.chatItem,onClose:a=>{this.fansList.forEach(l=>{l.id===a&&(l.hasWaitAuditFlag=!0)}),this.chatStatus=!1}},null)]}),t(W,{show:this.videoStatus,round:!0,class:f.videoGroup,closeable:!0,onClose:()=>{this.videoStatus=!1,this.isAddBrowse=!1}},{default:()=>{var a;return[this.videoStatus&&t(xe,{playsinline:!0,onPlay:this.onPlay,src:((a=this.videoItem)==null?void 0:a.videoUrl)+"#t=0.1"},null)]}})])}});const lt="_practice_xjmim_1",ut="_group_xjmim_5",dt="_price_xjmim_10",ht="_rTag_xjmim_27",mt="_tag_xjmim_30",pt="_selectPopup_xjmim_34",gt="_selectContainer_xjmim_39",ft="_rTitle_xjmim_42",_t="_selectPopupContent_xjmim_45",vt="_desc_xjmim_48",bt="_times_xjmim_49",It="_selectBtn_xjmim_60",jt="_btn_xjmim_65",yt="_protocol_xjmim_84",Ct="_arrangeCell_xjmim_88",St="_fixedBtn_xjmim_94";var c={practice:lt,group:ut,price:dt,rTag:ht,tag:mt,selectPopup:pt,selectContainer:gt,rTitle:ft,selectPopupContent:_t,desc:vt,times:bt,selectBtn:It,btn:jt,protocol:yt,arrangeCell:Ct,fixedBtn:St},Tt=v({name:"practice",props:{userInfo:{type:Object,default:{}}},data(){const e=this.$route.query;return{teacherId:e.teacherId,subjectId:e.subjectId,teacherSubjectList:[],subjectStatus:!1,subjectInfo:{subjectPrice:0,courseMinutes:0,subjectName:"",subjectId:0},courseNum:4,calendarStatus:!1,calendarList:[],selectCourseList:[],coursePlanStatus:!1,selectStatus:!1,coursePlanList:[],calendarDate:d().add(1,"day").toDate(),settingStatus:!0,loadDataStatus:!0}},async mounted(){var e;try{this.loadDataStatus=!0;const s=await p.get("/api-student/courseSchedule/getTeacherSubjectPrice",{params:{teacherId:this.teacherId}});this.loadDataStatus=!1;const a=s.data||[];if(a.length>0){const l=this.subjectId||((e=S.user.data)==null?void 0:e.subjectId),r=a.find(k=>k.subjectId===Number(l))||a[0],{subjectName:b,subjectPrice:x,courseMinutes:de,subjectId:he}=r;this.subjectInfo={subjectPrice:x,courseMinutes:de,subjectName:b,subjectId:he},a.forEach(k=>{k.name=k.subjectName}),this.teacherSubjectList=a,this.getList(),this.onBuy(!0),this.settingStatus=!0}else this.settingStatus=!1}catch{this.loadDataStatus=!1}},computed:{showSelectList(){let s=[...this.selectCourseList];return s.forEach(a=>{a.title=d(a.startTime).format("YYYY-MM-DD")+" "+le(d(a.startTime).day())+" "+a.start+"~"+a.end}),s},selectType(){return this.selectCourseList.length<this.courseNum?"noEnough":"enough"}},methods:{async onSubmit(){if(this.selectCourseList.length<=0){oe("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u65F6\u95F4");return}if(this.selectCourseList.length<this.courseNum){this.selectStatus=!0;return}await this._lookCourse()},async getList(e){var s;try{const a=e||d().add(1,"day").toDate();let l={day:d(a).format("DD"),month:d(a).format("MM"),year:d(a).format("YYYY")};const r=(await p.post("/api-student/courseSchedule/createPracticeCourseCalendar",{data:X(I({},l),{studentId:(s=S.user.data)==null?void 0:s.userId,teacherId:this.teacherId})})).data||[];let b={};r.forEach(x=>{b[x.date]=x}),this.calendarList=b,this.calendarStatus=r.length>0}catch{}},onSelectDay(e){const s=e||[];let a=[...this.selectCourseList];s.forEach(n=>{!a.some(b=>b.startTime===n.startTime)&&a.push(I({},n))});let l=[];a.forEach(n=>{s.some(b=>b.startTime===n.startTime)&&l.push(n)}),l.sort((n,r)=>n.startTime>r.startTime?1:n.startTime<r.startTime?-1:0),console.log(l,"list"),this.selectCourseList=[...l]},onCloseTag(e){J.confirm({title:"\u63D0\u793A",message:"\u60A8\u662F\u5426\u8981\u5220\u9664\u8BE5\u9009\u62E9\u7684\u8BFE\u7A0B\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(()=>{const s=this.selectCourseList.findIndex(a=>a.startTime===e.startTime);this.selectCourseList.splice(s,1)})},async _lookCourse(e){try{let s=[];this.selectCourseList.forEach(n=>{s.push({startTime:n.startTime,endTime:n.endTime})}),((await p.post("/api-student/courseGroup/lockCourseToCache",{data:{courseNum:this.courseNum,courseType:"PRACTICE",loop:this.selectType==="noEnough"?1:0,teacherId:this.teacherId,timeList:[...s]}})).data||[]).forEach((n,r)=>{this.coursePlanList[r]=X(I({},this.coursePlanList[r]),{startTime:n.startTime,endTime:n.endTime,classNum:r+1})}),this.coursePlanStatus=!0,this.selectStatus=!0,e&&e()}catch(s){const a=s.message;J.alert({title:"\u63D0\u793A",confirmButtonColor:"var(--van-primary)",message:a}).then(()=>{this.getList(this.calendarDate||new Date),this.selectCourseList=[],this.selectStatus=!1})}},async onReset(){this.coursePlanStatus||this.selectType==="enough"?(this.selectStatus=!1,setTimeout(()=>{this.coursePlanList=[]},500)):this.selectType==="noEnough"&&(this.selectStatus=!1),setTimeout(()=>{this.coursePlanStatus=!1},500)},async onSure(){const e=this.coursePlanStatus;await this._lookCourse(()=>{e&&(this.selectStatus=!1,this.onBuy())})},async onBuy(e){try{const s=await p.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"PRACTICE",bizId:this.teacherId}}),a=this.subjectInfo,l=[...this.coursePlanList];l.forEach(r=>{r.classDate=d(r.startTime).format("YYYY-MM-DD"),r.title=`${d(r.startTime).format("YYYY-MM-DD")} ${le(d(r.startTime).day())} ${d(r.startTime).format("HH:mm")}~${d(r.endTime).format("HH:mm")}`}),T.orderObject.orderType="PRACTICE",T.orderObject.orderName=a.subjectName+"\u966A\u7EC3\u8BFE",T.orderObject.orderDesc=a.subjectName+"\u966A\u7EC3\u8BFE",T.orderObject.actualPrice=Number((this.courseNum*a.subjectPrice).toFixed(2)),T.orderObject.orderNo="",T.orderObject.orderList=[{orderType:"PRACTICE",goodsName:a.subjectName+"\u966A\u7EC3\u8BFE",courseGroupName:a.subjectName+"\u966A\u7EC3\u8BFE",courseIntroduce:a.subjectName+"\u966A\u7EC3\u8BFE",subjectId:a.subjectId,singleCourseMinutes:a.courseMinutes,courseNum:this.courseNum,coursePrice:(this.courseNum*a.subjectPrice).toFixed(2),teacherName:this.userInfo.username||`\u6E38\u5BA2${this.userInfo.userId||""}`,teacherId:this.userInfo.userId,starGrade:this.userInfo.starGrade,avatar:this.userInfo.heardUrl,classTime:l}];const n=s.data;n?J.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{De(n,this.routerTo)}).catch(()=>{J.close(),this.cancelPayment(n.orderNo)}):!e&&this.routerTo()}catch{}},routerTo(){this.$router.push({path:"/orderDetail",query:{orderType:"PRACTICE"}})},async cancelPayment(e){try{await p.post("/api-student/userOrder/orderCancel",{data:{orderNo:e}})}catch{}}},render(){return t(m,null,[!this.loadDataStatus&&(this.settingStatus?t(m,null,[t("div",{class:c.practice},[t(re,{class:c.group,border:!1},{default:()=>[this.subjectInfo.subjectPrice>0&&t(j,{title:"\u966A\u7EC3\u8BFE\u6536\u8D39"},{default:()=>t("div",{class:c.price},[t("span",null,[o("\xA5"),this.$filters.moneyFormat(this.subjectInfo.subjectPrice)]),o("/"),this.subjectInfo.courseMinutes,o("\u5206\u949F")])}),t(j,{title:"\u9009\u62E9\u4E13\u4E1A",isLink:!0,value:this.subjectInfo.subjectName,onClick:()=>this.subjectStatus=!0},null),t(j,{title:"\u8BFE\u65F6\u6570"},{default:()=>t(je,{modelValue:this.courseNum,"onUpdate:modelValue":e=>this.courseNum=e,theme:"round",max:12,min:1,buttonSize:22,onChange:()=>{this.selectCourseList=[]}},null)})]}),this.calendarStatus&&t("div",{class:c.group},[t(we,{selectList:this.selectCourseList,list:this.calendarList,maxDays:this.courseNum,nextMonth:e=>this.getList(e),prevMonth:e=>this.getList(e),selectDay:this.onSelectDay,calendarDate:this.calendarDate,"onUpdate:calendarDate":e=>this.calendarDate=e},null)]),t(j,{class:[c.arrangeCell]},{title:()=>t("div",{class:c.rTitle},[t("span",null,[o("\u5DF2\u9009\u62E9\u8BFE\u7A0B\u65F6\u95F4")])]),label:()=>t("div",{class:c.rTag},[this.showSelectList.map(e=>t(m,null,[t(ye,{plain:!0,round:!0,closeable:!0,size:"large",type:"primary",class:c.tag,onClose:()=>this.onCloseTag(e)},{default:()=>[e.title]}),t("br",null,null)]))])}),t(W,{show:this.selectStatus,class:c.selectPopup},{default:()=>[t("div",{class:c.selectContainer},[t("div",{class:c.rTitle},[t("span",null,[o("\u63D0\u793A")])]),t("div",{class:c.selectPopupContent},[t("p",{class:c.desc},[this.selectType==="noEnough"&&!this.coursePlanStatus?"\u60A8\u6240\u9009\u62E9\u7684\u4E0A\u8BFE\u65F6\u95F4\u672A\u8FBE\u5230\u60A8\u8F93\u5165\u7684\u8BFE\u65F6\u6570\uFF0C\u7CFB\u7EDF\u6839\u636E\u5DF2\u9009\u65F6\u95F4\u5C06\u81EA\u52A8\u6309\u5468\u987A\u5EF6\u6392\u8BFE\u3002":"\u60A8\u5DF2\u9009\u62E9\u4EE5\u4E0B\u4E0A\u8BFE\u65F6\u95F4\u6BB5\uFF0C\u65F6\u95F4\u6BB5\u4F1A\u6682\u65F6\u9501\u5B9A\uFF0C\u9501\u5B9A\u671F\u95F4\u5B66\u5458\u4E0D\u53EF\u8D2D\u4E70\u8BE5\u65F6\u95F4\u6BB5\u8BFE\u7A0B\u3002"]),this.coursePlanList&&this.coursePlanList.length>0&&this.coursePlanStatus&&t("p",{class:c.times},[this.coursePlanList.map(e=>t("span",null,[d(e.startTime||new Date).format("YYYY-MM-DD")," ",d(e.startTime||new Date).format("HH:mm"),o("~"),d(e.endTime||new Date).format("HH:mm")]))])]),t("div",{class:c.selectBtn},[t(C,{class:c.btn,type:"primary",round:!0,block:!0,plain:!0,onClick:this.onReset},{default:()=>[this.selectType==="noEnough"?"\u7EE7\u7EED\u9009\u62E9":"\u91CD\u65B0\u9009\u62E9"]}),t(C,{class:c.btn,type:"primary",round:!0,block:!0,onClick:this.onSure},{default:()=>[o("\u786E\u8BA4")]})])])]}),t(Ce,{show:this.subjectStatus,actions:this.teacherSubjectList,cancelText:"\u53D6\u6D88",closeOnClickAction:!0,onCancel:()=>this.subjectStatus=!1,onSelect:e=>{const{subjectName:s,subjectPrice:a,courseMinutes:l,subjectId:n}=e;this.subjectInfo={subjectPrice:a,courseMinutes:l,subjectName:s,subjectId:n},this.subjectStatus=!1}},null)]),t("div",{class:["btnGroup",c.fixedBtn],style:{background:"#fff",paddingTop:"10px"}},[t(C,{block:!0,round:!0,type:"primary",onClick:this.onSubmit},{default:()=>[o("\u786E\u8BA4\u7EA6\u8BFE")]})])]):t(te,{btnStatus:!1,classImgSize:"SMALL",tips:"\u8001\u5E08\u6682\u672A\u5F00\u653E\u966A\u7EC3\u8BFE"},null))])}});const Lt="_liveList_1qowf_1",xt="_liCover_1qowf_4",kt="_liContent_1qowf_10",Nt="_liTitle_1qowf_13",wt="_avatar_1qowf_22",Dt="_liUserInfo_1qowf_29",Pt="_userInfo_1qowf_30",Ft="_num_1qowf_42",Et="_buyNum_1qowf_45",Bt="_price_1qowf_51",At="_liveGroup_1qowf_59",$t="_subjectName_1qowf_64";var g={liveList:Lt,liCover:xt,liContent:kt,liTitle:Nt,avatar:wt,liUserInfo:Dt,userInfo:Pt,num:Ft,buyNum:Et,price:Bt,liveGroup:At,subjectName:$t};function Ut(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Q(e)}var Gt=v({name:"live",data(){const e=this.$route.query;return{list:[],dataShow:!0,loading:!1,finished:!1,params:{teacherId:e.teacherId,groupStatus:"APPLY",page:1,rows:20}}},mounted(){this.getList()},methods:{formatTime(e){let s=d(e||new Date);const a=["\u5468\u65E5","\u5468\u4E00","\u5468\u4E8C","\u5468\u4E09","\u5468\u56DB","\u5468\u4E94","\u5468\u516D"];return s.format("YYYY-MM-DD")+`(${a[s.day()]})`},async getList(){try{const e=I({},this.params);S.version&&(e.version=S.version||"",e.platform="ios-student");const s=await p.post("/api-student/courseGroup/queryPageCourseGroup",{data:I({},e)});this.loading=!1;const a=s.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}},onDetail(e){this.$router.push({path:"/liveDetail",query:{groupId:e.courseGroupId}})}},render(){let e;return t(m,null,[this.dataShow?t(ce,{class:g.liveList,loading:this.loading,"onUpdate:loading":s=>this.loading=s,immediateCheck:!1,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86"},Ut(e=this.list.map(s=>t(re,{class:g.liveGroup,border:!1,onClick:()=>this.onDetail(s)},{default:()=>[t(j,null,{icon:()=>t("div",{style:{position:"relative"}},[t(u,{class:g.liCover,src:s.backgroundPic,fit:"cover"},null),t("span",{class:g.subjectName},[s==null?void 0:s.subjectName])]),title:()=>t("div",{class:g.liContent},[t("div",{class:[g.liTitle,"van-ellipsis"]},[s.courseGroupName]),t("div",{class:g.liUserInfo},[t("div",{class:[g.userInfo,"van-hairline--right"]},[t(u,{class:g.avatar,fit:"cover",src:s.avatar||se},null),t("p",null,[o("\u8001\u5E08\uFF1A"),s.teacherName||`\u6E38\u5BA2${s.teacherId}`])]),s.existBuy===1?t("span",{class:g.buyNum},[o("\u5DF2\u8D2D\u4E70")]):t("span",{class:g.num},[s.studentCount,o("\u4EBA\u5DF2\u8D2D\u4E70")])])])}),t(j,{titleStyle:{color:"#666666",fontSize:"13px"}},{title:()=>t("span",{style:{display:"flex",alignItems:"center",fontSize:"13px"}},[t(ne,{name:Pe,size:"16",style:{marginRight:"5px"}},null),this.formatTime(s.salesStartDate)]),default:()=>t("div",{class:g.price},[s.coursePrice>0&&t(m,null,[t("span",null,[o("\xA5"),this.$filters.moneyFormat(s.coursePrice)]),o("/")]),s.courseNum,o("\u8BFE\u65F6")])})]})))?e:{default:()=>[e]}):t(te,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u76F4\u64AD\u8BFE"},null)])}});const qt="_videoItem_ck7bl_1",Ht="_viCover_ck7bl_8",Ot="_viSection_ck7bl_13",Mt="_viTitle_ck7bl_16",Vt="_viUserInfo_ck7bl_21",Yt="_viUserLogo_ck7bl_28",zt="_viUserName_ck7bl_35",Rt="_viUserNum_ck7bl_39",Wt="_viPrice_ck7bl_42",Jt="_subjectName_ck7bl_47";var _={videoItem:qt,viCover:Ht,viSection:Ot,viTitle:Mt,viUserInfo:Vt,viUserLogo:Yt,viUserName:zt,viUserNum:Rt,viPrice:Wt,subjectName:Jt},Kt=v({name:"VideoItem",props:{item:Object,onClick:{type:Function,default:e=>{}}},render(){const e=this.item;return t("div",{class:_.videoItem,onClick:()=>{this.onClick(e)}},[t("div",{style:{position:"relative"}},[t(u,{class:_.viCover,fit:"cover",src:e==null?void 0:e.lessonCoverUrl},null),t("span",{class:_.subjectName},[e==null?void 0:e.lessonSubjectName])]),t("div",{class:_.viSection},[t("div",{class:[_.viTitle,"van-ellipsis"]},[e==null?void 0:e.lessonName]),t("div",{class:_.viUserInfo},[t(u,{src:(e==null?void 0:e.avatar)||se,class:_.viUserLogo},null),t("span",{class:[_.viUserName,"van-hairline--right"]},[(e==null?void 0:e.userName)||`\u6E38\u5BA2${(e==null?void 0:e.teacherId)||""}`]),t("span",{class:_.viUserNum},[e==null?void 0:e.countStudent,o("\u4EBA\u5DF2"),(e==null?void 0:e.lessonPrice)>0?"\u8D2D\u4E70":"\u9886\u53D6"])]),t("div",{class:_.viPrice},[(e==null?void 0:e.lessonPrice)>0&&t(m,null,[o("\uFFE5"),e==null?void 0:e.lessonPrice,o("/")]),(e==null?void 0:e.lessonPrice)<=0&&e.auditVersion!==0&&t(m,null,[o("\uFFE5"),0,o("/")]),(e==null?void 0:e.lessonPrice)<=0&&e.auditVersion===0&&t(m,null,[o("\u514D\u8D39/")]),e==null?void 0:e.lessonCount,o("\u8BFE\u65F6")])])])}});const Xt="_videoList_1yf9v_1";var Qt={videoList:Xt};function Zt(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Q(e)}var es=v({name:"VideoList",data(){const e=this.$route.query;return{list:[],dataShow:!0,loading:!1,finished:!1,params:{teacherId:e.teacherId,page:1,rows:20}}},mounted(){this.getList()},methods:{async getList(){try{const e=I({},this.params);S.version&&(e.version=S.version||"",e.platform="ios-student");const s=await p.post("/api-student/videoLesson/selectGroup",{data:I({},e)});this.loading=!1;const a=s.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}},onDetail(e){this.$router.push({path:"/videoDetail",query:{groupId:e.id}})}},render(){let e;return t(m,null,[this.dataShow?t(ce,{class:Qt.videoList,loading:this.loading,"onUpdate:loading":s=>this.loading=s,finished:this.finished,immediateCheck:!1,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:this.getList},Zt(e=this.list.map(s=>t(Kt,{item:s,onClick:this.onDetail},null)))?e:{default:()=>[e]}):t(te,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u89C6\u9891\u8BFE"},null)])}}),ts=v({name:"music",data(){return{teacherId:this.$route.query.teacherId,list:[],dataShow:!1,loading:!1,finished:!1,params:{page:1,rows:20}}},methods:{onItemClick(e){Ee(e,s=>{this.$router.push({path:s,query:{orderType:"MUSIC"}})})}},render(){return t(m,null,[t(Fe,{hideSearch:!0,onItemClick:this.onItemClick,teacherId:this.teacherId},null)])}});const h=e=>{const s=`../images/${e}`;return{"../images/cert_active.png":N,"../images/cert_default.png":w,"../images/follow_bg.png":D,"../images/head_bg.png":P,"../images/icon-chat.png":F,"../images/icon-close.png":E,"../images/icon_fans.png":B,"../images/icon_subject.png":A,"../images/icon_video.png":$,"../images/live_active.png":U,"../images/live_bg.png":G,"../images/live_default.png":q,"../images/music_active.png":H,"../images/music_default.png":O,"../images/teacher-icon.png":M,"../images/video_active.png":V,"../images/video_default.png":Y,"../images/vip_active.png":z,"../images/vip_default.png":R}[s].default};var ss=v({name:"teacher-header",props:{userInfo:{type:Object,default:{}},teacherId:{type:String||Number,default:""}},data(){return{iconShow:!1}},computed:{subjectNameList(){const s=this.userInfo.subjectName;return s?s.split(","):[]},starGrade(){const{starGrade:e}=this.userInfo;return Number(e)||0}},methods:{async onStart(){try{const e=this.userInfo.isStar?0:1;await p.get("/api-student/teacher/starOrUnStar",{params:{userId:this.teacherId,starStatus:e}}),this.userInfo.isStar=e;let s=e?this.userInfo.fansNum+1:this.userInfo.fansNum-1;this.userInfo.fansNum=s<=0?0:s}catch{}},checkBadge(e){let s=!1;const{userInfo:a}=this;switch(e){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":a.tag&&(s=a.tag.indexOf(e)>-1);break;case"VIP":s=a.isVip>0;break;default:s=!1;break}return s},openTeacherIcon(){this.iconShow=!0}},render(){const e=[{icon:"cert_active.png",title:"\u6F14\u594FMlog\u8FBE\u4EBA",des:"\u4E2A\u4EBA\u98CE\u91C7\u4E2D\u4E0A\u4F20\u8001\u5E08\u98CE\u91C7\u89C6\u9891\u5E76\u901A\u8FC7\u5BA1\u6838"},{icon:"video_active.png",title:"\u6559\u5B66\u89C6\u9891\u8FBE\u4EBA",des:"\u53D1\u5E03\u60A8\u5236\u4F5C\u7684\u6559\u5B66\u89C6\u9891\u8BFE\u7A0B\u5E76\u901A\u8FC7\u5BA1\u6838"},{icon:"live_active.png",title:"\u76F4\u64ADup\u8FBE\u4EBA",des:"\u8FBE\u5230\u5F00\u901A\u76F4\u64AD\u6743\u9650\u6807\u51C6\u5E76\u5F00\u901A\u76F4\u64AD\u529F\u80FD"},{icon:"music_active.png",title:"\u4E50\u8C31\u6B4C\u5355\u8FBE\u4EBA",des:"\u4E0A\u4F20\u60A8\u5236\u4F5C\u7684\u4E50\u8C31\u5E76\u901A\u8FC7\u5BA1\u6838"}];return t(m,null,[t("div",{class:i.headerContent},[t("div",{class:i.headerCount},[t("div",{class:i.teacherContent},[t("div",{class:i.teacherIcon,onClick:()=>{this.userInfo.liveing===1&&ee({api:"joinLiveRoom",content:{roomId:this.userInfo.roomUid,teacherId:this.userInfo.userId}})}},[t(u,{class:[i.avatar,this.checkBadge("VIP")&&i.avatarActive],round:!0,src:this.userInfo.heardUrl||se,fit:"cover"},null),this.userInfo.liveing===1&&t("p",{class:i.liveTag},[o("\u76F4\u64AD\u4E2D")]),t(u,{class:i.teacherIconVip,src:this.checkBadge("VIP")?h("vip_active.png"):h("vip_default.png")},null)]),t("div",{class:i.teacherOperation},[t(C,{type:"primary",size:"small",plain:!0,round:!0,class:[i.btn,this.userInfo.isStar?i.btnStar:""],onClick:this.onStart},{default:()=>[this.userInfo.isStar?"\u5DF2\u5173\u6CE8":"\u5173\u6CE8"]}),t(C,{type:"primary",size:"small",round:!0,style:{marginLeft:"5px"},class:i.btn,icon:ve,onClick:()=>{ee({api:"joinChatGroup",content:{type:"single",id:this.teacherId}})}},{default:()=>[o("\u804A\u5929")]})])]),t("div",{class:i.teacherInfo},[t("div",{class:i.teacherInfoName},[this.userInfo.username||`\u6E38\u5BA2${this.userInfo.userId||""}`]),this.userInfo.degreeFlag?t("img",{src:$e},null):null,this.userInfo.teacherFlag?t("img",{src:Ue},null):null]),t("div",{class:i.teacherHonor},[t("div",null,[o("\u52CB\u7AE0\uFF1A")]),t("div",{class:i.teacherIcons,onClick:this.openTeacherIcon},[t(u,{class:i.iconOther,src:this.checkBadge("STYLE")?h("cert_active.png"):h("cert_default.png")},null),t(u,{class:i.iconOther,src:this.checkBadge("VIDEO")?h("video_active.png"):h("video_default.png")},null),t(u,{class:i.iconOther,src:this.checkBadge("LIVE")?h("live_active.png"):h("live_default.png")},null),t(u,{class:i.iconOther,src:this.checkBadge("MUSIC")?h("music_active.png"):h("music_default.png")},null)]),t("div",{class:i.score},[o("\u8BC4\u5206\uFF1A")]),t("div",{class:i.level},[this.starGrade?t(Se,{readonly:!0,modelValue:this.starGrade,iconPrefix:"iconfont",color:"#FFC459","void-icon":"star_default",icon:"star_active",size:15},null):t("span",{style:{fontSize:"12px",color:"#999999"}},[o("\u6682\u65E0\u8BC4\u5206")])])]),t("div",{class:i.piNameSubject},[t(u,{class:i.subjectSection,src:h("icon_subject.png"),fit:"contain"},null),t("div",{class:i.subjectList},[this.subjectNameList.map(s=>t("span",{class:i.subject},[s]))])]),t("div",{class:i["teacher-bottom"]},[t("div",{class:i["teacher-data"]},[t("div",{class:i["teacher-data_item"]},[o("\u7C89\u4E1D "),t("span",null,[this.userInfo.fansNum||0])]),t("div",{class:i["teacher-data_item"]},[o("\u5DF2\u4E0A\u8BFE\u65F6 "),t("span",null,[this.userInfo.expTime||0])])])])])]),t(W,{class:i.teaherPopup,show:this.iconShow,"onUpdate:show":s=>this.iconShow=s},{default:()=>[t(u,{src:h("teacher-icon.png")},null),t("div",{class:i.teacherIconWrap},[e.map(s=>t("div",{class:i.teacherIconItem},[t("div",{class:i.teacherIconItemTop},[t(u,{src:h(s.icon)},null),t("div",{class:i.teacherIconTitle},[s.title])]),t("div",{class:i.teacherIconDes},[s.des])]))]),t(u,{onClick:()=>this.iconShow=!1,class:i.closeIcon,src:h("icon-close.png")},null)]})])}});const Qs=e=>{const s=`./images/${e}`;return{"./images/cert_active.png":N,"./images/cert_default.png":w,"./images/follow_bg.png":D,"./images/head_bg.png":P,"./images/icon-chat.png":F,"./images/icon-close.png":E,"./images/icon_fans.png":B,"./images/icon_subject.png":A,"./images/icon_video.png":$,"./images/live_active.png":U,"./images/live_bg.png":G,"./images/live_default.png":q,"./images/music_active.png":H,"./images/music_default.png":O,"./images/teacher-icon.png":M,"./images/video_active.png":V,"./images/video_default.png":Y,"./images/vip_active.png":z,"./images/vip_default.png":R}[s].default};var Zs=v({name:"teacherHome",data(){const e=sessionStorage.getItem("teacherHomeTabs")||"",s=this.$route.query;return{teacherId:s.teacherId,tabs:e||s.tabs||"single",userInfo:{},background:"rgba(55, 205, 177, 0)",headColor:"#fff",height:"auto",backIconColor:"white",homeContaiterHeight:""}},async created(){},async mounted(){this.getTeacherDetail(),ke("webViewOnResume",()=>{this.getTeacherDetail()}),Be(document,"scroll",e=>{const{y:s}=Ae();s.value>142?(this.headColor="#000",this.background="#fff",this.backIconColor="black"):(this.background="transparent",this.headColor="#fff",this.backIconColor="white")})},methods:{async getTeacherDetail(){try{const e=await p.get("/api-student/teacher/queryTeacherHome",{params:{userId:this.teacherId}});this.userInfo=e.data}catch{}}},render(){return t("div",{class:K["teacher-record"]},[t("div",{ref:"headers"},[t(be,{background:this.background,border:!1,color:this.headColor,backIconColor:this.backIconColor,onHeaderBack:()=>{this.$nextTick(()=>{const{height:e}=Te(this.$refs.headers);this.height=e,this.homeContaiterHeight=`calc(100vh - var(--van-tabs-line-height) - ${e}px - 15px)`})}},null)]),t("img",{class:K.bgImg,src:this.userInfo.heardUrl},null),t("div",{class:K.bg},null),t("div",{class:K.teacherHeader},[t(ss,{userInfo:this.userInfo,teacherId:this.teacherId},null)]),t(Le,{color:"var(--van-primary)",background:"#f8f9fc",shrink:!0,lineWidth:20,sticky:!0,offsetTop:this.height,active:this.tabs,"onUpdate:active":e=>this.tabs=e,onChange:()=>{sessionStorage.setItem("teacherHomeTabs",this.tabs)}},{default:()=>[t(L,{title:"\u4E2A\u4EBA\u98CE\u91C7",name:"single"},{default:()=>[t("div",{style:{minHeight:this.homeContaiterHeight}},[this.tabs==="single"&&t(ct,{userInfo:this.userInfo},null)])]}),t(L,{title:"\u966A\u7EC3\u8BFE",name:"practice"},{default:()=>[t("div",{style:{minHeight:this.homeContaiterHeight}},[this.tabs==="practice"&&t(Tt,{userInfo:this.userInfo},null)])]}),t(L,{title:"\u76F4\u64AD\u8BFE",name:"live"},{default:()=>[t("div",{style:{minHeight:this.homeContaiterHeight}},[this.tabs==="live"&&t(Gt,null,null)])]}),t(L,{title:"\u89C6\u9891\u8BFE",name:"video"},{default:()=>[t("div",{style:{minHeight:this.homeContaiterHeight}},[this.tabs==="video"&&t(es,null,null)])]}),t(L,{title:"\u4E50\u8C31",name:"music"},{default:()=>[t("div",{style:{minHeight:this.homeContaiterHeight}},[this.tabs==="music"&&t(ts,null,null)])]})]})])}});export{Zs as default,Qs as getAssetsHomeFile};