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

2 lines
5.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as S,k as M,I as j,aa as E,o as A,c as r,l as N,q as i,b as s,D as L,E as V,a7 as F,v as f,t as d,F as G,x as K,r as p,S as Q,an as T,j as l,Q as $}from"./index-CIAVq8iD-1776148658686.js";import{_ as q}from"./search-D2xJuklA-1776148658686.js";import{a as m,s as D}from"./toast-aIWCznBB-1776148658686.js";import{h as C}from"./imageHandler-DstQGL3Z-1776148658686.js";import{s as H}from"./userInfo-gLO2xl8i-1776148658686.js";import{m as R,i as J,f as O}from"./admin-BlNjNFbv-1776148658686.js";import{G as W}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";const X={class:"fullPage"},Y={style:{padding:"16px",position:"relative"}},Z={style:{display:"flex","align-items":"center",gap:"8px","margin-bottom":"8px"}},ee={style:{flex:"1","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"}},te={src:q,alt:"",style:{display:"block",width:"2em","aspect-ratio":"1/1",opacity:"0.6"}},se=["placeholder"],oe=["disabled"],ie={key:0,style:{margin:"16px 0",display:"flex","flex-direction":"column",gap:"12px"}},ae=["onClick"],ne={key:0,style:{position:"absolute","z-index":"3",top:"-2px",right:"-2px"}},re={key:0,style:{"background-image":"linear-gradient(112deg, #759cff 5.66%, #3d73ff 42.49%)",padding:"4px 8px","border-radius":"0 12px",color:"white","font-weight":"600"}},le={key:1,style:{"background-image":"linear-gradient(112deg, #75ff98 5.66%, #3dff54 42.49%)",padding:"4px 8px","border-radius":"0 12px",color:"white","font-weight":"600"}},de={style:{"font-weight":"600"}},ce={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ue={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","align-items":"center",gap:"4px"}},pe={style:{width:"3em",display:"flex","align-items":"center","justify-content":"center"}},ve=["src"],fe={style:{flex:"1","min-width":"0","align-self":"stretch"}},ge={style:{"margin-bottom":"4px","font-weight":"700",overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}},_e={style:{"font-size":"0.9em",color:"rgba(0, 0, 0, 0.4)","font-weight":"500"}},he={style:{width:"auto","min-width":"0","align-self":"stretch",display:"flex","justify-content":"center","align-items":"center"}},ye=["onClick"],me={key:1,class:"no-data"},xe={__name:"inviteBDLeader",setup(be){const{t:o,locale:x}=M();x.value&&j(x.value);const n=p(""),b=p([]),v=p([]),u=p(!0),c=p({}),_=p(!1),w=Q(()=>n.value?v.value:b.value),k=()=>{n.value="",v.value=[],c.value={},u.value=!0,g()},B=()=>{n.value.trim()||(v.value=[],c.value={},u.value=!0,g())},I=E(async()=>{if(!_.value){_.value=!0,console.log("搜索用户id",n.value),v.value=[],c.value={},u.value=!0;try{if(n.value.trim()){const e=await H(n.value);if(e.status&&e.body){let a={userProfile:e.body};v.value.push(a)}}}catch(e){m(e.response?.errorMsg)}finally{_.value=!1}}},500,!0),U=e=>{console.log("选择用户:",e),n.value&&(c.value?.id==e.userProfile.id?(c.value={},u.value=!0):(c.value=e.userProfile,e.status==0||e.status==1?u.value=!0:u.value=!1))},P=async()=>{console.log("点击邀请代理");try{let e={inviteUserId:c.value.id};(await J(e)).status&&D(o("invitation_submitted"))}catch(e){m(e.response?.errorMsg||o("something_went_wrong"))}k()},g=async()=>{const e=await R();console.log("已邀请列表:",e),e.status&&e.body&&(b.value=e.body)},z=async e=>{console.log("取消邀请用户id:",e);try{(await O(e)).status&&(D(o("application_cancelled")),g())}catch(a){let h=a.response?.errorMsg?.replace(/^.*\]\s*/,"")||o("cancellation_failed_try_again");m(h)}};return A(()=>{g()}),(e,a)=>{const h=T("smart-img");return l(),r("div",X,[N(W,{showLanguageList:!0,title:i(o)("invite_become_BD_Leader"),color:"black",style:{"box-shadow":"0 0 10px rgba(0, 0, 0, 0.1)","z-index":"999"}},null,8,["title"]),s("div",Y,[s("div",Z,[s("div",ee,[L(s("img",te,null,512),[[h]]),L(s("input",{"onUpdate:modelValue":a[0]||(a[0]=t=>n.value=t),type:"text",name:"",id:"",placeholder:i(o)("enter_user_id"),onKeyup:a[1]||(a[1]=F((...t)=>i(I)&&i(I)(...t),["enter"])),onInput:B,style:{width:"100%",color:"rgba(0, 0, 0, 0.4)","font-weight":"600",outline:"none",border:"none","background-color":"transparent",padding:"8px"}},null,40,se),[[V,n.value]]),n.value?(l(),r("button",{key:0,onClick:k,style:{background:"none",border:"none",color:"#9ca3af",cursor:"pointer",padding:"0 8px"}}," × ")):f("",!0)]),s("button",{style:{"font-weight":"600"},class:"invite-btn",onClick:P,disabled:u.value},d(i(o)("invite")),9,oe)]),w.value.length>0?(l(),r("div",ie,[(l(!0),r(G,null,K(w.value,t=>(l(),r("div",{key:t.id,style:{position:"relative","background-color":"white",padding:"4px 10px","border-radius":"12px","box-sizing":"border-box",border:"2px solid transparent","box-shadow":"0 0 4px 0 rgba(0, 0, 0, 0.25)",transition:"all 0.2s"},onClick:y=>U(t)},[s("div",{style:{position:"absolute",inset:"-2px","border-radius":"12px","z-index":"2"},class:$({selected:c.value?.id===t.userProfile.id})},null,2),t.status==0||t.status==1?(l(),r("div",ne,[t.status==0?(l(),r("div",re,d(i(o)("pending")),1)):f("",!0),t.status==1?(l(),r("div",le,d(i(o)("success")),1)):f("",!0)])):f("",!0),s("div",de,d(i(o)("information"))+":",1),s("div",ce,[s("div",ue,[s("div",pe,[s("img",{src:t.userProfile.userAvatar||"",style:{width:"100%","aspect-ratio":"1/1","object-fit":"cover","border-radius":"50%"},alt:"",onError:a[2]||(a[2]=(...y)=>i(C)&&i(C)(...y))},null,40,ve)]),s("div",fe,[s("div",ge,d(t.userProfile.userNickname),1),s("div",_e,d(i(o)("user_id_prefix"))+" "+d(t.userProfile.account),1)])]),s("div",he,[t.status==0?(l(),r("div",{key:0,style:{padding:"4px 8px","border-radius":"32px","background-color":"red",color:"white","font-weight":"600","z-index":"5"},onClick:y=>z(t.id)},d(i(o)("cancel")),9,ye)):f("",!0)])])],8,ae))),128))])):(l(),r("div",me,d(i(o)("no_users_found")),1))])])}}},Ue=S(xe,[["__scopeId","data-v-4141fb04"]]);export{Ue as default};