best-unit 0.0.29 → 0.0.30

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.
@@ -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 ze=new so;function ao(e={}){const{baseURL:t="/api",timeout:n=1e4,getLocale:r,onError:o}=e,i=R.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 ze.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 ze.error(a),o&&o(a,s),Promise.reject(s)}),i}const ie=ao();function lo(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return ie.get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType}}).then(t=>{const n=t.data;return{totalAmount:n.total_amount||0,availableAmount:n.available_amount||0,frozenAmount:n.frozen_amount||0}})}const co=async()=>ie.get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),uo=async(e,t)=>ie.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||""),fo=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 ie.post("/offline/recharge/create",n,{})},po=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 ie.post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ho=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:i=!1})=>{const s=Lt(null),[a,c]=I(!1),[u,f]=I(0),l=async h=>{const p=Array.from(h.target.files).slice(0,n);if(!p.length)return;c(!0);const g=[];for(let _=0;_<p.length;_++){f(0);const y=new FormData;y.append("file",p[_]);try{const w=await uo(y,S=>f(S));w&&g.push(w)}catch{}}c(!1),f(0),t?.([...e,...g]),s.current&&(s.current.value="")},b=h=>{const p=e.filter((g,_)=>_!==h);t?.(p)};return m("div",{children:[m("div",{style:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:i?"not-allowed":"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15,opacity:i?.6:1},onClick:()=>!i&&s.current?.click(),children:[m("div",{style:{fontSize:48,marginBottom:12},children:"📁"}),m("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),m("div",{style:{color:"#999",fontSize:13},children:["支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 ",n," ","个文件"]}),m("input",{ref:s,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:l,disabled:i}),a&&m("div",{style:{marginTop:12,color:"#1677ff"},children:["正在上传... ",u,"%"]})]}),e&&e.length>0&&m("div",{style:{marginTop:12},children:e.map((h,p)=>m("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[m("div",{style:{display:"flex",alignItems:"center",flex:1},children:[m("span",{style:{fontWeight:500,wordBreak:"break-all"},children:h.split("/").pop()}),m("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:"[已上传]"})]}),m("button",{type:"button",onClick:g=>{g.stopPropagation(),b(p)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},disabled:i,children:"移除"})]},h))})]})},_o=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(i,"allDicts");const s=i?.channel||[],a=o?{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 m("form",{onSubmit:async u=>{u.preventDefault();let f=!0;t(l=>({...l,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(l=>({...l,platformError:"请选择支付平台"})),f=!1),e.transactionId.trim()||(t(l=>({...l,transactionIdError:"请输入转账交易ID"})),f=!1),(!e.files||e.files.length===0)&&(t(l=>({...l,filesError:"请上传转账凭证"})),f=!1),f&&(await fo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),ze.success("离线充值创建成功"))},children:[m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),m("select",{style:{...a.select,...e.platformError?a.selectError:{}},value:e.platform,onInput:u=>{const f=u.target.value;t(l=>({...l,platform:f,platformError:f?"":l.platformError}))},children:[m("option",{value:"",disabled:!0,hidden:!0,children:"请选择支付平台"}),s?.map(u=>m("option",{value:u.value,children:u.label}))]}),e.platformError&&m("div",{style:a.error,children:e.platformError})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),m("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:u=>{const f=u.target.value;t(l=>({...l,transactionId:f,transactionIdError:f?"":l.transactionIdError}))},style:{...a.input,...e.transactionIdError?a.inputError:{}}}),e.transactionIdError&&m("div",{style:a.error,children:e.transactionIdError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),m(ho,{value:e.files,onChange:u=>t(f=>({...f,files:u,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&m("div",{style:a.error,children:e.filesError})]}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:a.buttonCancel,children:"取消"}),m("button",{type:"submit",disabled:r,style:a.buttonSubmit,children:"去支付"})]})]})};function mo({visible:e,onClose:t,onSubmit:n,color:r,whiteTheme:o=!0}){const[i,s]=I({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,c]=I("online"),[u,f]=I({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(Dt(()=>{e||(c("online"),s({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),f({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const l=async p=>{p.preventDefault();let g=!0;if(s(_=>({..._,amountError:"",rechargeChannelError:""})),i.amount.trim()||(s(_=>({..._,amountError:"请输入充值金额"})),g=!1),i.rechargeChannel||(s(_=>({..._,rechargeChannelError:"请选择支付平台"})),g=!1),!!g){s(_=>({..._,loading:!0,error:""}));try{await n({amount:i.amount,rechargeChannel:i.rechargeChannel,currency:i.currency}),t()}catch{s(_=>({..._,error:"提交失败,请重试"}))}finally{s(_=>({..._,loading:!1}))}}},b=p=>{p.target===p.currentTarget&&t()},h=o?{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 m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:h.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:b,children:m("form",{onSubmit:l,style:{background:h.modalBg,padding:32,borderRadius:12,minWidth:400,maxWidth:400,color:r||h.modalColor,boxShadow:h.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[m("button",{type:"button",onClick:t,style:h.closeBtn,"aria-label":"关闭",children:"×"}),m("div",{style:h.title,children:"充值 / 转账"}),m("div",{style:{display:"flex",marginBottom:28},children:[m("button",{type:"button",onClick:()=>c("online"),style:h.tabBtn(a==="online",!0),children:"在线充值"}),m("button",{type:"button",onClick:()=>c("offline"),style:h.tabBtn(a==="offline",!1),children:"线下转账"})]}),a==="online"?m(Tn,{formState:i,setFormState:s,onClose:t,loading:i.loading,whiteTheme:o}):m(_o,{formState:u,setFormState:f,onClose:t,loading:u.loading,whiteTheme:o})]})})}function Ke(){return(Ke=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 bo=["context","children"];function go(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,bo);return Pt(t,n)}function yo(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=W(go,Ke({},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[dn(a[s].name)]=a[s].value);for(s=c.length;s--;){var u=t(c[s],null),f=c[s].slot;f?i[f]=W(wt,{name:f},u):o[s]=u}var l=r?W(wt,null,o):o;return W(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Nt:be)(this._vdom,this._root)}function dn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function wo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[dn(e)]=n,this._vdom=Pt(this._vdom,r),be(this._vdom,this._root)}}function xo(){be(this._vdom=null,this._root)}function wt(e,t){var n=this;return W("slot",Ke({},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 pn(e,t,n,r){function o(){var i=Reflect.construct(HTMLElement,[],o);return i._vdomComponent=e,i._root=i,i}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=yo,o.prototype.attributeChangedCallback=wo,o.prototype.disconnectedCallback=xo,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)}co();function Eo(e){const[t,n]=I(!1),[r,o]=I(!0),i=e.theme?.primaryColor;return m("div",{children:[m(An,{color:i,onClick:()=>n(!0),children:"打开表单"}),m("button",{style:{marginLeft:16,padding:"8px 16px",borderRadius:6,border:"1px solid #eee",cursor:"pointer"},onClick:()=>o(a=>!a),children:r?"切换为暗黑主题":"切换为白色主题"}),m(mo,{visible:t,onClose:()=>n(!1),onSubmit:async a=>{const c=await po({amount:a.amount,currency:a.currency,rechargeChannel:a.rechargeChannel});window.open(c,"_blank")},color:i,whiteTheme:r})]})}pn(Eo,"BestRecharge");const So=({popover:e,children:t,popoverWidth:n=300,popoverMinWidth:r=200,offsetY:o=16,offsetX:i=16,popoverPosition:s="top"})=>{const[a,c]=I(!1),[u,f]=I(s),l=Lt(null),b=()=>{if(s==="top"||s==="bottom")if(l.current){const g=l.current.getBoundingClientRect();s==="top"&&g.top<100?f("bottom"):s==="bottom"&&window.innerHeight-g.bottom<100?f("top"):f(s)}else f(s);else f(s);c(!0)};let h={position:"absolute",zIndex:10,background:"#fff",color:"#222",borderRadius:6,fontSize:15,minWidth:r,width:n,padding:"8px 14px",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",pointerEvents:"auto",textAlign:"center",border:"none",animation:"fadeInUp 0.3s"},p={position:"absolute",zIndex:11,width:0,height:0};return u==="top"?(h={...h,left:"50%",top:-48,transform:"translateX(-50%)"},p={...p,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:"8px solid #fff"}):u==="bottom"?(h={...h,left:"50%",top:"100%",marginTop:o,transform:"translateX(-50%)"},p={...p,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:"8px solid #fff"}):u==="leftTop"?(h={...h,right:"100%",top:0,marginRight:i,transform:"none"},p={...p,right:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:"8px solid #fff"}):u==="rightTop"&&(h={...h,left:"100%",top:0,marginLeft:i,transform:"translateY(0)"},p={...p,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:"8px solid #fff"}),m("div",{ref:l,style:{position:"relative",display:"inline-block"},onMouseEnter:b,onMouseLeave:()=>c(!1),children:[t,a&&m("div",{style:h,children:[e,m("div",{style:p})]})]})},vo={available:0,currency:"USD",symbol:"$",details:[{label:"真实金额",value:0,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:0,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:0,color:"#155EEF",dot:"#15b36b"}]};function xt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function Ro(e){const[t,n]=I(vo);return Dt(()=>{(async()=>{try{const o=await lo(),i={available:o.availableAmount,currency:"USD",symbol:"$",details:[{label:"真实金额",value:o.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:o.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:o.availableAmount,color:"#155EEF",dot:"#15b36b"}]};n(i)}catch(o){console.error("获取余额失败:",o)}})()},[]),m(So,{popover:m(V,{children:[m("div",{style:{fontSize:16,fontWeight:600,color:"#222",marginBottom:16,textAlign:"center"},children:"余额详情"}),t.details.map(r=>m("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:15},children:[m("span",{style:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},children:[m("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:r.dot,marginRight:8}}),r.label]}),m("span",{style:{color:r.color,fontWeight:600,fontSize:15},children:[t.symbol,xt(r.value)]})]},r.label))]}),popoverPosition:e.popoverPosition||"bottom",children:m("div",{style:{fontSize:24,fontWeight:800,color:"#111827",display:"inline-block"},children:[t.symbol,xt(t.available),m("span",{style:{fontSize:18,color:"#6b7280",marginLeft:8,fontWeight:600},children:t.currency})]})})}pn(Ro,"BestStatisticalBalance");const Co=["BestRecharge","BestStatisticalBalance"];exports.components=Co;exports.fundProxy=bn;exports.initFundUnit=mn;exports.npmTest=hn;exports.printCurrentTime=_n;
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 ze=new so;function ao(e={}){const{baseURL:t="/api",timeout:n=1e4,getLocale:r,onError:o}=e,i=R.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 ze.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 ze.error(a),o&&o(a,s),Promise.reject(s)}),i}const ie=ao();function lo(){const e=JSON.parse(sessionStorage.getItem("fund_unit_params")||"{}");return ie.get("/balance",{params:{merchant_id:e.merchantId,biz_type:e.bizType}}).then(t=>{const n=t.data;return{totalAmount:n.total_amount||0,availableAmount:n.available_amount||0,frozenAmount:n.frozen_amount||0}})}const co=async()=>ie.get("/all-dicts",{}).then(e=>(sessionStorage.setItem("all_dicts",JSON.stringify(e.data)),e.data||{})),uo=async(e,t)=>ie.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||""),fo=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 ie.post("/offline/recharge/create",n,{})},po=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 ie.post("/online/recharge/create",n,{}).then(r=>r.data.redirect_url)},ho=({value:e=[],onChange:t,maxCount:n=10,accept:r=".jpg,.jpeg,.png,.pdf",multiple:o=!0,disabled:i=!1})=>{const s=Lt(null),[a,c]=I(!1),[u,f]=I(0),l=async h=>{const p=Array.from(h.target.files).slice(0,n);if(!p.length)return;c(!0);const g=[];for(let _=0;_<p.length;_++){f(0);const y=new FormData;y.append("file",p[_]);try{const w=await uo(y,S=>f(S));w&&g.push(w)}catch{}}c(!1),f(0),t?.([...e,...g]),s.current&&(s.current.value="")},b=h=>{const p=e.filter((g,_)=>_!==h);t?.(p)};return m("div",{children:[m("div",{style:{border:"1px dashed #E5E6EB",borderRadius:8,background:"#FCFCFD",padding:24,textAlign:"center",cursor:i?"not-allowed":"pointer",minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#999",fontSize:15,opacity:i?.6:1},onClick:()=>!i&&s.current?.click(),children:[m("div",{style:{fontSize:48,marginBottom:12},children:"📁"}),m("div",{style:{color:"#222",fontSize:15,marginBottom:4},children:"点击或拖拽文件到此处上传"}),m("div",{style:{color:"#999",fontSize:13},children:["支持 JPG、PNG、PDF 格式,单个文件不超过 20MB,最多上传 ",n," ","个文件"]}),m("input",{ref:s,type:"file",multiple:o,accept:r,style:{display:"none"},onChange:l,disabled:i}),a&&m("div",{style:{marginTop:12,color:"#1677ff"},children:["正在上传... ",u,"%"]})]}),e&&e.length>0&&m("div",{style:{marginTop:12},children:e.map((h,p)=>m("div",{style:{display:"flex",alignItems:"center",background:"#F7F8FA",borderRadius:8,padding:"12px 16px",marginBottom:8,fontSize:15,color:"#222",justifyContent:"space-between"},children:[m("div",{style:{display:"flex",alignItems:"center",flex:1},children:[m("span",{style:{fontWeight:500,wordBreak:"break-all"},children:h.split("/").pop()}),m("span",{style:{color:"#8C8F93",fontSize:13,marginLeft:8},children:"[已上传]"})]}),m("button",{type:"button",onClick:g=>{g.stopPropagation(),b(p)},style:{background:"#FF4D4F",color:"#fff",border:"none",borderRadius:6,padding:"4px 14px",fontSize:15,marginLeft:16,cursor:"pointer"},disabled:i,children:"移除"})]},h))})]})},_o=({formState:e,setFormState:t,onClose:n,loading:r,whiteTheme:o=!1})=>{const i=JSON.parse(sessionStorage.getItem("all_dicts")||"{}");console.log(i,"allDicts");const s=i?.channel||[],a=o?{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 m("form",{onSubmit:async u=>{u.preventDefault();let f=!0;t(l=>({...l,platformError:"",transactionIdError:"",filesError:""})),e.platform||(t(l=>({...l,platformError:"请选择支付平台"})),f=!1),e.transactionId.trim()||(t(l=>({...l,transactionIdError:"请输入转账交易ID"})),f=!1),(!e.files||e.files.length===0)&&(t(l=>({...l,filesError:"请上传转账凭证"})),f=!1),f&&(await fo({transferChannel:e.platform,transferNo:e.transactionId,voucherUrls:e.files}),n(),ze.success("离线充值创建成功"))},children:[m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 第三方支付平台"]}),m("select",{style:{...a.select,...e.platformError?a.selectError:{}},value:e.platform,onInput:u=>{const f=u.target.value;t(l=>({...l,platform:f,platformError:f?"":l.platformError}))},children:[m("option",{value:"",disabled:!0,hidden:!0,children:"请选择支付平台"}),s?.map(u=>m("option",{value:u.value,children:u.label}))]}),e.platformError&&m("div",{style:a.error,children:e.platformError})]}),m("div",{style:{marginBottom:18},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 交易ID"]}),m("input",{type:"text",placeholder:"请输入转账交易ID",value:e.transactionId,onInput:u=>{const f=u.target.value;t(l=>({...l,transactionId:f,transactionIdError:f?"":l.transactionIdError}))},style:{...a.input,...e.transactionIdError?a.inputError:{}}}),e.transactionIdError&&m("div",{style:a.error,children:e.transactionIdError})]}),m("div",{style:{marginBottom:24},children:[m("div",{style:a.label,children:[m("span",{style:{color:"#F53F3F"},children:"*"})," 上传文件"]}),m(ho,{value:e.files,onChange:u=>t(f=>({...f,files:u,filesError:""})),maxCount:10,accept:".jpg,.jpeg,.png,.pdf",multiple:!0}),e.filesError&&m("div",{style:a.error,children:e.filesError})]}),m("div",{style:{display:"flex",justifyContent:"flex-end",gap:12},children:[m("button",{type:"button",onClick:n,style:a.buttonCancel,children:"取消"}),m("button",{type:"submit",disabled:r,style:a.buttonSubmit,children:"去支付"})]})]})};function mo({visible:e,onClose:t,onSubmit:n,color:r,whiteTheme:o=!0}){const[i,s]=I({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),[a,c]=I("online"),[u,f]=I({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1});if(Dt(()=>{e||(c("online"),s({amount:"",rechargeChannel:"",currency:"USD",loading:!1,error:"",amountError:"",rechargeChannelError:"",currencyError:""}),f({platform:"",transactionId:"",files:[],platformError:"",transactionIdError:"",filesError:"",loading:!1}))},[e]),!e)return null;const l=async p=>{p.preventDefault();let g=!0;if(s(_=>({..._,amountError:"",rechargeChannelError:""})),i.amount.trim()||(s(_=>({..._,amountError:"请输入充值金额"})),g=!1),i.rechargeChannel||(s(_=>({..._,rechargeChannelError:"请选择支付平台"})),g=!1),!!g){s(_=>({..._,loading:!0,error:""}));try{await n({amount:i.amount,rechargeChannel:i.rechargeChannel,currency:i.currency}),t()}catch{s(_=>({..._,error:"提交失败,请重试"}))}finally{s(_=>({..._,loading:!1}))}}},b=p=>{p.target===p.currentTarget&&t()},h=o?{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 m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:h.mask,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:b,children:m("form",{onSubmit:l,style:{background:h.modalBg,padding:32,borderRadius:12,minWidth:400,maxWidth:400,color:r||h.modalColor,boxShadow:h.modalBoxShadow,position:"relative"},onClick:p=>p.stopPropagation(),children:[m("button",{type:"button",onClick:t,style:h.closeBtn,"aria-label":"关闭",children:"×"}),m("div",{style:h.title,children:"充值 / 转账"}),m("div",{style:{display:"flex",marginBottom:28},children:[m("button",{type:"button",onClick:()=>c("online"),style:h.tabBtn(a==="online",!0),children:"在线充值"}),m("button",{type:"button",onClick:()=>c("offline"),style:h.tabBtn(a==="offline",!1),children:"线下转账"})]}),a==="online"?m(Tn,{formState:i,setFormState:s,onClose:t,loading:i.loading,whiteTheme:o}):m(_o,{formState:u,setFormState:f,onClose:t,loading:u.loading,whiteTheme:o})]})})}function Ke(){return(Ke=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 bo=["context","children"];function go(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,bo);return Pt(t,n)}function yo(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=W(go,Ke({},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[dn(a[s].name)]=a[s].value);for(s=c.length;s--;){var u=t(c[s],null),f=c[s].slot;f?i[f]=W(wt,{name:f},u):o[s]=u}var l=r?W(wt,null,o):o;return W(r||n.nodeName.toLowerCase(),i,l)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Nt:be)(this._vdom,this._root)}function dn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function wo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[dn(e)]=n,this._vdom=Pt(this._vdom,r),be(this._vdom,this._root)}}function xo(){be(this._vdom=null,this._root)}function wt(e,t){var n=this;return W("slot",Ke({},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 pn(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=yo,o.prototype.attributeChangedCallback=wo,o.prototype.disconnectedCallback=xo,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)}co();function Eo(e){const[t,n]=I(!1),[r,o]=I(!0),i=e.theme?.primaryColor;return m("div",{children:[m(An,{color:i,onClick:()=>n(!0),children:"打开表单"}),m("button",{style:{marginLeft:16,padding:"8px 16px",borderRadius:6,border:"1px solid #eee",cursor:"pointer"},onClick:()=>o(a=>!a),children:r?"切换为暗黑主题":"切换为白色主题"}),m(mo,{visible:t,onClose:()=>n(!1),onSubmit:async a=>{const c=await po({amount:a.amount,currency:a.currency,rechargeChannel:a.rechargeChannel});window.open(c,"_blank")},color:i,whiteTheme:r})]})}pn(Eo,"best-recharge",["theme"],{shadow:!1});const So=({popover:e,children:t,popoverWidth:n=300,popoverMinWidth:r=200,offsetY:o=16,offsetX:i=16,popoverPosition:s="top"})=>{const[a,c]=I(!1),[u,f]=I(s),l=Lt(null),b=()=>{if(s==="top"||s==="bottom")if(l.current){const g=l.current.getBoundingClientRect();s==="top"&&g.top<100?f("bottom"):s==="bottom"&&window.innerHeight-g.bottom<100?f("top"):f(s)}else f(s);else f(s);c(!0)};let h={position:"absolute",zIndex:10,background:"#fff",color:"#222",borderRadius:6,fontSize:15,minWidth:r,width:n,padding:"8px 14px",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",pointerEvents:"auto",textAlign:"center",border:"none",animation:"fadeInUp 0.3s"},p={position:"absolute",zIndex:11,width:0,height:0};return u==="top"?(h={...h,left:"50%",top:-48,transform:"translateX(-50%)"},p={...p,left:"50%",bottom:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderTop:"8px solid #fff"}):u==="bottom"?(h={...h,left:"50%",top:"100%",marginTop:o,transform:"translateX(-50%)"},p={...p,left:"50%",top:-8,transform:"translateX(-50%)",borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:"8px solid #fff"}):u==="leftTop"?(h={...h,right:"100%",top:0,marginRight:i,transform:"none"},p={...p,right:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderLeft:"8px solid #fff"}):u==="rightTop"&&(h={...h,left:"100%",top:0,marginLeft:i,transform:"translateY(0)"},p={...p,left:-8,top:12,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:"8px solid #fff"}),m("div",{ref:l,style:{position:"relative",display:"inline-block"},onMouseEnter:b,onMouseLeave:()=>c(!1),children:[t,a&&m("div",{style:h,children:[e,m("div",{style:p})]})]})},vo={available:0,currency:"USD",symbol:"$",details:[{label:"真实金额",value:0,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:0,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:0,color:"#155EEF",dot:"#15b36b"}]};function xt(e){return e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}function Ro(e){const[t,n]=I(vo);return Dt(()=>{(async()=>{try{const o=await lo(),i={available:o.availableAmount,currency:"USD",symbol:"$",details:[{label:"真实金额",value:o.totalAmount,color:"#15b36b",dot:"#15b36b"},{label:"冻结金额",value:o.frozenAmount,color:"#f59e0b",dot:"#f59e0b"},{label:"总可用",value:o.availableAmount,color:"#155EEF",dot:"#15b36b"}]};n(i)}catch(o){console.error("获取余额失败:",o)}})()},[]),m(So,{popover:m(V,{children:[m("div",{style:{fontSize:16,fontWeight:600,color:"#222",marginBottom:16,textAlign:"center"},children:"余额详情"}),t.details.map(r=>m("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #e5e7eb",fontSize:15},children:[m("span",{style:{display:"flex",alignItems:"center",color:"#6b7280",fontWeight:500},children:[m("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:r.dot,marginRight:8}}),r.label]}),m("span",{style:{color:r.color,fontWeight:600,fontSize:15},children:[t.symbol,xt(r.value)]})]},r.label))]}),popoverPosition:e.popoverPosition||"bottom",children:m("div",{style:{fontSize:24,fontWeight:800,color:"#111827",display:"inline-block"},children:[t.symbol,xt(t.available),m("span",{style:{fontSize:18,color:"#6b7280",marginLeft:8,fontWeight:600},children:t.currency})]})})}pn(Ro,"best-statistical-balance");const Co=["best-recharge","best-statistical-balance"];exports.components=Co;exports.fundProxy=bn;exports.initFundUnit=mn;exports.npmTest=hn;exports.printCurrentTime=_n;
package/dist/best-unit.js CHANGED
@@ -3187,7 +3187,7 @@ function wt(e, t) {
3187
3187
  function pn(e, t, n, r) {
3188
3188
  function o() {
3189
3189
  var i = Reflect.construct(HTMLElement, [], o);
3190
- return i._vdomComponent = e, i._root = i, i;
3190
+ return i._vdomComponent = e, i._root = r && r.shadow ? i.attachShadow({ mode: r.mode || "open" }) : i, i;
3191
3191
  }
3192
3192
  return (o.prototype = Object.create(HTMLElement.prototype)).constructor = o, o.prototype.connectedCallback = _o, o.prototype.attributeChangedCallback = mo, o.prototype.disconnectedCallback = bo, n = n || e.observedAttributes || Object.keys(e.propTypes || {}), o.observedAttributes = n, n.forEach(function(i) {
3193
3193
  Object.defineProperty(o.prototype, i, { get: function() {
@@ -3237,7 +3237,7 @@ function go(e) {
3237
3237
  )
3238
3238
  ] });
3239
3239
  }
3240
- pn(go, "BestRecharge");
3240
+ pn(go, "best-recharge", ["theme"], { shadow: !1 });
3241
3241
  const yo = ({
3242
3242
  popover: e,
3243
3243
  children: t,
@@ -3503,8 +3503,8 @@ function xo(e) {
3503
3503
  }
3504
3504
  );
3505
3505
  }
3506
- pn(xo, "BestStatisticalBalance");
3507
- const qo = ["BestRecharge", "BestStatisticalBalance"];
3506
+ pn(xo, "best-statistical-balance");
3507
+ const qo = ["best-recharge", "best-statistical-balance"];
3508
3508
  export {
3509
3509
  qo as components,
3510
3510
  Ro as fundProxy,
@@ -16,14 +16,7 @@ export declare function initFundUnit(params: {
16
16
  userId: string;
17
17
  };
18
18
 
19
- export declare const fundProxy: {
20
- "/api": {
21
- target: string;
22
- changeOrigin: boolean;
23
- rewrite: (path: string) => string;
24
- secure: boolean;
25
- };
26
- };
19
+ export declare const fundProxy: any;
27
20
 
28
21
  declare global {
29
22
  interface Window {
@@ -38,14 +31,14 @@ declare global {
38
31
 
39
32
  namespace JSX {
40
33
  interface IntrinsicElements {
41
- BestRecharge: {
34
+ "best-recharge": {
42
35
  theme?: any;
43
36
  merchant_id?: string;
44
37
  biz_type?: string;
45
38
  token?: string;
46
39
  [key: string]: any;
47
40
  };
48
- BestStatisticalBalance: any;
41
+ "best-statistical-balance": any;
49
42
  }
50
43
  }
51
44
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "0.0.29",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -50,6 +50,6 @@ export function BestUnit(props: any) {
50
50
  );
51
51
  }
52
52
 
53
- register(BestUnit, "BestRecharge");
53
+ register(BestUnit, "best-recharge", ["theme"], { shadow: false });
54
54
 
55
55
  export default BestUnit;
@@ -151,6 +151,6 @@ function StatisticalBalance(props: { popoverPosition?: PopoverPosition }) {
151
151
  );
152
152
  }
153
153
 
154
- register(StatisticalBalance, "BestStatisticalBalance");
154
+ register(StatisticalBalance, "best-statistical-balance");
155
155
 
156
156
  export default StatisticalBalance;
package/src/main.ts CHANGED
@@ -6,5 +6,5 @@ import "./components/business/recharge-sdk";
6
6
  import "./components/business/statistical-balance";
7
7
 
8
8
  // 可选:导出组件列表或版本信息
9
- export const components = ["BestRecharge", "BestStatisticalBalance"];
9
+ export const components = ["best-recharge", "best-statistical-balance"];
10
10
  export { npmTest, printCurrentTime, initFundUnit, fundProxy };
@@ -16,14 +16,7 @@ export declare function initFundUnit(params: {
16
16
  userId: string;
17
17
  };
18
18
 
19
- export declare const fundProxy: {
20
- "/api": {
21
- target: string;
22
- changeOrigin: boolean;
23
- rewrite: (path: string) => string;
24
- secure: boolean;
25
- };
26
- };
19
+ export declare const fundProxy: any;
27
20
 
28
21
  declare global {
29
22
  interface Window {
@@ -38,14 +31,14 @@ declare global {
38
31
 
39
32
  namespace JSX {
40
33
  interface IntrinsicElements {
41
- BestRecharge: {
34
+ "best-recharge": {
42
35
  theme?: any;
43
36
  merchant_id?: string;
44
37
  biz_type?: string;
45
38
  token?: string;
46
39
  [key: string]: any;
47
40
  };
48
- BestStatisticalBalance: any;
41
+ "best-statistical-balance": any;
49
42
  }
50
43
  }
51
44
  }