best-unit 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/best-unit.cjs +1 -1
- package/dist/best-unit.js +6 -6
- package/package.json +1 -1
- package/src/components/business/recharge-sdk/components/Button.tsx +1 -1
- package/src/components/business/recharge-sdk/components/OfflineTransferForm.tsx +1 -1
- package/src/components/business/recharge-sdk/components/OnlineRechargeForm.tsx +2 -2
- package/src/components/business/recharge-sdk/components/Recharge.tsx +1 -1
- package/src/components/business/statistical-balance/index.tsx +2 -2
- package/src/demo/App.tsx +8 -8
package/dist/best-unit.cjs
CHANGED
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
padding: 4px;
|
|
43
43
|
color: #999;
|
|
44
44
|
font-size: 12px;
|
|
45
|
-
`,c.onclick=()=>{document.body.removeChild(s)},s.appendChild(c)}document.body.appendChild(s),o!==0&&setTimeout(()=>{document.body.contains(s)&&document.body.removeChild(s)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Me=new io;function so(e={}){const{baseURL:t="/api",timeout:n=1e4,getLocale:r,onError:o}=e,i=C.create({baseURL:t,timeout:n});return i.interceptors.request.use(s=>{const a=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),{token:c}=a;if(s.headers={...s.headers,Authorization:c},r){const u=r();u&&(s.headers={...s.headers,"Accept-Language":u})}return s}),i.interceptors.response.use(s=>{if(s.data&&s.data.code===0)return s.data;const a=s.data?.msg||s.data?.message||"未知错误";return Me.error(a),o&&o(a,s),Promise.reject(s.data||{message:"未知错误"})},s=>{const a=s.response?.data?.msg||s.response?.data?.message||s.message||"网络请求失败";return Me.error(a),o&&o(a,s),Promise.reject(s)}),i}const ae=so();function ao(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return ae.get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data;return{totalAmount:n.total_amount||0,availableAmount:n.available_amount||0,frozenAmount:n.frozen_amount||0}})}const lo=async()=>ae.get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),co=async(e,t)=>ae.post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),uo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return ae.post("/offline/recharge/create",n,{})},fo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log(t,"fundUnitParams");const n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return ae.post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)};var Ze=(e=>(e.ZH="zh",e.EN="en",e))(Ze||{}),j=(e=>(e.WHITE="white",e.DARK="dark",e))(j||{});function po(e){lo();const{merchant_id:t,biz_type:n,fund_balance_id:r,theme:o=j.WHITE,locale:i=Ze.ZH}=e,s="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,token:s,theme:o,locale:i})),{token:s,merchantId:t,bizType:n,fundBalanceId:r,theme:o,locale:i}}const ho={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function _o({onClick:e,color:t,children:n}){const i=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{background:t||"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 16px",cursor:"pointer",fontSize:16,fontWeight:600}:{background:t||"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 16px",cursor:"pointer",fontSize:16,fontWeight:600};return b("button",{style:i,onClick:e,type:"button",children:n})}const mo={余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",总可用:"总可用","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证",离线充值创建成功:"离线充值创建成功","加载中...":"加载中...",错误:"错误",成功:"成功",必填:"必填","充值/转账":"充值/转账",切换为暗黑主题:"切换为暗黑主题",切换为白色主题:"切换为白色主题",点击或拖拽文件到此处上传:"点击或拖拽文件到此处上传","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传",个文件:"个文件","正在上传...":"正在上传...",已上传:"已上传",移除:"移除"};function bo(e){return mo[e]||e}const go={余额详情:"Balance Details",真实金额:"Real Amount",冻结金额:"Frozen Amount",总可用:"Total Available","充值 / 转账":"Recharge / Transfer",在线充值:"Online Recharge",线下转账:"Offline Transfer",充值币种:"Recharge Currency",充值金额:"Recharge Amount",支付平台:"Payment Platform",请选择充值币种:"Please select recharge currency",请输入充值金额:"Please enter recharge amount",请选择支付平台:"Please select payment platform","提交失败,请重试":"Submit failed, please try again","提交中...":"Submitting...",去支付:"Go to Pay",取消:"Cancel",关闭:"Close",第三方支付平台:"Third-party Payment Platform",交易ID:"Transaction ID",请输入转账交易ID:"Please enter transfer transaction ID",上传文件:"Upload Files",请上传转账凭证:"Please upload transfer voucher",离线充值创建成功:"Offline recharge created successfully","加载中...":"Loading...",错误:"Error",成功:"Success",必填:"Required","充值/转账":"Recharge/Transfer",切换为暗黑主题:"Switch to Dark Theme",切换为白色主题:"Switch to Light Theme",点击或拖拽文件到此处上传:"Click or drag files here to upload","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"Supports JPG, PNG, PDF formats, single file not exceeding 20MB, maximum",个文件:"files can be uploaded","正在上传...":"Uploading...",已上传:"Uploaded",移除:"Remove"};function yo(e){return go[e]||e}function wo(){return JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").locale||Ze.ZH}function E(e){return wo()==="zh"?bo(e):yo(e)}const xo=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}"),i=o?.currency||[],s=o?.channel?.filter(h=>h.payment_support)||[],c=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,u=c?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}},f=c?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},l=c?{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return b(Z,{children:[b("div",{style:{marginBottom:18},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("充值币种")]}),b("select",{style:{...u.select},value:e.currency,onInput:h=>{const m=h.target.value;t(p=>({...p,currency:m}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择充值币种")}),i?.map(h=>b("option",{value:h.value,children:h.label}))]})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("充值金额")]}),b("input",{type:"text",placeholder:E("请输入充值金额"),value:e.amount,onInput:h=>{const m=h.target.value;t(p=>({...p,amount:m,amountError:m.trim()?"":p.amountError}))},style:{...u.input,...e.amountError?u.inputError:{}}}),e.amountError&&b("div",{style:u.error,children:e.amountError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("支付平台")]}),b("select",{style:{...u.select,...e.rechargeChannelError?u.selectError:{}},value:e.rechargeChannel,onInput:h=>{const m=h.target.value;t(p=>({...p,rechargeChannel:m,rechargeChannelError:m?"":p.rechargeChannelError}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择支付平台")}),s?.map(h=>b("option",{value:h.value,children:h.label}))]}),e.rechargeChannelError&&b("div",{style:u.error,children:e.rechargeChannelError})]}),e.error&&b("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:f,children:E("取消")}),b("button",{type:"submit",disabled:r,style:l,children:E(r?"提交中...":"去支付")})]})]})},Eo={white:{container:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"}},dark:{container:{border:"1.5px dashed #444C5C",borderRadius:8,background:"#181A20",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#fff",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"}}},So=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:i=!1})=>{const s=He(null),[a,c]=H(!1),[u,f]=H(0),m=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?"white":"dark",p=Eo[m],g=async w=>{const y=Array.from(w.target.files).slice(0,n);if(!y.length)return;c(!0);const S=[];for(let v=0;v<y.length;v++){f(0);const T=new FormData;T.append("file",y[v]);try{const O=await co(T,N=>f(N));O&&S.push(O)}catch{}}c(!1),f(0),t?.([...e,...S]),s.current&&(s.current.value="")},_=w=>{const y=e.filter((S,v)=>v!==w);t?.(y)};return b("div",{children:[b("div",{style:{...p.container,cursor:i?"not-allowed":p.container.cursor,opacity:i?.6:1},onClick:()=>!i&&s.current?.click(),children:[b("div",{style:{fontSize:48,marginBottom:12},children:"📁"}),b("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:E("点击或拖拽文件到此处上传")}),b("div",{style:{color:"#999",fontSize:13},children:[E("支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传")," ",n," ",E("个文件")]}),b("input",{ref:s,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:g,disabled:i}),a&&b("div",{style:{marginTop:12,color:"#1677ff"},children:[E("正在上传...")," ",u,"%"]})]}),e&&e.length>0&&b("div",{style:{marginTop:12},children:e.map((w,y)=>b("div",{style:p.fileItem,children:[b("div",{style:{display:"flex",alignItems:"center",flex:1},children:[b("span",{style:{fontWeight:500,wordBreak:"break-all"},children:w.split("/").pop()}),b("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["[",E("已上传"),"]"]})]}),b("button",{type:"button",onClick:S=>{S.stopPropagation(),_(y)},style:p.removeBtn,disabled:i,children:E("移除")})]},w))})]})},vo=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(o,"allDicts");const i=o?.channel||[],c=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#155EEF",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}};return b("form",{onSubmit:async f=>{f.preventDefault();let l=!0;t(h=>({...h,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(h=>({...h,platformError:E("请选择支付平台")})),l=!1),e.transactionId.trim()||(t(h=>({...h,transactionIdError:E("请输入转账交易ID")})),l=!1),(!e.files||e.files.length===0)&&(t(h=>({...h,filesError:E("请上传转账凭证")})),l=!1),l&&(await uo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),Me.success(E("离线充值创建成功")))},children:[b("div",{style:{marginBottom:18},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("第三方支付平台")]}),b("select",{style:{...c.select,...e.platformError?c.selectError:{}},value:e.platform,onInput:f=>{const l=f.target.value;t(h=>({...h,platform:l,platformError:l?"":h.platformError}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择支付平台")}),i?.map(f=>b("option",{value:f.value,children:f.label}))]}),e.platformError&&b("div",{style:c.error,children:e.platformError})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("交易ID")]}),b("input",{type:"text",placeholder:E("请输入转账交易ID"),value:e.transactionId,onInput:f=>{const l=f.target.value;t(h=>({...h,transactionId:l,transactionIdError:l?"":h.transactionIdError}))},style:{...c.input,...e.transactionIdError?c.inputError:{}}}),e.transactionIdError&&b("div",{style:c.error,children:e.transactionIdError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("上传文件")]}),b(So,{value:e.files,onChange:f=>t(l=>({...l,files:f,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&b("div",{style:c.error,children:e.filesError})]}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:c.buttonCancel,children:E("取消")}),b("button",{type:"submit",disabled:r,style:c.buttonSubmit,children:E("去支付")})]})]})};function Ro({visible:e,onClose:t,onSubmit:n}){const[r,o]=H({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[i,s]=H("online"),[a,c]=H({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(dn(()=>{e||(s("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),c({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const u=async p=>{p.preventDefault();let g=!0;if(o(_=>({..._,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(_=>({..._,amountError:E("请输入充值金额")})),g=!1),r.rechargeChannel||(o(_=>({..._,rechargeChannelError:E("请选择支付平台")})),g=!1),!!g){o(_=>({..._,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(_=>({..._,error:E("提交失败,请重试")}))}finally{o(_=>({..._,loading:!1}))}}},f=p=>{p.target===p.currentTarget&&t()},m=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.08)",mask:"rgba(0,0,0,0.3)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#fff":"#F7F8FA",color:p?"#155EEF":"#222",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #F0F1F3":void 0,borderLeft:g?void 0:"1px solid #F0F1F3",transition:"all 0.2s"})}:{modalBg:"#181A20",modalColor:"#fff",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.5)",mask:"rgba(0,0,0,0.7)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#fff"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#23262F":"#181A20",color:p?"#00E8C6":"#fff",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #23262F":void 0,borderLeft:g?void 0:"1px solid #23262F",transition:"all 0.2s"})};return b("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:m.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:f,children:b("form",{onSubmit:u,style:{background:m.modalBg,padding:32,borderRadius:12,minWidth:400,maxWidth:400,color:m.modalColor,boxShadow:m.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[b("button",{type:"button",onClick:t,style:m.closeBtn,"aria-label":E("关闭"),children:"×"}),b("div",{style:m.title,children:E("充值 / 转账")}),b("div",{style:{display:"flex",marginBottom:28},children:[b("button",{type:"button",onClick:()=>s("online"),style:m.tabBtn(i==="online",!0),children:E("在线充值")}),b("button",{type:"button",onClick:()=>s("offline"),style:m.tabBtn(i==="offline",!1),children:E("线下转账")})]}),i==="online"?b(xo,{formState:r,setFormState:o,onClose:t,loading:r.loading}):b(vo,{formState:a,setFormState:c,onClose:t,loading:a.loading})]})})}function Qe(){return(Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var To=["context","children"];function ko(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var i,s,a={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(i=c[s])>=0||(a[i]=r[i]);return a}(e,To);return un(t,n)}function Co(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=V(ko,Qe({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],i={},s=0,a=n.attributes,c=n.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(i[a[s].name]=a[s].value,i[_n(a[s].name)]=a[s].value);for(s=c.length;s--;){var u=t(c[s],null),f=c[s].slot;f?i[f]=V(vt,{name:f},u):o[s]=u}var l=r?V(vt,null,o):o;return V(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?cn:Te)(this._vdom,this._root)}function _n(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ao(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[_n(e)]=n,this._vdom=un(this._vdom,r),Te(this._vdom,this._root)}}function Oo(){Te(this._vdom=null,this._root)}function vt(e,t){var n=this;return V("slot",Qe({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function mn(e,t,n,r){function o(){var i=Reflect.construct(HTMLElement,[],o);return i._vdomComponent=e,i._root=r&&r.shadow?i.attachShadow({mode:r.mode||"open"}):i,i}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Co,o.prototype.attributeChangedCallback=Ao,o.prototype.disconnectedCallback=Oo,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(i){Object.defineProperty(o.prototype,i,{get:function(){return this._vdom.props[i]},set:function(s){this._vdom?this.attributeChangedCallback(i,null,s):(this._props||(this._props={}),this._props[i]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(i,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Fo(){const[e,t]=H(!1),n=async r=>{const o=await fo({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return b("div",{children:[b(_o,{onClick:()=>t(!0),children:E("充值/转账")}),b(Ro,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}mn(Fo,"best-recharge",["theme"],{shadow:!1});const Po=({popover:e,children:t,popoverWidth:n=300,popoverMinWidth:r=200,offsetY:o=16,offsetX:i=16,popoverPosition:s="top"})=>{const[a,c]=H(!1),[u,f]=H(s),l=He(null),h=He(null),m=()=>{if(h.current&&(clearTimeout(h.current),h.current=null),s==="top"||s==="bottom")if(l.current){const T=l.current.getBoundingClientRect();s==="top"&&T.top<100?f("bottom"):s==="bottom"&&window.innerHeight-T.bottom<100?f("top"):f(s)}else f(s);else f(s);c(!0)},p=()=>{h.current=window.setTimeout(()=>{c(!1)},120)},g={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}},w=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,y=g[w?"white":"dark"];let S={position:"absolute",zIndex:999,borderRadius:6,fontSize:15,minWidth:r,width:n,padding:"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...y.popover},v={position:"absolute",zIndex:11,width:0,height:0};return u==="top"?(S={...S,left:"50%",top:-48,transform:"translateX(-50%)"},v={...v,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${y.arrow.top}`}):u==="bottom"?(S={...S,left:"50%",top:"100%",marginTop:o,transform:"translateX(-50%)"},v={...v,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${y.arrow.bottom}`}):u==="leftTop"?(S={...S,right:"100%",top:0,marginRight:i,transform:"none"},v={...v,right:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${y.arrow.left}`}):u==="rightTop"&&(S={...S,left:"100%",top:0,marginLeft:i,transform:"translateY(0)"},v={...v,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${y.arrow.right}`}),b("div",{ref:l,style:{position:"relative",display:"inline-block"},onMouseEnter:m,onMouseLeave:p,children:[t,a&&b("div",{style:S,onMouseEnter:m,onMouseLeave:p,children:[e,b("div",{style:v})]})]})};function Rt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}const Bo={white:{popoverTitle:{fontSize:16,fontWeight:600,color:"#222",marginBottom:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:e=>({display:"inline-block",width:8,height:8,borderRadius:"50%",background:e,marginRight:8}),detailValue:e=>({color:e,fontWeight:600,fontSize:15}),main:{fontSize:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:18,color:"#6b7280",marginLeft:8,fontWeight:600}},dark:{popoverTitle:{fontSize:16,fontWeight:600,color:"#fff",marginBottom:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #23262F",fontSize:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:e=>({display:"inline-block",width:8,height:8,borderRadius:"50%",background:e,marginRight:8}),detailValue:e=>({color:e,fontWeight:600,fontSize:15}),main:{fontSize:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:18,color:"#B5B8BE",marginLeft:8,fontWeight:600}}};function No(e){const[t,n]=H({available:0,currency:"USD",symbol:"$",details:[{label:E("真实金额"),value:0,color:"#15b36b",dot:"#15b36b"},{label:E("冻结金额"),value:0,color:"#f59e0b",dot:"#f59e0b"},{label:E("总可用"),value:0,color:"#155EEF",dot:"#15b36b"}]});dn(()=>{(async()=>{try{const a=await ao(),c={available:a.availableAmount,currency:"USD",symbol:"$",details:[{label:E("真实金额"),value:a.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:E("冻结金额"),value:a.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},{label:E("总可用"),value:a.availableAmount,color:"#155EEF",dot:"#15b36b"}]};n(c)}catch(a){console.error("获取余额失败:",a)}})()},[]);const o=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,i=Bo[o?"white":"dark"];return b(Po,{popover:b(Z,{children:[b("div",{style:i.popoverTitle,children:E("余额详情")}),t.details.map(s=>b("div",{style:i.detailRow,children:[b("span",{style:i.detailLabel,children:[b("span",{style:i.detailDot(s.dot)}),s.label]}),b("span",{style:i.detailValue(s.color),children:[t.symbol,Rt(s.value)]})]},s.label))]}),popoverPosition:e.popoverPosition||"bottom",children:b("div",{style:i.main,children:[t.symbol,Rt(t.available),b("span",{style:i.currency,children:t.currency})]})})}mn(No,"best-statistical-balance");const Uo=["best-recharge","best-statistical-balance"];exports.components=Uo;exports.initFundUnit=po;exports.npmTest=bn;exports.printCurrentTime=gn;exports.viteProxy=ho;
|
|
45
|
+
`,c.onclick=()=>{document.body.removeChild(s)},s.appendChild(c)}document.body.appendChild(s),o!==0&&setTimeout(()=>{document.body.contains(s)&&document.body.removeChild(s)},o||3e3)}success(t){this.show("success",t)}error(t){this.show("error",t)}warning(t){this.show("warning",t)}info(t){this.show("info",t)}}const Me=new io;function so(e={}){const{baseURL:t="/api",timeout:n=1e4,getLocale:r,onError:o}=e,i=C.create({baseURL:t,timeout:n});return i.interceptors.request.use(s=>{const a=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),{token:c}=a;if(s.headers={...s.headers,Authorization:c},r){const u=r();u&&(s.headers={...s.headers,"Accept-Language":u})}return s}),i.interceptors.response.use(s=>{if(s.data&&s.data.code===0)return s.data;const a=s.data?.msg||s.data?.message||"未知错误";return Me.error(a),o&&o(a,s),Promise.reject(s.data||{message:"未知错误"})},s=>{const a=s.response?.data?.msg||s.response?.data?.message||s.message||"网络请求失败";return Me.error(a),o&&o(a,s),Promise.reject(s)}),i}const ae=so();function ao(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return ae.get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType,fund_balance_id:e.fundBalanceId}}).then(t=>{const n=t.data;return{totalAmount:n.total_amount||0,availableAmount:n.available_amount||0,frozenAmount:n.frozen_amount||0}})}const lo=async()=>ae.get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),co=async(e,t)=>ae.post("/oss/upload",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:n=>{if(n.total){const r=Math.round(n.loaded*100/n.total);t&&t(r)}}}).then(n=>n.data?.url||""),uo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}"),n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),transfer_no:e.transferNo,transfer_channel:e.transferChannel,voucher_urls:e.voucherUrls};return ae.post("/offline/recharge/create",n,{})},fo=async e=>{const t=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");console.log(t,"fundUnitParams");const n={merchant_id:Number(t.merchantId),biz_type:t.bizType,source_operator:String(t.userId),amount:e.amount,currency:e.currency,recharge_channel:e.rechargeChannel,return_url:window.location.href};return ae.post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)};var Ze=(e=>(e.ZH="zh",e.EN="en",e))(Ze||{}),j=(e=>(e.WHITE="white",e.DARK="dark",e))(j||{});function po(e){lo();const{merchant_id:t,biz_type:n,fund_balance_id:r,theme:o=j.WHITE,locale:i=Ze.ZH}=e,s="Bearer "+e.token;return sessionStorage.setItem("fund_unit_params",JSON.stringify({merchantId:t,bizType:n,fundBalanceId:r,token:s,theme:o,locale:i})),{token:s,merchantId:t,bizType:n,fundBalanceId:r,theme:o,locale:i}}const ho={"/api":{target:"https://fund.bestfulfill.tech/api/sdk",changeOrigin:!0,rewrite:e=>e.replace(/^\/api/,""),secure:!1}};function _o({onClick:e,color:t,children:n}){const i=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{background:t||"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:"8px 16px",cursor:"pointer",fontSize:16,fontWeight:600}:{background:t||"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 16px",cursor:"pointer",fontSize:16,fontWeight:600};return b("button",{style:i,onClick:e,type:"button",children:n})}const mo={余额详情:"余额详情",真实金额:"真实金额",冻结金额:"冻结金额",总可用:"总可用","充值 / 转账":"充值 / 转账",在线充值:"在线充值",线下转账:"线下转账",充值币种:"充值币种",充值金额:"充值金额",支付平台:"支付平台",请选择充值币种:"请选择充值币种",请输入充值金额:"请输入充值金额",请选择支付平台:"请选择支付平台","提交失败,请重试":"提交失败,请重试","提交中...":"提交中...",去支付:"去支付",取消:"取消",关闭:"关闭",第三方支付平台:"第三方支付平台",交易ID:"交易ID",请输入转账交易ID:"请输入转账交易ID",上传文件:"上传文件",请上传转账凭证:"请上传转账凭证",离线充值创建成功:"离线充值创建成功","加载中...":"加载中...",错误:"错误",成功:"成功",必填:"必填","充值/转账":"充值/转账",切换为暗黑主题:"切换为暗黑主题",切换为白色主题:"切换为白色主题",点击或拖拽文件到此处上传:"点击或拖拽文件到此处上传","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传",个文件:"个文件","正在上传...":"正在上传...",已上传:"已上传",移除:"移除"};function bo(e){return mo[e]||e}const go={余额详情:"Balance Details",真实金额:"Real Amount",冻结金额:"Frozen Amount",总可用:"Total Available","充值 / 转账":"Recharge / Transfer",在线充值:"Online Recharge",线下转账:"Offline Transfer",充值币种:"Recharge Currency",充值金额:"Recharge Amount",支付平台:"Payment Platform",请选择充值币种:"Please select recharge currency",请输入充值金额:"Please enter recharge amount",请选择支付平台:"Please select payment platform","提交失败,请重试":"Submit failed, please try again","提交中...":"Submitting...",去支付:"Go to Pay",取消:"Cancel",关闭:"Close",第三方支付平台:"Third-party Payment Platform",交易ID:"Transaction ID",请输入转账交易ID:"Please enter transfer transaction ID",上传文件:"Upload Files",请上传转账凭证:"Please upload transfer voucher",离线充值创建成功:"Offline recharge created successfully","加载中...":"Loading...",错误:"Error",成功:"Success",必填:"Required","充值/转账":"Recharge/Transfer",切换为暗黑主题:"Switch to Dark Theme",切换为白色主题:"Switch to Light Theme",点击或拖拽文件到此处上传:"Click or drag files here to upload","支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传":"Supports JPG, PNG, PDF formats, single file not exceeding 20MB, maximum",个文件:"files can be uploaded","正在上传...":"Uploading...",已上传:"Uploaded",移除:"Remove"};function yo(e){return go[e]||e}function wo(){return JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").locale||Ze.ZH}function E(e){return wo()==="zh"?bo(e):yo(e)}const xo=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}"),i=o?.currency||[],s=o?.channel?.filter(h=>h.payment_support)||[],c=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,u=c?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}},f=c?{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"}:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},l=c?{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600}:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600};return b(Z,{children:[b("div",{style:{marginBottom:18},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("充值币种")]}),b("select",{style:{...u.select},value:e.currency,onInput:h=>{const m=h.target.value;t(p=>({...p,currency:m}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择充值币种")}),i?.map(h=>b("option",{value:h.value,children:h.label}))]})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("充值金额")]}),b("input",{type:"text",placeholder:E("请输入充值金额"),value:e.amount,onInput:h=>{const m=h.target.value;t(p=>({...p,amount:m,amountError:m.trim()?"":p.amountError}))},style:{...u.input,...e.amountError?u.inputError:{}}}),e.amountError&&b("div",{style:u.error,children:e.amountError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:u.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("支付平台")]}),b("select",{style:{...u.select,...e.rechargeChannelError?u.selectError:{}},value:e.rechargeChannel,onInput:h=>{const m=h.target.value;t(p=>({...p,rechargeChannel:m,rechargeChannelError:m?"":p.rechargeChannelError}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择支付平台")}),s?.map(h=>b("option",{value:h.value,children:h.label}))]}),e.rechargeChannelError&&b("div",{style:u.error,children:e.rechargeChannelError})]}),e.error&&b("div",{style:{color:"#ff4d4f",marginBottom:12},children:e.error}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:f,children:E("取消")}),b("button",{type:"submit",disabled:r,style:l,children:E(r?"提交中...":"去支付")})]})]})},Eo={white:{container:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},fileItem:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"}},dark:{container:{border:"1.5px dashed #444C5C",borderRadius:8,background:"#181A20",padding:24,textAlign:"center",cursor:"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15},fileItem:{display:"flex",alignItems:"center",background:"#23262F",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#fff",justifyContent:"space-between"},removeBtn:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"}}},So=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:i=!1})=>{const s=He(null),[a,c]=H(!1),[u,f]=H(0),m=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?"white":"dark",p=Eo[m],g=async w=>{const y=Array.from(w.target.files).slice(0,n);if(!y.length)return;c(!0);const S=[];for(let v=0;v<y.length;v++){f(0);const T=new FormData;T.append("file",y[v]);try{const O=await co(T,N=>f(N));O&&S.push(O)}catch{}}c(!1),f(0),t?.([...e,...S]),s.current&&(s.current.value="")},_=w=>{const y=e.filter((S,v)=>v!==w);t?.(y)};return b("div",{children:[b("div",{style:{...p.container,cursor:i?"not-allowed":p.container.cursor,opacity:i?.6:1},onClick:()=>!i&&s.current?.click(),children:[b("div",{style:{fontSize:48,marginBottom:12},children:"📁"}),b("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:E("点击或拖拽文件到此处上传")}),b("div",{style:{color:"#999",fontSize:13},children:[E("支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传")," ",n," ",E("个文件")]}),b("input",{ref:s,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:g,disabled:i}),a&&b("div",{style:{marginTop:12,color:"#1677ff"},children:[E("正在上传...")," ",u,"%"]})]}),e&&e.length>0&&b("div",{style:{marginTop:12},children:e.map((w,y)=>b("div",{style:p.fileItem,children:[b("div",{style:{display:"flex",alignItems:"center",flex:1},children:[b("span",{style:{fontWeight:500,wordBreak:"break-all"},children:w.split("/").pop()}),b("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:["[",E("已上传"),"]"]})]}),b("button",{type:"button",onClick:S=>{S.stopPropagation(),_(y)},style:p.removeBtn,disabled:i,children:E("移除")})]},w))})]})},vo=({formState:e,setFormState:t,onClose:n,loading:r})=>{const o=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(o,"allDicts");const i=o?.channel||[],c=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{label:{marginBottom:8,fontSize:14,color:"#222",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #E5E6EB",background:"#fff",color:"#222",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#fff",color:"#222",border:"1px solid #E5E6EB",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#1890ff",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}}:{label:{marginBottom:8,fontSize:14,color:"#fff",textAlign:"left",display:"block"},input:{width:"100%",padding:"10px 12px",borderRadius:6,boxSizing:"border-box",border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none",marginBottom:0},inputError:{border:"1px solid #ff4d4f"},select:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid #23262F",background:"#23262F",color:"#fff",fontSize:15,outline:"none"},selectError:{border:"1px solid #ff4d4f"},buttonCancel:{background:"#23262F",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer"},buttonSubmit:{background:"#00E8C6",color:"#fff",border:"none",borderRadius:6,padding:"8px 24px",fontSize:15,cursor:"pointer",fontWeight:600},error:{color:"#ff4d4f",fontSize:13,marginTop:4,textAlign:"left"}};return b("form",{onSubmit:async f=>{f.preventDefault();let l=!0;t(h=>({...h,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(h=>({...h,platformError:E("请选择支付平台")})),l=!1),e.transactionId.trim()||(t(h=>({...h,transactionIdError:E("请输入转账交易ID")})),l=!1),(!e.files||e.files.length===0)&&(t(h=>({...h,filesError:E("请上传转账凭证")})),l=!1),l&&(await uo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),Me.success(E("离线充值创建成功")))},children:[b("div",{style:{marginBottom:18},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("第三方支付平台")]}),b("select",{style:{...c.select,...e.platformError?c.selectError:{}},value:e.platform,onInput:f=>{const l=f.target.value;t(h=>({...h,platform:l,platformError:l?"":h.platformError}))},children:[b("option",{value:"",disabled:!0,hidden:!0,children:E("请选择支付平台")}),i?.map(f=>b("option",{value:f.value,children:f.label}))]}),e.platformError&&b("div",{style:c.error,children:e.platformError})]}),b("div",{style:{marginBottom:18},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("交易ID")]}),b("input",{type:"text",placeholder:E("请输入转账交易ID"),value:e.transactionId,onInput:f=>{const l=f.target.value;t(h=>({...h,transactionId:l,transactionIdError:l?"":h.transactionIdError}))},style:{...c.input,...e.transactionIdError?c.inputError:{}}}),e.transactionIdError&&b("div",{style:c.error,children:e.transactionIdError})]}),b("div",{style:{marginBottom:24},children:[b("div",{style:c.label,children:[b("span",{style:{color:"#F53F3F"},children:"*"})," ",E("上传文件")]}),b(So,{value:e.files,onChange:f=>t(l=>({...l,files:f,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&b("div",{style:c.error,children:e.filesError})]}),b("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[b("button",{type:"button",onClick:n,style:c.buttonCancel,children:E("取消")}),b("button",{type:"submit",disabled:r,style:c.buttonSubmit,children:E("去支付")})]})]})};function Ro({visible:e,onClose:t,onSubmit:n}){const[r,o]=H({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[i,s]=H("online"),[a,c]=H({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(dn(()=>{e||(s("online"),o({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),c({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const u=async p=>{p.preventDefault();let g=!0;if(o(_=>({..._,amountError:"",rechargeChannelError:""})),r.amount.trim()||(o(_=>({..._,amountError:E("请输入充值金额")})),g=!1),r.rechargeChannel||(o(_=>({..._,rechargeChannelError:E("请选择支付平台")})),g=!1),!!g){o(_=>({..._,loading:!0,error:""}));try{await n({amount:r.amount,rechargeChannel:r.rechargeChannel,currency:r.currency}),t()}catch{o(_=>({..._,error:E("提交失败,请重试")}))}finally{o(_=>({..._,loading:!1}))}}},f=p=>{p.target===p.currentTarget&&t()},m=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE?{modalBg:"#fff",modalColor:"#222",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.08)",mask:"rgba(0,0,0,0.3)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#222"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#222",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#fff":"#F7F8FA",color:p?"#1890ff":"#222",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.04)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #F0F1F3":void 0,borderLeft:g?void 0:"1px solid #F0F1F3",transition:"all 0.2s"})}:{modalBg:"#181A20",modalColor:"#fff",modalBoxShadow:"0 4px 24px rgba(0,0,0,0.5)",mask:"rgba(0,0,0,0.7)",title:{fontWeight:600,fontSize:20,marginBottom:24,textAlign:"left",color:"#fff"},closeBtn:{position:"absolute",right:16,top:16,background:"none",border:"none",color:"#fff",fontSize:22,cursor:"pointer",lineHeight:1},tabBtn:(p,g)=>({flex:1,background:p?"#23262F":"#181A20",color:p?"#00E8C6":"#fff",border:"none",borderRadius:g?"8px 0 0 8px":"0 8px 8px 0",fontWeight:p?600:400,fontSize:16,height:48,boxShadow:p?"0 2px 8px 0 rgba(20,20,20,0.10)":"none",outline:"none",cursor:"pointer",borderRight:g?"1px solid #23262F":void 0,borderLeft:g?void 0:"1px solid #23262F",transition:"all 0.2s"})};return b("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:m.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:f,children:b("form",{onSubmit:u,style:{background:m.modalBg,padding:32,borderRadius:12,minWidth:400,maxWidth:400,color:m.modalColor,boxShadow:m.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[b("button",{type:"button",onClick:t,style:m.closeBtn,"aria-label":E("关闭"),children:"×"}),b("div",{style:m.title,children:E("充值 / 转账")}),b("div",{style:{display:"flex",marginBottom:28},children:[b("button",{type:"button",onClick:()=>s("online"),style:m.tabBtn(i==="online",!0),children:E("在线充值")}),b("button",{type:"button",onClick:()=>s("offline"),style:m.tabBtn(i==="offline",!1),children:E("线下转账")})]}),i==="online"?b(xo,{formState:r,setFormState:o,onClose:t,loading:r.loading}):b(vo,{formState:a,setFormState:c,onClose:t,loading:a.loading})]})})}function Qe(){return(Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var To=["context","children"];function ko(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var i,s,a={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(i=c[s])>=0||(a[i]=r[i]);return a}(e,To);return un(t,n)}function Co(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=V(ko,Qe({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],i={},s=0,a=n.attributes,c=n.childNodes;for(s=a.length;s--;)a[s].name!=="slot"&&(i[a[s].name]=a[s].value,i[_n(a[s].name)]=a[s].value);for(s=c.length;s--;){var u=t(c[s],null),f=c[s].slot;f?i[f]=V(vt,{name:f},u):o[s]=u}var l=r?V(vt,null,o):o;return V(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?cn:Te)(this._vdom,this._root)}function _n(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ao(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[_n(e)]=n,this._vdom=un(this._vdom,r),Te(this._vdom,this._root)}}function Oo(){Te(this._vdom=null,this._root)}function vt(e,t){var n=this;return V("slot",Qe({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function mn(e,t,n,r){function o(){var i=Reflect.construct(HTMLElement,[],o);return i._vdomComponent=e,i._root=r&&r.shadow?i.attachShadow({mode:r.mode||"open"}):i,i}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Co,o.prototype.attributeChangedCallback=Ao,o.prototype.disconnectedCallback=Oo,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(i){Object.defineProperty(o.prototype,i,{get:function(){return this._vdom.props[i]},set:function(s){this._vdom?this.attributeChangedCallback(i,null,s):(this._props||(this._props={}),this._props[i]=s,this.connectedCallback());var a=typeof s;s!=null&&a!=="string"&&a!=="boolean"&&a!=="number"||this.setAttribute(i,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}function Fo(){const[e,t]=H(!1),n=async r=>{const o=await fo({amount:r.amount,currency:r.currency,rechargeChannel:r.rechargeChannel});window.open(o,"_blank")};return b("div",{children:[b(_o,{onClick:()=>t(!0),children:E("充值/转账")}),b(Ro,{visible:e,onClose:()=>t(!1),onSubmit:n})]})}mn(Fo,"best-recharge",["theme"],{shadow:!1});const Po=({popover:e,children:t,popoverWidth:n=300,popoverMinWidth:r=200,offsetY:o=16,offsetX:i=16,popoverPosition:s="top"})=>{const[a,c]=H(!1),[u,f]=H(s),l=He(null),h=He(null),m=()=>{if(h.current&&(clearTimeout(h.current),h.current=null),s==="top"||s==="bottom")if(l.current){const T=l.current.getBoundingClientRect();s==="top"&&T.top<100?f("bottom"):s==="bottom"&&window.innerHeight-T.bottom<100?f("top"):f(s)}else f(s);else f(s);c(!0)},p=()=>{h.current=window.setTimeout(()=>{c(!1)},120)},g={white:{popover:{background:"#fff",color:"#222",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",border:"none"},arrow:{top:"#fff",bottom:"#fff",left:"#fff",right:"#fff"}},dark:{popover:{background:"#23262F",color:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.32)",border:"1px solid #444C5C"},arrow:{top:"#23262F",bottom:"#23262F",left:"#23262F",right:"#23262F"}}},w=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,y=g[w?"white":"dark"];let S={position:"absolute",zIndex:999,borderRadius:6,fontSize:15,minWidth:r,width:n,padding:"8px 14px",pointerEvents:"auto",textAlign:"center",animation:"fadeInUp 0.3s",...y.popover},v={position:"absolute",zIndex:11,width:0,height:0};return u==="top"?(S={...S,left:"50%",top:-48,transform:"translateX(-50%)"},v={...v,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:`8px solid ${y.arrow.top}`}):u==="bottom"?(S={...S,left:"50%",top:"100%",marginTop:o,transform:"translateX(-50%)"},v={...v,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:`8px solid ${y.arrow.bottom}`}):u==="leftTop"?(S={...S,right:"100%",top:0,marginRight:i,transform:"none"},v={...v,right:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:`8px solid ${y.arrow.left}`}):u==="rightTop"&&(S={...S,left:"100%",top:0,marginLeft:i,transform:"translateY(0)"},v={...v,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:`8px solid ${y.arrow.right}`}),b("div",{ref:l,style:{position:"relative",display:"inline-block"},onMouseEnter:m,onMouseLeave:p,children:[t,a&&b("div",{style:S,onMouseEnter:m,onMouseLeave:p,children:[e,b("div",{style:v})]})]})};function Rt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}const Bo={white:{popoverTitle:{fontSize:16,fontWeight:600,color:"#222",marginBottom:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:15},detailLabel:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},detailDot:e=>({display:"inline-block",width:8,height:8,borderRadius:"50%",background:e,marginRight:8}),detailValue:e=>({color:e,fontWeight:600,fontSize:15}),main:{fontSize:24,fontWeight:800,color:"#111827",display:"inline-block"},currency:{fontSize:18,color:"#6b7280",marginLeft:8,fontWeight:600}},dark:{popoverTitle:{fontSize:16,fontWeight:600,color:"#fff",marginBottom:16,textAlign:"center"},detailRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #23262F",fontSize:15},detailLabel:{display:"flex",alignItems:"center",color:"#B5B8BE",fontWeight:500},detailDot:e=>({display:"inline-block",width:8,height:8,borderRadius:"50%",background:e,marginRight:8}),detailValue:e=>({color:e,fontWeight:600,fontSize:15}),main:{fontSize:24,fontWeight:800,color:"#fff",display:"inline-block"},currency:{fontSize:18,color:"#B5B8BE",marginLeft:8,fontWeight:600}}};function No(e){const[t,n]=H({available:0,currency:"USD",symbol:"$",details:[{label:E("真实金额"),value:0,color:"#15b36b",dot:"#15b36b"},{label:E("冻结金额"),value:0,color:"#f59e0b",dot:"#f59e0b"},{label:E("总可用"),value:0,color:"#1890ff",dot:"#15b36b"}]});dn(()=>{(async()=>{try{const a=await ao(),c={available:a.availableAmount,currency:"USD",symbol:"$",details:[{label:E("真实金额"),value:a.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:E("冻结金额"),value:a.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},{label:E("总可用"),value:a.availableAmount,color:"#1890ff",dot:"#15b36b"}]};n(c)}catch(a){console.error("获取余额失败:",a)}})()},[]);const o=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}").theme===j.WHITE,i=Bo[o?"white":"dark"];return b(Po,{popover:b(Z,{children:[b("div",{style:i.popoverTitle,children:E("余额详情")}),t.details.map(s=>b("div",{style:i.detailRow,children:[b("span",{style:i.detailLabel,children:[b("span",{style:i.detailDot(s.dot)}),s.label]}),b("span",{style:i.detailValue(s.color),children:[t.symbol,Rt(s.value)]})]},s.label))]}),popoverPosition:e.popoverPosition||"bottom",children:b("div",{style:i.main,children:[t.symbol,Rt(t.available),b("span",{style:i.currency,children:t.currency})]})})}mn(No,"best-statistical-balance");const Uo=["best-recharge","best-statistical-balance"];exports.components=Uo;exports.initFundUnit=po;exports.npmTest=bn;exports.printCurrentTime=gn;exports.viteProxy=ho;
|
package/dist/best-unit.js
CHANGED
|
@@ -2313,7 +2313,7 @@ function uo({ onClick: e, color: t, children: n }) {
|
|
|
2313
2313
|
const i = JSON.parse(
|
|
2314
2314
|
sessionStorage.getItem("fund_unit_params") || "{}"
|
|
2315
2315
|
).theme === j.WHITE ? {
|
|
2316
|
-
background: t || "#
|
|
2316
|
+
background: t || "#1890ff",
|
|
2317
2317
|
color: "#fff",
|
|
2318
2318
|
border: "none",
|
|
2319
2319
|
borderRadius: 6,
|
|
@@ -2541,7 +2541,7 @@ const bo = ({ formState: e, setFormState: t, onClose: n, loading: r }) => {
|
|
|
2541
2541
|
fontSize: 15,
|
|
2542
2542
|
cursor: "pointer"
|
|
2543
2543
|
}, l = c ? {
|
|
2544
|
-
background: "#
|
|
2544
|
+
background: "#1890ff",
|
|
2545
2545
|
color: "#fff",
|
|
2546
2546
|
border: "none",
|
|
2547
2547
|
borderRadius: 6,
|
|
@@ -2880,7 +2880,7 @@ const bo = ({ formState: e, setFormState: t, onClose: n, loading: r }) => {
|
|
|
2880
2880
|
cursor: "pointer"
|
|
2881
2881
|
},
|
|
2882
2882
|
buttonSubmit: {
|
|
2883
|
-
background: "#
|
|
2883
|
+
background: "#1890ff",
|
|
2884
2884
|
color: "#fff",
|
|
2885
2885
|
border: "none",
|
|
2886
2886
|
borderRadius: 6,
|
|
@@ -3159,7 +3159,7 @@ function xo({ visible: e, onClose: t, onSubmit: n }) {
|
|
|
3159
3159
|
tabBtn: (p, g) => ({
|
|
3160
3160
|
flex: 1,
|
|
3161
3161
|
background: p ? "#fff" : "#F7F8FA",
|
|
3162
|
-
color: p ? "#
|
|
3162
|
+
color: p ? "#1890ff" : "#222",
|
|
3163
3163
|
border: "none",
|
|
3164
3164
|
borderRadius: g ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
3165
3165
|
fontWeight: p ? 600 : 400,
|
|
@@ -3658,7 +3658,7 @@ function Oo(e) {
|
|
|
3658
3658
|
details: [
|
|
3659
3659
|
{ label: E("真实金额"), value: 0, color: "#15b36b", dot: "#15b36b" },
|
|
3660
3660
|
{ label: E("冻结金额"), value: 0, color: "#f59e0b", dot: "#f59e0b" },
|
|
3661
|
-
{ label: E("总可用"), value: 0, color: "#
|
|
3661
|
+
{ label: E("总可用"), value: 0, color: "#1890ff", dot: "#15b36b" }
|
|
3662
3662
|
]
|
|
3663
3663
|
});
|
|
3664
3664
|
dn(() => {
|
|
@@ -3685,7 +3685,7 @@ function Oo(e) {
|
|
|
3685
3685
|
{
|
|
3686
3686
|
label: E("总可用"),
|
|
3687
3687
|
value: a.availableAmount,
|
|
3688
|
-
color: "#
|
|
3688
|
+
color: "#1890ff",
|
|
3689
3689
|
dot: "#15b36b"
|
|
3690
3690
|
}
|
|
3691
3691
|
]
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ export function ThemedButton({ onClick, color, children }: ButtonProps) {
|
|
|
15
15
|
const whiteTheme = fundUnitParams.theme === Theme.WHITE;
|
|
16
16
|
const style = whiteTheme
|
|
17
17
|
? {
|
|
18
|
-
background: color || "#
|
|
18
|
+
background: color || "#1890ff",
|
|
19
19
|
color: "#fff",
|
|
20
20
|
border: "none",
|
|
21
21
|
borderRadius: 6,
|
|
@@ -83,7 +83,7 @@ export const OnlineRechargeForm: FunctionalComponent<
|
|
|
83
83
|
cursor: "pointer",
|
|
84
84
|
},
|
|
85
85
|
buttonSubmit: {
|
|
86
|
-
background: "#
|
|
86
|
+
background: "#1890ff",
|
|
87
87
|
color: "#fff",
|
|
88
88
|
border: "none",
|
|
89
89
|
borderRadius: 6,
|
|
@@ -207,7 +207,7 @@ export const OnlineRechargeForm: FunctionalComponent<
|
|
|
207
207
|
};
|
|
208
208
|
const buttonSubmitStyle = whiteTheme
|
|
209
209
|
? {
|
|
210
|
-
background: "#
|
|
210
|
+
background: "#1890ff",
|
|
211
211
|
color: "#fff",
|
|
212
212
|
border: "none",
|
|
213
213
|
borderRadius: 6,
|
|
@@ -142,7 +142,7 @@ export function Recharge({ visible, onClose, onSubmit }: ModalFormProps) {
|
|
|
142
142
|
tabBtn: (active: boolean, left: boolean) => ({
|
|
143
143
|
flex: 1,
|
|
144
144
|
background: active ? "#fff" : "#F7F8FA",
|
|
145
|
-
color: active ? "#
|
|
145
|
+
color: active ? "#1890ff" : "#222",
|
|
146
146
|
border: "none",
|
|
147
147
|
borderRadius: left ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
148
148
|
fontWeight: active ? 600 : 400,
|
|
@@ -119,7 +119,7 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
|
|
|
119
119
|
details: [
|
|
120
120
|
{ label: t("真实金额"), value: 0, color: "#15b36b", dot: "#15b36b" },
|
|
121
121
|
{ label: t("冻结金额"), value: 0, color: "#f59e0b", dot: "#f59e0b" },
|
|
122
|
-
{ label: t("总可用"), value: 0, color: "#
|
|
122
|
+
{ label: t("总可用"), value: 0, color: "#1890ff", dot: "#15b36b" },
|
|
123
123
|
],
|
|
124
124
|
});
|
|
125
125
|
|
|
@@ -149,7 +149,7 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
|
|
|
149
149
|
{
|
|
150
150
|
label: t("总可用"),
|
|
151
151
|
value: balance.availableAmount,
|
|
152
|
-
color: "#
|
|
152
|
+
color: "#1890ff",
|
|
153
153
|
dot: "#15b36b",
|
|
154
154
|
},
|
|
155
155
|
],
|
package/src/demo/App.tsx
CHANGED
|
@@ -84,13 +84,13 @@ export default function DemoApp() {
|
|
|
84
84
|
padding: "8px 16px",
|
|
85
85
|
backgroundColor:
|
|
86
86
|
currentLocale === "zh"
|
|
87
|
-
? "#
|
|
87
|
+
? "#1890ff"
|
|
88
88
|
: isDark
|
|
89
89
|
? "#23262F"
|
|
90
90
|
: "#fff",
|
|
91
91
|
color:
|
|
92
92
|
currentLocale === "zh" ? "#fff" : isDark ? "#F5F6FA" : "#333",
|
|
93
|
-
border: "1px solid #
|
|
93
|
+
border: "1px solid #1890ff",
|
|
94
94
|
borderRadius: 6,
|
|
95
95
|
cursor: "pointer",
|
|
96
96
|
fontWeight: currentLocale === "zh" ? "bold" : "normal",
|
|
@@ -104,13 +104,13 @@ export default function DemoApp() {
|
|
|
104
104
|
padding: "8px 16px",
|
|
105
105
|
backgroundColor:
|
|
106
106
|
currentLocale === "en"
|
|
107
|
-
? "#
|
|
107
|
+
? "#1890ff"
|
|
108
108
|
: isDark
|
|
109
109
|
? "#23262F"
|
|
110
110
|
: "#fff",
|
|
111
111
|
color:
|
|
112
112
|
currentLocale === "en" ? "#fff" : isDark ? "#F5F6FA" : "#333",
|
|
113
|
-
border: "1px solid #
|
|
113
|
+
border: "1px solid #1890ff",
|
|
114
114
|
borderRadius: 6,
|
|
115
115
|
cursor: "pointer",
|
|
116
116
|
fontWeight: currentLocale === "en" ? "bold" : "normal",
|
|
@@ -142,7 +142,7 @@ export default function DemoApp() {
|
|
|
142
142
|
padding: "8px 16px",
|
|
143
143
|
backgroundColor:
|
|
144
144
|
currentTheme === Theme.WHITE
|
|
145
|
-
? "#
|
|
145
|
+
? "#1890ff"
|
|
146
146
|
: isDark
|
|
147
147
|
? "#23262F"
|
|
148
148
|
: "#fff",
|
|
@@ -152,7 +152,7 @@ export default function DemoApp() {
|
|
|
152
152
|
: isDark
|
|
153
153
|
? "#F5F6FA"
|
|
154
154
|
: "#333",
|
|
155
|
-
border: "1px solid #
|
|
155
|
+
border: "1px solid #1890ff",
|
|
156
156
|
borderRadius: 6,
|
|
157
157
|
cursor: "pointer",
|
|
158
158
|
fontWeight: currentTheme === Theme.WHITE ? "bold" : "normal",
|
|
@@ -167,7 +167,7 @@ export default function DemoApp() {
|
|
|
167
167
|
padding: "8px 16px",
|
|
168
168
|
backgroundColor:
|
|
169
169
|
currentTheme === Theme.DARK
|
|
170
|
-
? "#
|
|
170
|
+
? "#1890ff"
|
|
171
171
|
: isDark
|
|
172
172
|
? "#23262F"
|
|
173
173
|
: "#fff",
|
|
@@ -177,7 +177,7 @@ export default function DemoApp() {
|
|
|
177
177
|
: isDark
|
|
178
178
|
? "#F5F6FA"
|
|
179
179
|
: "#333",
|
|
180
|
-
border: "1px solid #
|
|
180
|
+
border: "1px solid #1890ff",
|
|
181
181
|
borderRadius: 6,
|
|
182
182
|
cursor: "pointer",
|
|
183
183
|
fontWeight: currentTheme === Theme.DARK ? "bold" : "normal",
|