压缩资源

This commit is contained in:
170-carry 2026-04-27 20:56:53 +08:00
parent f80bb2481a
commit ac2c52dfc2
44 changed files with 56 additions and 64 deletions

View File

@ -68,7 +68,7 @@ const state = {
serverOffsetMs: 0,
countdownEndAtMs: Date.now() + DEFAULT_RESET_PERIOD_MS,
countdownTimer: null,
pendingClaimRuleId: 0,
pendingClaimRuleId: "",
};
const els = {
@ -658,8 +658,9 @@ function renderTasks() {
els.taskList.innerHTML = current
.map((item) => {
const isLoading = Number(item.ruleId) > 0 && state.pendingClaimRuleId === Number(item.ruleId);
const disabled = item.disabled || isLoading || Number(item.ruleId) <= 0;
const ruleId = trimValue(item.ruleId);
const isLoading = Boolean(ruleId) && state.pendingClaimRuleId === ruleId;
const disabled = item.disabled || isLoading || !ruleId;
const buttonLabel = isLoading ? "Loading..." : item.buttonLabel;
let buttonStateClass = " is-pending";
@ -680,7 +681,7 @@ function renderTasks() {
<button
type="button"
class="claim-button${buttonStateClass}${disabled ? " disabled" : ""}"
data-rule-id="${Number(item.ruleId) || 0}"
data-rule-id="${escapeHtml(ruleId)}"
${disabled ? "disabled" : ""}
>
${escapeHtml(buttonLabel)}
@ -873,7 +874,7 @@ function normalizeTaskList(list, taskSet) {
disabled: claimed || !achieved,
claimed,
achieved,
ruleId: Number(item?.ruleId) || 0,
ruleId: trimValue(item?.ruleId),
};
});
}
@ -903,9 +904,10 @@ function normalizeRankList(list) {
}
function markTaskClaimed(ruleId) {
const targetRuleId = trimValue(ruleId);
["quota", "transport"].forEach((taskSet) => {
state.tasks[taskSet] = (state.tasks[taskSet] || []).map((item) => {
if (Number(item.ruleId) !== Number(ruleId)) {
if (trimValue(item.ruleId) !== targetRuleId) {
return item;
}
@ -1103,7 +1105,8 @@ async function refreshPageData() {
}
async function claimTask(ruleId) {
if (!ruleId) {
const normalizedRuleId = trimValue(ruleId);
if (!normalizedRuleId) {
return;
}
@ -1112,7 +1115,7 @@ async function claimTask(ruleId) {
return;
}
state.pendingClaimRuleId = ruleId;
state.pendingClaimRuleId = normalizedRuleId;
renderTasks();
try {
@ -1122,17 +1125,17 @@ async function claimTask(ruleId) {
Authorization: state.authorization,
"Content-Type": "application/json",
},
body: JSON.stringify({ ruleId }),
body: JSON.stringify({ ruleId: normalizedRuleId }),
});
markTaskClaimed(ruleId);
markTaskClaimed(normalizedRuleId);
showToast(body?.alreadyClaimed ? "Already claimed" : "Claim succeeded");
await fetchHomeData().catch(() => {});
await fetchRankData().catch(() => {});
} catch (error) {
showToast(trimValue(error?.message) || "Claim failed");
} finally {
state.pendingClaimRuleId = 0;
state.pendingClaimRuleId = "";
renderStats();
renderTasks();
renderRankList();
@ -1179,7 +1182,7 @@ function bindEvents() {
return;
}
const ruleId = Number(button.getAttribute("data-rule-id") || 0);
const ruleId = trimValue(button.getAttribute("data-rule-id"));
if (!ruleId || button.disabled) {
return;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,3 +1 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 204.5 52.25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Vector 1" d="M10.501 52.25H194.515L194.425 48.5L204.5 42L203.75 9.25L193.432 7L193.264 0L10.501 0.75V5.75L0 9.25V42.25L10.501 47.75V52.25Z" fill="var(--fill-0, #0B3008)"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" style="display:block" viewBox="0 0 204.5 52.25"><path fill="var(--fill-0, #0B3008)" d="M10.501 52.25h184.014l-.09-3.75L204.5 42l-.75-32.75L193.432 7l-.168-7L10.501.75v5L0 9.25v33l10.501 5.5z"/></svg>

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,21 +1 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 760.5 125.5" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Vector 1" filter="url(#filter0_i_0_6)">
<path d="M738.498 16V0H22.0683L18.0013 15.1769L0 20V103.873L21.0015 109.5V125.5H740.998V105H760.5V16H738.498Z" fill="url(#paint0_linear_0_6)"/>
</g>
<defs>
<filter id="filter0_i_0_6" x="0" y="0" width="760.5" height="125.5" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="6.9"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.84 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_0_6"/>
</filter>
<linearGradient id="paint0_linear_0_6" x1="380.499" y1="104.5" x2="380.499" y2="0.500003" gradientUnits="userSpaceOnUse">
<stop stop-color="#206C1A"/>
<stop offset="1" stop-color="#3CA733"/>
</linearGradient>
</defs>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" style="display:block" viewBox="0 0 760.5 125.5"><g filter="url(#a)"><path fill="url(#b)" d="M738.498 16V0H22.068l-4.067 15.177L0 20v83.873l21.002 5.627v16h719.996V105H760.5V16z"/></g><defs><linearGradient id="b" x1="380.499" x2="380.499" y1="104.5" y2=".5" gradientUnits="userSpaceOnUse"><stop stop-color="#206C1A"/><stop offset="1" stop-color="#3CA733"/></linearGradient><filter id="a" width="760.5" height="125.5" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation="6.9"/><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.84 0"/><feBlend in2="shape" result="effect1_innerShadow_0_6"/></filter></defs></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,21 +1 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 1002.21 165.552" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Vector 1" filter="url(#filter0_i_0_7)">
<path d="M973.215 21.1063V0H29.0822L23.7227 20.0205L0 26.3828V137.023L27.6765 144.446V165.552H976.509V138.51H1002.21V21.1063H973.215Z" fill="url(#paint0_linear_0_7)"/>
</g>
<defs>
<filter id="filter0_i_0_7" x="0" y="0" width="1002.21" height="165.552" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="6.9"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.84 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_0_7"/>
</filter>
<linearGradient id="paint0_linear_0_7" x1="501.434" y1="137.85" x2="501.434" y2="0.659574" gradientUnits="userSpaceOnUse">
<stop stop-color="#206C1A"/>
<stop offset="1" stop-color="#3CA733"/>
</linearGradient>
</defs>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" style="display:block" viewBox="0 0 1002.21 165.552"><g filter="url(#a)"><path fill="url(#b)" d="M973.215 21.106V0H29.082l-5.36 20.02L0 26.383v110.64l27.677 7.423v21.106h948.832V138.51h25.701V21.106z"/></g><defs><linearGradient id="b" x1="501.434" x2="501.434" y1="137.85" y2=".66" gradientUnits="userSpaceOnUse"><stop stop-color="#206C1A"/><stop offset="1" stop-color="#3CA733"/></linearGradient><filter id="a" width="1002.21" height="165.552" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation="6.9"/><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.84 0"/><feBlend in2="shape" result="effect1_innerShadow_0_7"/></filter></defs></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 836 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -1,3 +1 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 880 169" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Rectangle 52" d="M0 19C0 8.50659 8.50659 0 19 0H861C871.493 0 880 8.50659 880 19V150C880 160.493 871.493 169 861 169H19C8.50657 169 0 160.493 0 150V19Z" fill="var(--fill-0, #042207)"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" style="display:block" viewBox="0 0 880 169"><path fill="var(--fill-0, #042207)" d="M0 19C0 8.507 8.507 0 19 0h842c10.493 0 19 8.507 19 19v131c0 10.493-8.507 19-19 19H19c-10.493 0-19-8.507-19-19z"/></svg>

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 248 KiB

View File

@ -1,3 +1 @@
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 975 143" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect id="Rectangle 61" width="975" height="143" fill="var(--fill-0, #D9D9D9)"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" overflow="visible" preserveAspectRatio="none" style="display:block" viewBox="0 0 975 143"><path fill="var(--fill-0, #D9D9D9)" d="M0 0h975v143H0z"/></svg>

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,35 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
>
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Yumi H5</title>
<style>
body {
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-webkit-overflow-scrolling: touch;
}
</style>
<script>
window.__H5_ROUTE_PATH__ = "/coin-seller-search";
</script>
<script src="/assets/yumi-route-entry.js"></script>
<script type="module" crossorigin src="/js/index-CIAVq8iD-1776148658686.js"></script>
<link rel="stylesheet" crossorigin href="/css/index-VRlNQ74k-1776148661679.css">
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@ -1 +1 @@
import{_ as k,k as S,I as N,c as p,l as U,q as n,b as e,D as A,E as C,a7 as I,t as c,F as B,x as D,r as f,a8 as E,u as G,j as u,G as j,m as z,y as F}from"./index-CIAVq8iD-1776148658686.js";import{_ as L}from"./search-D2xJuklA-1776148658686.js";import{s as P}from"./coinSellerStore-FCN4A8Yr-1776148658686.js";import{h as _}from"./imageHandler-DstQGL3Z-1776148658686.js";import{G as V}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as K}from"./GradientBorder-CfwSeIMB-1776148658686.js";const M={class:"coin-seller-search"},R={class:"content"},q={style:{display:"flex",gap:"4px"}},H={style:{flex:"1","background-color":"white","border-radius":"32px",border:"1px solid #fff","box-sizing":"border-box",display:"flex","align-items":"center",gap:"4px",padding:"4px 12px"}},Q=["placeholder"],T={style:{margin:"20px 0"}},$={style:{padding:"16px"}},J={style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"4px"}},O={style:{flex:"1","min-width":"0",display:"flex","align-items":"center",gap:"4px"}},W={style:{width:"3.5em","align-self":"stretch",display:"flex","align-items":"center","justify-content":"center"}},X=["src"],Y={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","flex-direction":"column",gap:"4px"}},Z={style:{"font-weight":"700",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},ee={style:{"font-size":"0.9em","font-weight":"500",color:"rgba(0, 0, 0, 0.4)"}},te=["onClick"],se={__name:"SearchUser",setup(ae){const{t:i,locale:v}=S(),g=G();v.value&&N(v.value);const r=f(""),l=f([]),d=f(!1),s=f(null),y=()=>{r.value.trim()||(l.value=[],d.value=!1,s.value=null)},x=()=>{r.value.trim()&&h()},h=async()=>{if(!r.value.trim()){l.value=[];return}try{const a=await E(r.value.trim());if(a&&a.status&&a.body&&a.body.userProfile){const t=a.body.userProfile;l.value=[{id:t.id,name:t.userNickname||"User",userNickname:t.userNickname,account:t.account,userAvatar:t.userAvatar}]}else l.value=[];d.value=!0,s.value=null}catch(a){console.error("Search user failed:",a),l.value=[],d.value=!0}},b=()=>{r.value="",l.value=[],d.value=!1,s.value=null},w=a=>{s.value=a,s.value&&(P({id:s.value.id,name:s.value.name,userNickname:s.value.userNickname,account:s.value.account,userAvatar:s.value.userAvatar}),g.go(-1))};return(a,t)=>(u(),p("div",M,[U(V,{showLanguageList:!0,title:n(i)("search_user"),color:"black"},null,8,["title"]),e("div",R,[e("div",q,[e("div",H,[t[2]||(t[2]=e("img",{src:L,alt:"",style:{width:"1.5em",opacity:"0.6"}},null,-1)),A(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>r.value=o),type:"text",placeholder:n(i)("enter_user_id"),class:"search-input",style:{flex:"1",border:"none",padding:"4px 0",background:"transparent",outline:"none",width:"100%"},onKeyup:I(x,["enter"]),onInput:y},null,40,Q),[[C,r.value]])]),!d.value&&r.value?(u(),p("button",{key:0,style:{border:"none",color:"rgba(0, 0, 0, 0.4)","font-weight":"600","background-color":"transparent"},onClick:h},c(n(i)("search")),1)):(u(),p("button",{key:1,style:{border:"none","font-weight":"600","background-color":"transparent"},onClick:b},c(n(i)("cancel")),1))]),e("div",T,[(u(!0),p(B,null,D(l.value,o=>(u(),j(K,{key:o.id,style:{"margin-bottom":"12px"}},{default:z(()=>[e("div",$,[e("div",J,[e("div",O,[e("div",W,[e("img",{src:o.userAvatar||"",style:{display:"block",width:"100%","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:t[1]||(t[1]=(...m)=>n(_)&&n(_)(...m))},null,40,X)]),e("div",Y,[e("div",Z,c(o.name),1),e("div",ee,c(n(i)("user_id_prefix"))+" "+c(o.account||o.id),1)])]),e("div",{style:{width:"auto",color:"white","border-radius":"12px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)","font-size":"0.9em","font-weight":"500",padding:"4px 10px",cursor:"pointer"},onClick:F(m=>w(o),["stop"])},c(n(i)("add")),9,te)])])]),_:2},1024))),128))])])]))}},de=k(se,[["__scopeId","data-v-29eddba0"]]);export{de as default};
import{_ as k,k as S,I as N,c as p,l as U,q as n,b as e,D as A,E as C,a7 as I,t as c,F as B,x as D,r as f,a8 as E,u as G,j as u,G as j,m as z,y as F}from"./index-CIAVq8iD-1776148658686.js";import{_ as L}from"./search-D2xJuklA-1776148658686.js";import{s as P}from"./coinSellerStore-FCN4A8Yr-1776148658686.js";import{h as _}from"./imageHandler-DstQGL3Z-1776148658686.js";import{G as V}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";import{G as K}from"./GradientBorder-CfwSeIMB-1776148658686.js";const M={class:"coin-seller-search"},R={class:"content"},q={style:{display:"flex",gap:"4px"}},H={style:{flex:"1","background-color":"white","border-radius":"32px",border:"1px solid #fff","box-sizing":"border-box",display:"flex","align-items":"center",gap:"4px",padding:"4px 12px"}},Q=["placeholder"],T={style:{margin:"20px 0"}},$={style:{padding:"16px"}},J={style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"4px"}},O={style:{flex:"1","min-width":"0",display:"flex","align-items":"center",gap:"4px"}},W={style:{width:"3.5em","align-self":"stretch",display:"flex","align-items":"center","justify-content":"center"}},X=["src"],Y={style:{flex:"1","min-width":"0","align-self":"stretch",display:"flex","flex-direction":"column",gap:"4px"}},Z={style:{"font-weight":"700",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},ee={style:{"font-size":"0.9em","font-weight":"500",color:"rgba(0, 0, 0, 0.4)"}},te=["onClick"],se={__name:"SearchUser",setup(ae){const{t:i,locale:v}=S(),g=G();v.value&&N(v.value);const r=f(""),l=f([]),d=f(!1),s=f(null),y=()=>{r.value.trim()||(l.value=[],d.value=!1,s.value=null)},x=()=>{r.value.trim()&&h()},h=async()=>{if(!r.value.trim()){l.value=[];return}try{const a=await E(encodeURIComponent(r.value.trim())),o=a&&a.body,t=o&&(o.userProfile||o.profile||o.user||o);if(a&&a.status&&t&&(t.id||t.userId)){l.value=[{id:t.id||t.userId,name:t.userNickname||t.name||t.nickName||"User",userNickname:t.userNickname||t.name||t.nickName,account:t.account||t.ownSpecialId?.account||r.value.trim(),userAvatar:t.userAvatar||t.avatar}]}else l.value=[];d.value=!0,s.value=null}catch(a){console.error("Search user failed:",a),l.value=[],d.value=!0}},b=()=>{r.value="",l.value=[],d.value=!1,s.value=null},w=a=>{s.value=a,s.value&&(P({id:s.value.id,name:s.value.name,userNickname:s.value.userNickname,account:s.value.account,userAvatar:s.value.userAvatar}),g.go(-1))};return(a,t)=>(u(),p("div",M,[U(V,{showLanguageList:!0,title:n(i)("search_user"),color:"black"},null,8,["title"]),e("div",R,[e("div",q,[e("div",H,[t[2]||(t[2]=e("img",{src:L,alt:"",style:{width:"1.5em",opacity:"0.6"}},null,-1)),A(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>r.value=o),type:"text",placeholder:n(i)("enter_user_id"),class:"search-input",style:{flex:"1",border:"none",padding:"4px 0",background:"transparent",outline:"none",width:"100%"},onKeyup:I(x,["enter"]),onInput:y},null,40,Q),[[C,r.value]])]),!d.value&&r.value?(u(),p("button",{key:0,style:{border:"none",color:"rgba(0, 0, 0, 0.4)","font-weight":"600","background-color":"transparent"},onClick:h},c(n(i)("search")),1)):(u(),p("button",{key:1,style:{border:"none","font-weight":"600","background-color":"transparent"},onClick:b},c(n(i)("cancel")),1))]),e("div",T,[(u(!0),p(B,null,D(l.value,o=>(u(),j(K,{key:o.id,style:{"margin-bottom":"12px"}},{default:z(()=>[e("div",$,[e("div",J,[e("div",O,[e("div",W,[e("img",{src:o.userAvatar||"",style:{display:"block",width:"100%","aspect-ratio":"1/1","border-radius":"50%","object-fit":"cover"},onError:t[1]||(t[1]=(...m)=>n(_)&&n(_)(...m))},null,40,X)]),e("div",Y,[e("div",Z,c(o.name),1),e("div",ee,c(n(i)("user_id_prefix"))+" "+c(o.account||o.id),1)])]),e("div",{style:{width:"auto",color:"white","border-radius":"12px",background:"linear-gradient(269deg, #feb219 7.04%, #ff9326 96.78%)","font-size":"0.9em","font-weight":"500",padding:"4px 10px",cursor:"pointer"},onClick:F(m=>w(o),["stop"])},c(n(i)("add")),9,te)])])]),_:2},1024))),128))])])]))}},de=k(se,[["__scopeId","data-v-29eddba0"]]);export{de as default};