2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
import{d as a,r as e,o as s,aa as t,e as o,l as i,h as n,P as r,t as l,m as d,j as c,p as u,u as p,aj as v,aw as g,i as m,F as h,f as S,O as _,_ as f,aY as y,J as E,B as I,T,a6 as k}from"./index-RXP3BP3O.js";import{_ as x}from"./_plugin-vue_export-helper.BCo6x5W8.js";const L=x(a({__name:"index",props:{title:{default:""},customStyle:{default:""}},setup(a){const v=e(0);return s(()=>{if(t)v.value=0;else{const a=uni.getSystemInfoSync();v.value=a.statusBarHeight}}),(a,e)=>(o(),i("div",{class:c(["tui-navigation",a.customStyle]),style:u({paddingTop:`${p(v)}px`})},[n("div",{class:"tui-navigation-left"},[r(a.$slots,"left",{},void 0,!0)]),a.title?(o(),i("div",{key:0,class:"tui-navigation-title"},[n("h1",{class:"tui-navigation-title-text"},l(a.title),1)])):d("",!0),n("div",{class:"tui-navigation-right"},[r(a.$slots,"right",{},void 0,!0)])],6))}}),[["__scopeId","data-v-7dd7012c"]]),D=x(a({__name:"index",props:{url:{default:"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"},size:{default:"36px"},borderRadius:{default:"5px"},useSkeletonAnimation:{type:Boolean,default:!1},id:{default:""},type:{default:""}},emits:["onLoad","onError"],setup(a,{emit:s}){const{tencentUserSig:t}=v(),{showLoading:n,hideLoading:r}=k(),l=e("https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png"),x=s,L=a,{size:D,url:R,borderRadius:U,useSkeletonAnimation:b}=g(L);let A=0;const C=e(!1),H=e(!1);function Y(a){C.value=!0,x("onLoad",a)}function w(a){A+=1,A>3||(m?H.value=!0:a.currentTarget.src=l.value,x("onError",a))}const B=()=>{console.log(L.type),L.id&&(n(),_.callService({serviceName:f.TUISearch.SERVICE.NAME,method:f.TUISearch.SERVICE.METHOD.SEARCH_USER,params:{userID:L.id}}).then(a=>{console.log(a.data,"==");const e=a.data;e.length>0&&y.checkFriend({type:E.TYPES.SNS_CHECK_TYPE_BOTH,userIDList:[e[0].userID]}).then(a=>{const s=a.data.successUserIDList[0].relation===E.TYPES.SNS_TYPE_BOTH_WAY;r(),I("/pages/adduser/details",{id:e[0].userID,state:L.type,type:s?"1":e[0].userID==t.value.userId?"99":""})}).catch(()=>{r()})}).catch(()=>{r()}))};return(a,e)=>{const s=T;return o(),i("div",{class:"avatar-container",style:u({width:p(D),height:p(D),borderRadius:"80rpx"}),onClick:B},[p(m)?(o(),i(h,{key:0},[p(H)?(o(),S(s,{key:1,class:"avatar-image",src:p(l),onLoad:Y,onError:w},null,8,["src"])):(o(),S(s,{key:0,class:"avatar-image",src:p(R)||p(l),onLoad:Y,onError:w},null,8,["src"]))],64)):(o(),i("img",{key:1,class:"avatar-image",src:p(R)||p(l),onLoad:Y,onError:w},null,40,["src"])),p(b)&&!p(C)?(o(),i("div",{key:2,class:c({placeholder:!0,hidden:p(C),"skeleton-animation":p(b)})},null,2)):d("",!0)],4)}}}),[["__scopeId","data-v-f3eb6068"]]);export{D as A,L as N};
|