chatapp-h5/h5/js/TeamMember-BMH73Aqb-1776148658686.js
2026-04-14 17:58:21 +08:00

2 lines
12 KiB
JavaScript

import{_ as N,k as P,I as Z,w as K,o as V,ab as X,a as z,c as f,l as j,q as i,b as e,D as q,E as $,a7 as ee,t as l,v as b,ac as te,F as oe,x as le,y as se,r as s,J as ne,K as ie,u as ae,j as g,G as re,m as ce}from"./index-CIAVq8iD-1776148658686.js";import{_ as de}from"./search-D2xJuklA-1776148658686.js";import{_ as ue}from"./records-DqyZBoKN-1776148658686.js";import{a as S}from"./toast-aIWCznBB-1776148658686.js";import{h as T}from"./imageHandler-DstQGL3Z-1776148658686.js";import{f as ge,h as me}from"./teamBill-BWXvrc1S-1776148658686.js";import{c as ve}from"./userInfo-gLO2xl8i-1776148658686.js";import{G as fe}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as pe}from"./GradientBorder-CfwSeIMB-1776148658686.js";const he="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAk9JREFUeAHtnNFxwjAMhv/2+l5GyAalG5gJuoI7QekEsAFlgsIkZQO6Qdig3aC1LjxQMIg4tmKn+u50HA4Huv8kRXISAEVRFEUplRvEpdpbCr6dfaJARs5mzmpnP4ltgcIYQ0aYQ3tHIVTOviArTlEi1ehHHFGR7hCGhb8YL51t0BTUGFAKLy74QDwjQ3zRM0Z8DApMNzprSTlpUGBNMjh10CANxvNbWwiKdIvyeHW29qxbJBCpRIEICyGRShWIsBAQqWSBCIvEIpUuEGGRUKQhCERYJBIptJOWwteRP5357MrZA04bVrt/Feu4DeT6IGpKYw3EQZGUe4pRBK0RB4uAcUgyxci50cH7a3cI52jSqkJ3RhDAoH2KLeAP+2t3CCs0NaZrmhm0JGRP2jj7OFqboNnm8EGRs8V5HnH9XvM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EPLqJjBelaWWxpxLJYyfMgH4w19WMifRhRYiDN/ZhIH0ZIelCT/ViJgTT3Yy4YezCRvMUc9OCCMasPIyQNRGjwItE+TDIGEVoN5MGkRQ9yEZ0HE2kPai6TSXuQhlrIRXQeTKQN5FAfF9FVCdKWxRLwwVhDPybWhxGlBtLYj4n1YYS0B81lsadEHXe+Ou7w9rnvLuGYDfL29HPn74I13aIi3BcEOiy37SP6YkXppwgfZbK522CLPFLni2YwQjoGETVTvWgfRkhnMaKmgVxE51HAEgZqqh9b4hb7gXoMEV1uvBMnTKup28PSxLapU8qOk0h8UEcvcP4JdA841Ej3WB6KeT3efmw3cQ0F0AJjXlRbir1HEnLv0s+9JYXW4qAMBx2eRGuoEQOTGVDHUPQ/ryFchy350xS00LWupEdhQWgYhmEY7fECkiob31Us2LkAAAAASUVORK5CYII=",ye={class:"team-member"},_e={class:"content"},we={style:{display:"flex","align-items":"center",gap:"8px","margin-bottom":"8px"}},xe={style:{flex:"1","min-width":"0","border-radius":"32px",border:"1px solid #fff","box-shadow":"0 0 4px 0 rgba(0, 0, 0, 0.25)",padding:"0 8px",display:"flex","align-items":"center",height:"max-content"}},be=["placeholder"],Ie={key:0,style:{"background-color":"white",padding:"16px","border-radius":"12px","box-shadow":"0 2px 8px rgba(0, 0, 0, 0.1)",display:"grid","grid-template-columns":"repeat(3, 1fr)","margin-bottom":"10px"}},Ee={style:{display:"flex"}},ke={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"5px"}},Re={class:"team-des-title"},Ge={class:"team-des-value"},Me={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"5px"}},Qe={class:"team-des-title"},Ce={class:"team-des-value"},Fe={style:{display:"flex","justify-content":"flex-end"}},He={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"5px"}},Ye={class:"team-des-title"},je={class:"team-des-value"},Se={key:1,class:"loading-container"},Te={style:{padding:"16px",display:"flex","align-items":"center","justify-content":"space-between",gap:"2vw"}},Be={style:{color:"rgba(0, 0, 0, 0.8)","font-weight":"700","font-size":"1.3em"}},Ue={style:{flex:"1","min-width":"0",display:"flex","align-items":"center"}},De={style:{"margin-right":"2vw",display:"flex","align-items":"center",width:"4em","aspect-ratio":"1/1"}},Oe=["src","alt"],Le={style:{width:"calc(100% - 62px)",display:"flex","flex-direction":"column",gap:"4px"}},We={style:{"font-weight":"700",width:"100%",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},Je={style:{color:"rgba(0, 0, 0, 0.4)","font-weight":"500"}},Ne={style:{display:"flex","align-items":"center"}},Pe={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"1vw"}},Ze={style:{color:"rgba(0, 0, 0, 0.8)","font-weight":"700"}},Ke={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"1vw"}},Ve={style:{color:"rgba(0, 0, 0, 0.8)","font-weight":"700"}},Xe=["onClick"],ze={style:{display:"flex","flex-direction":"column","align-items":"center",gap:"2vw"}},qe={style:{"font-size":"1.5em","font-weight":"700",color:"#333","text-align":"center"}},$e={style:{"text-align":"center",color:"rgba(0, 0, 0, 0.4)","font-weight":"600","font-size":"1.2em"}},et={style:{width:"100%",display:"flex","justify-content":"center","align-items":"center",gap:"4vw"}},tt={__name:"TeamMember",setup(ot){const{t:n,locale:G}=P(),B=ne();ae(),G.value&&Z(G.value);const I=s(!1),a=s([]),U=s(0),M=s(null),E=s(!1),p=s(null),D=s(null),c=s(""),d=s([]),Q=s(!1),h=s(!1),A=s(!1),m=s(!1),y=s(null),_=s(null),C=s(null),k=s({}),F=async()=>{if(console.log("searchQuery.value:",c.value),!c.value.trim()){d.value=a.value;return}if(Q.value=!0,h.value=!1,d.value=[],c.value.trim()){const t=await ve(c.value);t.status&&t.body&&(d.value=t.body)}Q.value=!1,h.value=!0},O=()=>{h.value=!1,c.value="",d.value=a.value},w=async(t=!1)=>{try{t?A.value=!0:(I.value=!0,y.value=null,m.value=!1);let o;const v={};y.value&&(v.lastId=y.value);const r=ie();if(o=await ge(r,v),o.status&&o.body){const u=o.body||[];t?(a.value=[...a.value,...u],d.value=a.value):(a.value=u,d.value=a.value),u.length>0&&(y.value=u[u.length-1].id),u.length<20&&(m.value=!0),console.log("Fetched members:",{isLoadMore:t,newCount:u.length,totalCount:a.value.length,lastId:y.value,noMoreData:m.value})}else t||(a.value=[]),m.value=!0}catch(o){console.error("Failed to fetch team members:",o),t||(a.value=[]),S(n("failed_to_load_data"))}finally{I.value=!1,A.value=!1}},H=t=>t?t.ownSpecialId&&t.ownSpecialId.account?t.ownSpecialId.account:t.account||"":"",L=t=>{E.value=!0,p.value=t},R=()=>{E.value=!1,p.value=null},W=async()=>{if(p.value)try{M.value=p.value.id,await me([p.value.id]);const t=a.value.findIndex(o=>o.id===p.value.id);t>-1&&a.value.splice(t,1),R()}catch(t){console.error("Failed to delete member:",t),S(n("failed_to_delete_member"))}finally{M.value=null}},x=()=>{if(console.log("handleScroll triggered"),A.value||m.value){console.log("Skip loading:",{loadingMore:A.value,noMoreData:m.value});return}const t=window.pageYOffset||document.documentElement.scrollTop,o=window.innerHeight,v=document.documentElement.scrollHeight;console.log("Scroll info:",{scrollTop:t,windowHeight:o,documentHeight:v,distanceToBottom:v-(t+o)}),t+o>=v-100&&(console.log("Triggering load more"),w(!0))},J=()=>{C.value&&(_.value=new IntersectionObserver(t=>{const o=t[0];console.log("Intersection observer triggered:",o.isIntersecting),o.isIntersecting&&!A.value&&!m.value&&(console.log("Loading more via intersection observer"),w(!0))},{rootMargin:"100px"}),_.value.observe(C.value),console.log("Intersection observer set up"))};return K(()=>c.value,t=>{h.value&&(h.value=!1),t.trim()||(d.value=a.value)},{immediate:!0}),V(async()=>{console.log("Component mounted"),U.value=parseInt(B.query.members),await w(),await X(),console.log("Adding scroll listener"),window.addEventListener("scroll",x,{passive:!0}),document.addEventListener("scroll",x,{passive:!0}),setTimeout(()=>{J();const t=window.innerHeight,o=document.documentElement.scrollHeight;console.log("Page height check:",{windowHeight:t,documentHeight:o,hasScroll:o>t}),o<=t+50&&!m.value&&a.value.length>0&&(console.log("Auto loading more due to insufficient content height"),w(!0))},500)}),z(()=>{window.removeEventListener("scroll",x),document.removeEventListener("scroll",x),_.value&&_.value.disconnect()}),(t,o)=>{const v=te;return g(),f("div",ye,[j(fe,{showLanguageList:!0,title:i(n)("team_member"),color:"black"},null,8,["title"]),e("div",_e,[e("div",we,[e("div",xe,[o[3]||(o[3]=e("img",{src:de,alt:"",width:"24px",style:{opacity:"0.6"}},null,-1)),q(e("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>c.value=r),type:"text",placeholder:i(n)("enter_host_id"),style:{width:"100%",outline:"none",border:"none","background-color":"transparent",color:"black",padding:"10px 8px"},onKeyup:ee(F,["enter"])},null,40,be),[[$,c.value]])]),!h.value&&c.value?(g(),f("div",{key:0,style:{"font-size":"1.2em","font-weight":"600"},onClick:F},l(i(n)("search")),1)):(g(),f("div",{key:1,style:{"font-size":"1.2em","font-weight":"600"},onClick:O},l(i(n)("cancel")),1))]),t.isFromBdCenter?(g(),f("div",Ie,[e("div",Ee,[e("div",ke,[e("div",Re,l(i(n)("agency_number")),1),e("div",Ge,l(k.value.agentQuantity),1)])]),e("div",Me,[e("div",Qe,l(i(n)("team_target")),1),e("div",Ce,"$"+l(k.value.thisMonthTotalTarget),1)]),e("div",Fe,[e("div",He,[e("div",Ye,l(i(n)("my")),1),e("div",je,l(k.value.foreverPercentage)+"%",1)])])])):b("",!0),I.value?(g(),f("div",Se,[j(v),e("p",null,l(i(n)("loading"))+"...",1)])):b("",!0),d.value.length>0?(g(),f("div",{key:2,class:"member-list",ref_key:"memberListRef",ref:D},[(g(!0),f(oe,null,le(d.value,(r,u)=>(g(),re(pe,null,{default:ce(()=>[e("div",Te,[e("div",Be,l(u+1),1),e("div",Ue,[e("div",De,[e("img",{src:r.userProfile.userAvatar||"",alt:r.userProfile.userNickname,onError:o[1]||(o[1]=(...Y)=>i(T)&&i(T)(...Y)),style:{width:"100%",height:"100%","border-radius":"50%","object-fit":"cover"}},null,40,Oe)]),e("div",Le,[e("div",We,l(r.userProfile.userNickname),1),e("div",Je,[e("span",Ne,[e("span",null,l(t.$t("user_id_prefix"))+" "+l(H(r.userProfile)),1)])])])]),e("div",Pe,[o[4]||(o[4]=e("img",{src:he,alt:"",style:{display:"block","object-fit":"cover",width:"2em","aspect-ratio":"1/1"}},null,-1)),e("div",Ze,l(r.targetFormat),1)]),e("div",Ke,[o[5]||(o[5]=e("img",{src:ue,alt:"",style:{display:"block","object-fit":"cover",width:"2em","aspect-ratio":"1/1"}},null,-1)),e("div",Ve,l(r.timeHours),1)]),e("img",{src:Ae,alt:"",style:{display:"block","object-fit":"cover",width:"2em","aspect-ratio":"1/1"},onClick:Y=>L(r)},null,8,Xe)])]),_:2},1024))),256))],512)):b("",!0)]),E.value?(g(),f("div",{key:0,style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0","background-color":"rgba(0, 0, 0, 0.5)",display:"flex","align-items":"center","justify-content":"center","z-index":"1000",padding:"16px"},onClick:R},[e("div",{style:{"background-color":"white","border-radius":"12px",padding:"12px"},onClick:o[2]||(o[2]=se(()=>{},["stop"]))},[e("div",ze,[e("div",qe,l(i(n)("tips")),1),e("div",$e,l(i(n)("confirm_remove_member_start"))+" "+l(H(p.value.userProfile))+" "+l(i(n)("confirm_remove_member_end")),1),e("div",et,[e("div",{style:{display:"flex","justify-content":"center","align-items":"center",background:"#fff","border-radius":"70px",border:"1px solid #ffb805",color:"#ff9500","font-weight":"800",padding:"8px 12px",width:"45%"},onClick:R},l(i(n)("cancel")),1),e("div",{style:{display:"flex","justify-content":"center","align-items":"center","border-radius":"70px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)",color:"#fff","font-weight":"800",padding:"8px 12px",width:"45%"},onClick:W},l(i(n)("confirm")),1)])])])])):b("",!0)])}}},gt=N(tt,[["__scopeId","data-v-4796cda3"]]);export{gt as default};