companion-detail.7fd71e47.js 6.8 KB

1
  1. import{d as F,ah as v,ag as E,r as B,$ as y,c as e,aj as N,q as a,ak as D,B as b,P as x,a5 as I,e as _,F as w,al as G,m as i,g as p}from"./index.5f7ffb46.js";import{i as j}from"./icon_teacher.df08d662.js";import{i as A}from"./icon-message.8c0a9e8b.js";import{i as S,a as M}from"./icon-call-message.08ca784d.js";import{O as L}from"./index.7790de2a.js";import{O}from"./index.95a99ca5.js";import{C as d}from"./index.052b3caa.js";import{C as l}from"./index.abd668f7.js";import{I as r}from"./index.276a5d68.js";import{T as f}from"./index.ab2541bb.js";import{G as z,a as h}from"./index.adf0b8fc.js";const P="_detailCellGroup_okqf8_1",Q="_subjectContainer_okqf8_6",R="_tagSubject_okqf8_12",U="_sectionCellGroup_okqf8_18",V="_detailCell_okqf8_1",H="_teacherContent_okqf8_29",$="_content_okqf8_37",W="_name_okqf8_41",J="_classNum_okqf8_48",K="_num_okqf8_52",X="_numText_okqf8_59",Y="_messageImg_okqf8_64",Z="_avatarContainer_okqf8_69",ee="_avatarType_okqf8_72",te="_img_okqf8_78",se="_phone_okqf8_91",oe="_status_okqf8_96",ae="_frozen_okqf8_101",ne="_sectionTitle_okqf8_104",le="_functionGrid_okqf8_119",ce="_functionImg_okqf8_126",ue="_functionText_okqf8_130",ie="_companionCell_okqf8_140",re="_className_okqf8_146",de="_musicName_okqf8_152",me="_nums_okqf8_158",_e="_numTip_okqf8_165",pe="_codeContainer_okqf8_170",fe="_codeImg_okqf8_170",he="_codeContent_okqf8_177",ge="_codeTitle_okqf8_180",Ce="_codeName_okqf8_188",ke="_codeQr_okqf8_194",qe="_codeBtnText_okqf8_207",Te="_codeTips_okqf8_217",Fe="_close_okqf8_225",ve="_codeBottom_okqf8_230",Ee="_title_okqf8_237",Be="_shareImg_okqf8_252",ye="_shareText_okqf8_256";var t={detailCellGroup:P,subjectContainer:Q,tagSubject:R,sectionCellGroup:U,detailCell:V,teacherContent:H,content:$,name:W,classNum:J,num:K,numText:X,messageImg:Y,avatarContainer:Z,avatarType:ee,img:te,phone:se,status:oe,frozen:ae,sectionTitle:ne,functionGrid:le,functionImg:ce,functionText:ue,companionCell:ie,className:re,musicName:de,nums:me,numTip:_e,codeContainer:pe,codeImg:fe,codeContent:he,codeTitle:ge,codeName:Ce,codeQr:ke,codeBtnText:qe,codeTips:Te,close:Fe,codeBottom:ve,title:Ee,shareImg:Be,shareText:ye};function Ne(u){return typeof u=="function"||Object.prototype.toString.call(u)==="[object Object]"&&!G(u)}var Qe=F({name:"companion-detail",setup(u,{slots:De,attrs:be,emit:xe}){const c=v(),m=E(),s=B({showMessage:!1,detail:{},classList:[],showDialog:!1}),g=async()=>{try{const o=c.query,{data:n}=await i.post("/api-school/teacher/detail",{data:{teacherId:o.id,schoolId:p.user.data.school.id}});s.detail=n;const T=n.subjectName?n.subjectName.split(","):[];s.detail.subjectNames=T}catch{}},C=async()=>{try{const o=c.query,{data:n}=await i.post("/api-school/classGroup/page",{data:{teacherId:o.id,schoolId:p.user.data.school.id,page:1,rows:100}});s.classList=n.rows||[]}catch{}},k=async()=>{try{const{data:o}=await i.post("/api-school/classGroup/teacherHandoverList/"+c.query.id,{hideLoading:!1});if((o||[]).length>0){m.push({path:"/companion-unbind",query:{id:c.query.id}});return}s.showDialog=!0}catch{}},q=async()=>{try{await i.post("/api-school/classGroup/handoverTeacher",{data:{teacherId:c.query.id}}),m.back()}catch{}};return y(()=>{g(),C()}),()=>e(w,null,[e(N,null,null),e(d,{inset:!0,class:t.detailCellGroup},{default:()=>[e(l,{center:!0,class:t.detailCell},{icon:()=>e("div",{class:t.avatarContainer},[e(r,{class:t.img,src:s.detail.avatar||j,fit:"cover"},null),s.detail.delFlag&&e(f,{class:t.avatarType,round:!0,color:"#F44541",textColor:"#fff"},{default:()=>[a("\u89E3\u7ED1")]})]),title:()=>e("div",{class:t.teacherContent},[e("div",{class:t.content},[e("p",{class:[t.name,"van-ellipsis"]},[s.detail.nickname])]),e("div",{class:t.classNum},[e("p",{class:t.num},[s.detail.completedCourseScheduleNum||0,a("/"),s.detail.totalCourseScheduleNum||0]),e("p",{class:t.numText},[a("\u8BFE\u65F6")])])]),value:()=>e(r,{class:t.messageImg,src:A,onClick:()=>s.showMessage=!0},null)}),s.detail.subjectNames&&s.detail.subjectNames.legnth>0&&e(l,{center:!0},{title:()=>e("div",{class:t.subjectContainer},[e("span",null,[a("\u58F0\u90E8\uFF1A")]),e("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},[s.detail.subjectNames&&s.detail.subjectNames.map(o=>e(f,{type:"primary",class:t.tagSubject,color:"#FFE7DA",textColor:"#F67146"},Ne(o)?o:{default:()=>[o]}))])])})]}),e("div",{class:t.sectionTitle},[e("i",null,null),a("\u57FA\u672C\u4FE1\u606F")]),e(d,{inset:!0,class:[t.detailCellGroup,t.sectionCellGroup]},{default:()=>[e(l,{title:"\u624B\u673A\u53F7\u7801",value:s.detail.phone},null),e(l,{title:"\u6027\u522B",value:s.detail.gender==1?"\u7537":s.detail.gender==0?"\u5973":""},null),e(l,{title:"\u58F0\u90E8",value:s.detail.subjectName},null)]}),e("div",{class:t.sectionTitle},[e("i",null,null),a("\u6240\u5728\u73ED\u7EA7")]),e(d,{inset:!0,class:[t.detailCellGroup,t.sectionCellGroup]},{default:()=>[s.classList.map(o=>e(l,{center:!0,class:t.companionCell},{title:()=>e("div",{class:t.classInfo},[e("p",{class:t.className},[o.name]),e("p",{class:t.musicName},[o.orchestraName])]),value:()=>e("div",{class:t.num},[e("p",{class:t.nums},[o.completeCourseScheduleNum,a("/"),o.courseScheduleNum]),e("p",{class:t.numTip},[a("\u603B\u8BFE\u65F6")])])})),s.classList.length<=0&&e(D,{btnStatus:!1,tips:"\u6682\u65E0\u73ED\u7EA7"},null)]}),s.detail.id&&!s.detail.delFlag&&e(L,{position:"bottom"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingLeft:"13px",paddingRight:"13px"}},[e(b,{type:"primary",round:!0,block:!0,onClick:k},{default:()=>[a("\u89E3\u9664\u7ED1\u5B9A")]})])]}),e(x,{show:s.showMessage,"onUpdate:show":o=>s.showMessage=o,position:"bottom",style:{background:"transparent"}},{default:()=>[e("div",{class:t.codeContainer},[e("div",{class:t.codeBottom},[e(I,{name:"cross",size:22,class:t.close,color:"#666",onClick:()=>s.showMessage=!1},null),e("h3",{class:t.title},[e("i",null,null),a("\u8054\u7CFB\u65B9\u5F0F")]),e(z,{columnNum:2,border:!1},{default:()=>[e(h,{onClick:()=>{_({api:"joinChatGroup",content:{type:"single",id:s.detail.imUserId}}),s.showMessage=!1}},{icon:()=>e(r,{class:t.shareImg,src:S},null),text:()=>e("div",{class:t.shareText},[a("\u53D1\u9001\u6D88\u606F")])}),e(h,{onClick:()=>{_({api:"callPhone",content:{phone:s.detail.phone}}),s.showMessage=!1}},{icon:()=>e(r,{class:t.shareImg,src:M},null),text:()=>e("div",{class:t.shareText},[a("\u62E8\u6253\u7535\u8BDD")])})]})])])]}),e(O,{show:s.showDialog,"onUpdate:show":o=>s.showDialog=o,title:"\u89E3\u9664\u7ED1\u5B9A",message:"\u89E3\u9664\u7ED1\u5B9A\u540E\uFF0C\u8BE5\u4F34\u5B66\u8001\u5E08\u5C06\u9000\u51FA\u6240\u6709\u73ED\u7EA7\u7FA4\uFF0C\u82E5\u9700\u91CD\u65B0\u7ED1\u5B9A\u53EF\u901A\u8FC7\u4F34\u5B66\u8001\u5E08\u9080\u8BF7\u7801\u91CD\u65B0\u586B\u5199\u8D44\u6599\u540E\u7ED1\u5B9A\\n\\n\u786E\u8BA4\u9700\u8981\u89E3\u9664\u7ED1\u5B9A\u5417\uFF1F",messageAlign:"left",showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",onConfirm:q},null)])}});export{Qe as default};