logo-full.DuAiVwVf.js 15 KB

1
  1. import{aJ as e,aK as t,_ as s,r as a,al as o,o as n,i as c,j as l,k as i,l as r,I as u,O as d,q as p,C as m,F as g,G as y,H as f,n as h,t as w,aL as v,M as C,x as H,aM as b,a as k,aN as L,aO as x,aP as S,A,K as _,aG as P,a0 as j,a2 as I,aD as $,d as T,af as E,u as O,c as D,$ as N,b as M,e as F,f as V,g as z,s as B,v as K,av as U,aF as W,a6 as G,aQ as R,aR as J,aS as Y}from"./index-DhPBDLGv.js";import{u as q,_ as Q}from"./liveChat.DpTj_oVP.js";import{c as X}from"./index.DEN0qiOJ.js";const Z=function(t){return Array.isArray(t)?Promise.all(t.map((e=>Z.call(this,e)))):new Promise((s=>{e().in(this).select(t).boundingClientRect(s).exec()}))},ee=s({__name:"cwg-dropdown",props:{...{bgColor:{type:String,default:"#fff"},customStyle:{type:Object,default:()=>({})}},menuList:{type:Object,default:()=>["菜单1","菜单2","菜单3"]},menuStyle:{type:Object,default:()=>({})},interspace:{type:[String,Number],default:"10rpx"},showActive:{type:Boolean,default:!1},activeKey:{type:[String,Number],default:""}},emits:["open","close","change","menuClick"],setup(e,{expose:s,emit:b}){const k=e,L=b,x=e=>{if(!k.showActive||!k.activeKey)return!1;return(void 0!==e.key?e.key:void 0!==e.value?e.value:void 0!==e.sysCode?e.sysCode:void 0!==e.type?e.type:"")===k.activeKey},S=a(!1),A=o({width:0,height:0}),_=o({}),P=a(0),j=()=>new Promise((e=>{A.width>0?e(A):v({success:t=>{A.width=t.windowWidth,A.height=t.windowHeight,e(A)},fail:()=>{setTimeout((()=>j().then(e)),100)}})})),I=async e=>{e.stopPropagation(),await j();const t=await Z(".cwg-dropdown");if(!t)return;Object.assign(_,{transform:"scaleY(1)",visibility:"hidden",top:"-9999px",left:"-9999px",transition:"none"}),await C();const s=await Z(".cwg-dropdown-menu-container");if(!s)return Object.keys(_).forEach((e=>delete _[e])),void(_.transform="scaleY(0)");const{width:a}=A,{left:o,right:n,bottom:c}=t;P.value;const l={transition:"transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)",transform:"scaleY(1)",top:"10px"};if(o+s.width<a)l.left="-110px";else{const e=a-n;l.right=`${e>0?e:0}px`}Object.keys(_).forEach((e=>delete _[e])),Object.assign(_,l),S.value=!0,L("open"),L("change",!0)},$=()=>{S.value=!1,Object.keys(_).forEach((e=>delete _[e])),_.transform="scaleY(0)",L("close"),L("change",!1)};return n((()=>{var e;j(),P.value=(e=k.interspace)?(e=String(e)).endsWith("rpx")?t(parseInt(e)):(e.endsWith("px"),parseInt(e)):0})),s({close:$}),(t,s)=>{const a=H;return c(),l(a,null,{default:i((()=>[r(a,{class:"cwg-dropdown",style:u(t.customStyle),onClick:I},{default:i((()=>[d(t.$slots,"default",{},void 0,!0)])),_:3},8,["style"]),r(a,{class:"cwg-dropdown-menu"},{default:i((()=>[r(a,{class:"cwg-dropdown-menu-container",style:u([_]),onClick:s[0]||(s[0]=p((()=>{}),["stop"]))},{default:i((()=>[d(t.$slots,"menu",{},(()=>[r(a,{class:"menu"},{default:i((()=>[d(t.$slots,"btn",{},void 0,!0),(c(!0),m(g,null,y(e.menuList,((e,t)=>(c(),l(a,{class:f(["menu-item",{active:k.showActive&&x(e)}]),key:t,onClick:s=>(L("menuClick",{value:e,index:t}),void $())},{default:i((()=>[r(a,null,{default:i((()=>[h(w(e.label||e),1)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128))])),_:3})]),!0)])),_:3},8,["style"])])),_:3}),r(a,{class:f(["cwg-dropdown-mask",{"cwg-dropdown-mask-show":S.value}]),onClick:p($,["stop"])},null,8,["class"])])),_:3})}}},[["__scopeId","data-v-5dcec0ed"]]),te=X.Host85,se=["/list","/page","/field/params","/dropdown","/single","/detail"];let ae=!1;const oe=(e,t={})=>{const{data:s,statusCode:a}=e;if(200===a){if("arraybuffer"===t.responseType||s instanceof ArrayBuffer)return s;if(401===s.code||600===s.code){if("/pages/login/index"===(()=>{const e=$();return e[e.length-1].route})())return Promise.reject({...s,msg:s.message||"登录失败,请重试"});k.value="";return t.ignore401||!1?Promise.reject({...s,code:401}):(ae||(ae=!0,A({title:"登录已过期,请重新登录",icon:"none"}),setTimeout((()=>{_({url:"/pages/login/index",success:()=>{P.set("mode","customer"),ae=!1},fail:()=>{ae=!1}})}),1500)),Promise.reject({...s,code:401,message:"登录已过期,请重新登录"}))}return 200===s.code?s:(400===s.code||A({title:s.msg||"请求失败",icon:"none"}),Promise.reject(s))}return A({title:`网络错误: ${a}`,icon:"none"}),Promise.reject(e)},ne=e=>(j(),A({title:"网络异常,请稍后重试",icon:"none"}),Promise.reject(e)),ce=e=>{const t=X[e.type||"Host80"]||"",s={...e,url:`${t}${e.url}`,method:e.method||"GET",timeout:6e4},a=(e=>{var t;e.header||(e.header={}),"HostShop"===e.type?L.value&&(e.header["Access-Token"]=`${L.value}`):k.value&&(e.header["Access-Token"]=`${k.value}`);return x.value&&(e.header.Language=`${x.value}`),S.value&&(e.header.CLIENT=`${S.value}`),null==(t=q().userInfo)||t.cId,String(e.method||"GET").toUpperCase(),e.data={...e.data||{}},e.header["Content-Type"]||(e.header["Content-Type"]="application/json"),e})(s);return new Promise(((t,o)=>{se.some((e=>s.url.includes(e))),b({...a,success:s=>{try{const a=oe(s,e);t(a)}catch(a){o(a)}},fail:e=>{const t=ne(e);o(t)}})}))},le=(e,t,s={},a={},o=!0)=>new Promise(((n,c)=>{try{let l=t;t&&"object"==typeof t&&(l=t.path||t.url||t.tempFilePath||t.filePath||t);const i=`${te}${e}`,r={...a||{}};k.value&&(r["Access-Token"]=`${k.value}`),x.value&&(r.Language=`${x.value}`),S.value&&(r.CLIENT=`${S.value}`),I({url:i,filePath:l,name:"file",header:r,formData:s||{},success:e=>{try{e.data=JSON.parse(e.data||"{}")}catch(s){e.data={}}const t={data:e.data,statusCode:e.statusCode};if(o)try{const e=oe(t);n(e)}catch(a){c(a)}else n(t.data)},fail:e=>{c(ne(e))}})}catch(l){c(l)}})),ie=(e,t={},s={},a={})=>{const o="string"==typeof s?{type:s,...a||{}}:s||{};return ce({url:e,method:"GET",data:t,...o})},re=(e,t={},s,a={})=>ce({url:e,method:"POST",data:t,type:s,...a}),ue={PushMessageList:(e={})=>re("/push/message/list",e,"Host80"),CustomLoginInfo:(e={})=>re("/custom/info",e,"Host80"),switchLanguage:(e={})=>re("/custom/switch/lang",e,"Host80"),CustomDropdown:(e={})=>re("/account/dropdown",e,"Host80"),getChartInfo:(e={})=>re("/index/chart/list",e,"Host80"),transferInfo:(e={})=>re("/transfer/info",e,"Host04"),TransferApply:(e={})=>re("/transfer/apply",e,"Host04"),ResetDealPassword:(e={})=>re("/account/settings/reset/deal/password",e,"Host80"),ResetDealPasswordEmail:(e={})=>re("/account/deal/password/reset/apply/send/email",e,"Host80"),ChangeLeverageAdd:(e={})=>re("/account/settings/change/leverage/add",e,"Host80"),ChangeInvestorOassword:(e={})=>re("/account/settings/change/investor/password/add",e,"Host80"),ChangeDealPassword:(e={})=>re("/account/settings/change/deal/password/add",e,"Host80"),AccountList:(e={})=>re("/account/list",e,"Host80"),AccountAllList:(e={})=>re("/account/all/list",e,"Host80"),AccountApplyAdd:(e={})=>re("/account/apply/add",e,"Host80"),AccountApplyAddDome:(e={})=>re("/account/apply/demo/add",e,"Host80"),AccountApplyData:(e={})=>re("/account/apply/data",e,"Host80"),AccountApplyDataDome:(e={})=>re("/account/apply/demo/data",e,"Host80"),excludeShowLogin:(e={})=>re("/account/apply/exclude/show/login/type",e,"Host80"),CustomBankList:(e={})=>re("/custom/bank/list",e,"Host80"),CustomBankDelete:(e={})=>re("/custom/bank/delete",e,"Host80"),CustomBankUpdate:(e={})=>re("/custom/bank/update",e,"Host80"),CustomBankAdd:(e={})=>re("/custom/bank/add",e,"Host80"),customBankCardVerify:(e={})=>re("/custom/bank/card/verify",e,"Host80"),customBankCardSendCode:(e={})=>re("/custom/bank/card/send/code",e,"Host80"),CustomUpdateInfo:(e={})=>re("/custom/update/info",e,"Host80"),CustomUpdateEmail:(e={})=>re("/custom/update/email",e,"Host80"),CustomUpdateEmailSendCode:(e={})=>re("/custom/update/email/send/code",e,"Host80"),CustomFileList:(e={})=>re("/custom/file/list",e,"Host80"),CustomFileUpload:(e={})=>re("/custom/file/upload/{type}/{id}",e,"Host80"),CustomFileMobile:(e={})=>ie("/custom/file/mobile",e,"Host80"),CustomRecordAccount:(e={})=>re("/custom/apply/list",e,"Host80"),customNoticeList:(e={})=>re("/custom/notice/list",e,"Host80"),customNoticeSave:(e={})=>re("/custom/notice/save",e,"Host80"),customApplyIb:(e={})=>re("/agent/apply/add",e,"Host80"),customApplyIbStatus:(e={})=>re("/agent/apply/status",e,"Host80"),reasonsRefusalList:(e={})=>re("/reasons/refusal/list",e,"Host80"),webPopupList:(e={})=>re("/web/popup/list",e,"Host80"),walletHistoryList:(e={})=>re("/custom/wallet/history/search/list",e,"Host80"),walletTransferApply:(e={})=>re("/custom/transfer/apply",e,"Host04"),standardRebateList:(e={})=>re("/trade/standard/rebate",e,"Host80"),deleteAccountList:(e={})=>re("/custom/login/delete/search/list",e,"Host80"),historyList:(e={})=>re("/trade/histort/search/list",e,"Host80"),getWebsdkLink:(e={})=>re("/withdraw/getWebsdkLink",e,"Host04"),getWebsdkLink1:(e={})=>re("/agent/withdraw/getWebsdkLink",e,"Host04"),getWebsdkLink2:(e={})=>re("/custom/bank/getWebsdkLink",e,"Host80"),DropdownlusActivityOptions:(e={})=>re("/custom/activity/surplus/account/dropdown",e,"Host80"),getSystemList:(e={})=>re("/custom/system/config/all/list",e,"Host80"),switchSystem:(e={})=>re("/custom/system/config/choose",e,"Host80"),demoList:(e={})=>re("/account/demo/all/list",e,"Host80"),updateNick:(e={})=>re("/custom/login/update/nick/name",e,"Host80"),tradePosition:(e={})=>re("/trade/position",e,"Host80"),tradePositionExport:(e={})=>re("/trade/position/export",e,"Host80"),tradeShardingHistory:(e={})=>re("/trade/sharding/history",e,"Host80"),tradeShardingHistoryExport:(e={})=>re("/trade/sharding/history/export",e,"Host80")},de=s(T({__name:"cwg-system",props:{iconColor:{type:String,default:"#141d22"},textColor:{type:String,default:"#141d22"}},setup(e){E((e=>({ab998f0a:t.textColor})));const t=e,{Code:s}=X,{locale:o}=O(),u=a([]),d=a(null),p=D((()=>u.value.map((e=>({...e,label:f(e)}))))),m=D((()=>{if(!d.value||0===u.value.length)return"系统切换";const e=u.value.find((e=>e.sysCode===d.value));return e?f(e):"系统切换"})),g=e=>{if(u.value=Array.isArray(e)?e:[],u.value.length>0){const e=u.value.find((e=>e&&1===e.localSystem));d.value=e?e.sysCode:null}else d.value=null};async function y(e=!1){const t=(()=>{const e=U("systemListCache");if(!e)return null;try{return"string"==typeof e?JSON.parse(e):e}catch(t){return null}})();if(console.log(1,e),!e&&t&&t.timestamp&&Date.now()-t.timestamp<144e5)g(t.data||[]);else try{const e=await ue.getSystemList({});if(e&&e.code===s.StatusOK){console.log(e.data,"sys");const t=e.data||[];g(t),(e=>{W("systemListCache",JSON.stringify({data:e,timestamp:Date.now()}))})(t)}else A({title:e&&(e.msg||e.message)||"获取系统列表失败",icon:"none"})}catch(a){A({title:"获取系统列表失败",icon:"none"})}}function f(e){return e?"en"===o.value?e.sysNameEn||e.sysName||e.sysCode:e.sysName||e.sysNameEn||e.sysCode:""}function v(e){e&&e.sysCode&&e.sysCode!==d.value&&G({title:"系统提示",content:"是否切换系统?",confirmText:"确认",cancelText:"取消",success:async t=>{t.confirm&&await async function(e){try{const t=await ue.switchSystem({sysCode:e.sysCode});if(t&&t.code===s.StatusOK){const s=t.data,a="string"==typeof s?s:String(s||""),o=`${e.sysUrl}/#/signin?sysLoginToken=${btoa(a)}`;console.log(o),window.location.replace(o)}else A({title:t&&(t.msg||t.message)||"切换系统失败",icon:"none"})}catch(t){A({title:"切换系统失败",icon:"none"})}}(e)}})}function C({value:e}){v(e)}const b=a(!1);return n((()=>{b.value||(b.value=!0,console.log("注册"),N("updateSystemList",(()=>{y(!0)})))})),M((()=>{F("updateSystemList")})),(t,s)=>{const a=K,o=V(z("cwg-icon"),Q),n=H,u=V(z("cwg-dropdown"),ee);return p.value.length?(c(),l(n,{key:0,class:"cwg-system"},{default:i((()=>[r(u,{"menu-list":p.value,onMenuClick:C},{default:i((()=>[r(n,{class:"pc-header-btn"},{default:i((()=>[r(a,{class:"current-system-name"},{default:i((()=>[h(w(m.value),1)])),_:1}),r(o,{name:"crm-chevron-down",color:e.iconColor,darkColor:"#000",size:14},null,8,["color"])])),_:1})])),_:1},8,["menu-list"])])),_:1})):B("",!0)}}}),[["__scopeId","data-v-5eafe524"]]),pe=s(T({__name:"cwg-language",props:{iconColor:{type:String,default:"#141d22"}},setup(e){const t=a(x),{t:s,locale:o}=O(),n=D((()=>R.map((e=>({label:s(`language.${e}`),type:e})))));function u({value:e}){const s=(null==e?void 0:e.type)??e;if(!s)return;o.value=s,x.value=s,t.value=s;const a=Y[s]||"zh-Hans";J(a)}return(s,a)=>{const o=V(z("cwg-icon"),Q),d=H,p=V(z("cwg-dropdown"),ee);return c(),l(d,{class:"cwg-language"},{default:i((()=>[r(p,{"menu-list":n.value,onMenuClick:u,showActive:"",activeKey:t.value},{default:i((()=>[r(d,{class:"pc-header-btn"},{default:i((()=>[r(o,{name:"cwg-lang",color:e.iconColor,size:20},null,8,["color"])])),_:1})])),_:1},8,["menu-list","activeKey"])])),_:1})}}}),[["__scopeId","data-v-10cf9bca"]]),me={login:e=>re("/custom/login",e),getUserInfo:()=>re("/custom/info"),getUserSingle:()=>re("/wasabi/api/merchant/user/single",{}),logout:()=>re("/custom/logout",{}),forgetPwd:e=>re("/custom/update/password/send/email",e),accountDropdown:(e={})=>re("/wasabi/api/account/dropdown",e),updateEmailPassword:(e={})=>re("/custom/update/login/password",e)},ge="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2028.2.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20745.2%20167.7'%20style='enable-background:new%200%200%20745.2%20167.7;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23E32326;}%20.st1{fill:%23FFFFFF;}%20%3c/style%3e%3cpath%20class='st0'%20d='M31.5,0h104.7c17.4,0,31.5,14.1,31.5,31.5v104.7c0,17.4-14.1,31.5-31.5,31.5H31.5C14.1,167.7,0,153.6,0,136.2%20V31.5C0,14.1,14.1,0,31.5,0'/%3e%3cpath%20d='M463.9,106l-36.6-82.3h24.1l39,87.9c3,6.8,6.1,10.8,13.8,10.8c7.4,0,11.2-3.2,14.4-9.8l44.2-89h23.3L538.5,122%20c-6.9,14.1-18.3,21.9-34,21.9c-12,0-21.7-4.8-28.7-14.2c-7,9.8-17.6,14.2-29.5,14.2c-16.6,0-27.7-9.1-34.3-24l-42.8-96.2h24.1%20l39,87.9c3.1,6.8,6.1,10.8,13.9,10.8c7.4,0,11.1-3.3,14.4-9.8L463.9,106z'/%3e%3cpath%20d='M721.8,121.6V79.5h22.3v64.6h-93.7c-41.3,0-57.5-20.1-57.5-60.2s16.2-60.2,57.5-60.2h93.7V46h-93.7%20c-27.9,0-34.2,11.8-34.2,37.9s6.4,37.7,34.2,37.7L721.8,121.6L721.8,121.6z'/%3e%3cpath%20d='M350.3,23.7V46h-93.7c-27.9,0-34.1,11.8-34.1,37.9s6.4,37.7,34.1,37.7h93.7v22.5h-93.7c-41.3,0-57.5-20.1-57.5-60.2%20s16.2-60.2,57.5-60.2L350.3,23.7L350.3,23.7z'/%3e%3cpath%20class='st1'%20d='M90.1,27.3c17.1,0,33.3,7.7,44,21.1l-2.4,2.1l-15.3,13.8c-10.8-14.5-31.4-17.5-45.9-6.7S53,89,63.8,103.5%20s31.4,17.5,45.9,6.7c2.5-1.9,4.8-4.2,6.7-6.7l15.3,13.7l2.4,2.1c-19.6,24.3-55.2,28.2-79.5,8.6S26.5,72.8,46,48.5%20C56.8,35.1,73,27.3,90.1,27.3%20M89.9,31.7C61.1,32.1,38,55.8,38.4,84.6c0.4,28.3,23.2,51.1,51.5,51.5V121%20c-20.5-0.3-36.9-17.2-36.6-37.8C53.7,63.2,69.8,47,89.9,46.7V31.7z%20M89.2,55.9C73.8,56.8,62,70,62.8,85.4%20c0.8,14.3,12.2,25.7,26.5,26.5v-4.6c-12.9-0.5-23-11.3-22.6-24.3C67.1,70.8,77,60.9,89.2,60.5V55.9z%20M84.7,37.1%20c-25.8,3-44.3,26.3-41.4,52.1c2.5,21.7,19.6,38.9,41.4,41.4v-4.8c-23.2-3-39.6-24.2-36.6-47.4c2.5-19.1,17.5-34.1,36.6-36.6V37.1z'%20/%3e%3c/svg%3e";export{de as C,ee as _,pe as a,ge as b,ue as c,me as d,ie as g,re as p,le as u};