| 1 |
- import{aI as t,aJ as e,_ as s,r as a,aj as o,o as n,i as c,j as l,k as i,l as r,J as u,P as d,q as p,D as m,H as g,I as f,n as y,t as h,F as w,aK as H,N as v,x as C,aL as b,a as k,aM as L,aN as A,aO as S,A as _,L as x,aE as P,a1 as j,a3 as I,aB as T,d as $,u as E,c as O,f as D,g as N,v as U,at as W,aD as B,a6 as R,aP as F,aQ as J,aR as M}from"./index-C9tefb_I.js";import{u as z,_ as Y}from"./liveChat.83eX9-Rl.js";import{c as G}from"./index.DEN0qiOJ.js";const K=function(e){return Array.isArray(e)?Promise.all(e.map((t=>K.call(this,t)))):new Promise((s=>{t().in(this).select(e).boundingClientRect(s).exec()}))},q=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"}},emits:["open","close","change","menuClick"],setup(t,{expose:s,emit:b}){const k=t,L=b,A=a(!1),S=o({width:0,height:0}),_=o({}),x=a(0),P=()=>new Promise((t=>{S.width>0?t(S):H({success:e=>{S.width=e.windowWidth,S.height=e.windowHeight,t(S)},fail:()=>{setTimeout((()=>P().then(t)),100)}})})),j=async t=>{t.stopPropagation(),await P();const e=await K(".cwg-dropdown");if(!e)return;Object.assign(_,{transform:"scaleY(1)",visibility:"hidden",top:"-9999px",left:"-9999px",transition:"none"}),await v();const s=await K(".cwg-dropdown-menu-container");if(!s)return Object.keys(_).forEach((t=>delete _[t])),void(_.transform="scaleY(0)");const{width:a}=S,{left:o,right:n,bottom:c}=e;x.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 t=a-n;l.right=`${t>0?t:0}px`}Object.keys(_).forEach((t=>delete _[t])),Object.assign(_,l),A.value=!0,L("open"),L("change",!0)},I=()=>{A.value=!1,Object.keys(_).forEach((t=>delete _[t])),_.transform="scaleY(0)",L("close"),L("change",!1)};return n((()=>{var t;P(),x.value=(t=k.interspace)?(t=String(t)).endsWith("rpx")?e(parseInt(t)):(t.endsWith("px"),parseInt(t)):0})),s({close:I}),(e,s)=>{const a=C;return c(),l(a,null,{default:i((()=>[r(a,{class:"cwg-dropdown",style:u(e.customStyle),onClick:j},{default:i((()=>[d(e.$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(e.$slots,"menu",{},(()=>[r(a,{class:"menu"},{default:i((()=>[d(e.$slots,"btn",{},void 0,!0),(c(!0),m(g,null,f(t.menuList,((t,e)=>(c(),l(a,{class:"menu-item",key:e,onClick:s=>(L("menuClick",{value:t,index:e}),void I())},{default:i((()=>[r(a,null,{default:i((()=>[y(h(t.label||t),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:3})]),!0)])),_:3},8,["style"])])),_:3}),r(a,{class:w(["cwg-dropdown-mask",{"cwg-dropdown-mask-show":A.value}]),onClick:p(I,["stop"])},null,8,["class"])])),_:3})}}},[["__scopeId","data-v-98c5d752"]]),Q=G.Host85,V=["/list","/page","/field/params","/dropdown","/single","/detail"];let X=!1;const Z=(t,e={})=>{const{data:s,statusCode:a}=t;if(200===a){if("arraybuffer"===e.responseType||s instanceof ArrayBuffer)return s;if(401===s.code||600===s.code){if("/pages/login/index"===(()=>{const t=T();return t[t.length-1].route})())return Promise.reject({...s,msg:s.message||"登录失败,请重试"});k.value="";return e.ignore401||!1?Promise.reject({...s,code:401}):(X||(X=!0,_({title:"登录已过期,请重新登录",icon:"none"}),setTimeout((()=>{x({url:"/pages/login/index",success:()=>{P.set("mode","customer"),X=!1},fail:()=>{X=!1}})}),1500)),Promise.reject({...s,code:401,message:"登录已过期,请重新登录"}))}return 200===s.code?s:(400===s.code||_({title:s.msg||"请求失败",icon:"none"}),Promise.reject(s))}return _({title:`网络错误: ${a}`,icon:"none"}),Promise.reject(t)},tt=t=>(j(),_({title:"网络异常,请稍后重试",icon:"none"}),Promise.reject(t)),et=t=>{const e=G[t.type||"Host80"]||"",s={...t,url:`${e}${t.url}`,method:t.method||"GET",timeout:6e4},a=(t=>{var e;t.header||(t.header={}),"HostShop"===t.type?L.value&&(t.header["Access-Token"]=`${L.value}`):k.value&&(t.header["Access-Token"]=`${k.value}`);return A.value&&(t.header.Language=`${A.value}`),S.value&&(t.header.CLIENT=`${S.value}`),null==(e=z().userInfo)||e.cId,String(t.method||"GET").toUpperCase(),t.data={...t.data||{}},t.header["Content-Type"]||(t.header["Content-Type"]="application/json"),t})(s);return new Promise(((e,o)=>{V.some((t=>s.url.includes(t))),b({...a,success:s=>{try{const a=Z(s,t);e(a)}catch(a){o(a)}},fail:t=>{const e=tt(t);o(e)}})}))},st=(t,e,s={},a={},o=!0)=>new Promise(((n,c)=>{try{let l=e;e&&"object"==typeof e&&(l=e.path||e.url||e.tempFilePath||e.filePath||e);const i=`${Q}${t}`,r={...a||{}};k.value&&(r["Access-Token"]=`${k.value}`),A.value&&(r.Language=`${A.value}`),S.value&&(r.CLIENT=`${S.value}`),I({url:i,filePath:l,name:"file",header:r,formData:s||{},success:t=>{try{t.data=JSON.parse(t.data||"{}")}catch(s){t.data={}}const e={data:t.data,statusCode:t.statusCode};if(o)try{const t=Z(e);n(t)}catch(a){c(a)}else n(e.data)},fail:t=>{c(tt(t))}})}catch(l){c(l)}})),at=(t,e={},s={},a={})=>{const o="string"==typeof s?{type:s,...a||{}}:s||{};return et({url:t,method:"GET",data:e,...o})},ot=(t,e={},s,a={})=>et({url:t,method:"POST",data:e,type:s,...a}),nt={PushMessageList:(t={})=>ot("/push/message/list",t,"Host80"),CustomLoginInfo:(t={})=>ot("/custom/info",t,"Host80"),switchLanguage:(t={})=>ot("/custom/switch/lang",t,"Host80"),CustomDropdown:(t={})=>ot("/account/dropdown",t,"Host80"),getChartInfo:(t={})=>ot("/index/chart/list",t,"Host80"),transferInfo:(t={})=>ot("/transfer/info",t,"Host04"),TransferApply:(t={})=>ot("/transfer/apply",t,"Host04"),ResetDealPassword:(t={})=>ot("/account/settings/reset/deal/password",t,"Host80"),ResetDealPasswordEmail:(t={})=>ot("/account/deal/password/reset/apply/send/email",t,"Host80"),ChangeLeverageAdd:(t={})=>ot("/account/settings/change/leverage/add",t,"Host80"),ChangeInvestorOassword:(t={})=>ot("/account/settings/change/investor/password/add",t,"Host80"),ChangeDealPassword:(t={})=>ot("/account/settings/change/deal/password/add",t,"Host80"),AccountList:(t={})=>ot("/account/list",t,"Host80"),AccountAllList:(t={})=>ot("/account/all/list",t,"Host80"),AccountApplyAdd:(t={})=>ot("/account/apply/add",t,"Host80"),AccountApplyAddDome:(t={})=>ot("/account/apply/demo/add",t,"Host80"),AccountApplyData:(t={})=>ot("/account/apply/data",t,"Host80"),AccountApplyDataDome:(t={})=>ot("/account/apply/demo/data",t,"Host80"),excludeShowLogin:(t={})=>ot("/account/apply/exclude/show/login/type",t,"Host80"),CustomBankList:(t={})=>ot("/custom/bank/list",t,"Host80"),CustomBankDelete:(t={})=>ot("/custom/bank/delete",t,"Host80"),CustomBankUpdate:(t={})=>ot("/custom/bank/update",t,"Host80"),CustomBankAdd:(t={})=>ot("/custom/bank/add",t,"Host80"),customBankCardVerify:(t={})=>ot("/custom/bank/card/verify",t,"Host80"),customBankCardSendCode:(t={})=>ot("/custom/bank/card/send/code",t,"Host80"),CustomUpdateInfo:(t={})=>ot("/custom/update/info",t,"Host80"),CustomUpdateEmail:(t={})=>ot("/custom/update/email",t,"Host80"),CustomUpdateEmailSendCode:(t={})=>ot("/custom/update/email/send/code",t,"Host80"),CustomFileList:(t={})=>ot("/custom/file/list",t,"Host80"),CustomFileUpload:(t={})=>ot("/custom/file/upload/{type}/{id}",t,"Host80"),CustomFileMobile:(t={})=>at("/custom/file/mobile",t,"Host80"),CustomRecordAccount:(t={})=>ot("/custom/apply/list",t,"Host80"),customNoticeList:(t={})=>ot("/custom/notice/list",t,"Host80"),customNoticeSave:(t={})=>ot("/custom/notice/save",t,"Host80"),customApplyIb:(t={})=>ot("/agent/apply/add",t,"Host80"),customApplyIbStatus:(t={})=>ot("/agent/apply/status",t,"Host80"),reasonsRefusalList:(t={})=>ot("/reasons/refusal/list",t,"Host80"),webPopupList:(t={})=>ot("/web/popup/list",t,"Host80"),walletHistoryList:(t={})=>ot("/custom/wallet/history/search/list",t,"Host80"),walletTransferApply:(t={})=>ot("/custom/transfer/apply",t,"Host04"),standardRebateList:(t={})=>ot("/trade/standard/rebate",t,"Host80"),deleteAccountList:(t={})=>ot("/custom/login/delete/search/list",t,"Host80"),historyList:(t={})=>ot("/trade/histort/search/list",t,"Host80"),getWebsdkLink:(t={})=>ot("/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink1:(t={})=>ot("/agent/withdraw/getWebsdkLink",t,"Host04"),getWebsdkLink2:(t={})=>ot("/custom/bank/getWebsdkLink",t,"Host80"),DropdownlusActivityOptions:(t={})=>ot("/custom/activity/surplus/account/dropdown",t,"Host80"),getSystemList:(t={})=>ot("/custom/system/config/all/list",t,"Host80"),switchSystem:(t={})=>ot("/custom/system/config/choose",t,"Host80"),demoList:(t={})=>ot("/account/demo/all/list",t,"Host80"),updateNick:(t={})=>ot("/custom/login/update/nick/name",t,"Host80"),tradePosition:(t={})=>ot("/trade/position",t,"Host80"),tradePositionExport:(t={})=>ot("/trade/position/export",t,"Host80"),tradeShardingHistory:(t={})=>ot("/trade/sharding/history",t,"Host80"),tradeShardingHistoryExport:(t={})=>ot("/trade/sharding/history/export",t,"Host80")},ct=s($({__name:"cwg-system",props:{iconColor:{type:String,default:"#97A1C0"},textColor:{type:String,default:"#97A1C0"}},setup(t){const{Code:e}=G,{locale:s}=E(),o=a([]),u=a(null),d=O((()=>o.value.map((t=>({...t,label:f(t)}))))),p=O((()=>{if(!u.value||0===o.value.length)return"系统切换";const t=o.value.find((t=>t.sysCode===u.value));return t?f(t):"系统切换"})),m=t=>{if(o.value=Array.isArray(t)?t:[],o.value.length>0){const t=o.value.find((t=>t&&1===t.localSystem));u.value=t?t.sysCode:null}else u.value=null};async function g(){const t=(()=>{const t=W("systemListCache");if(!t)return null;try{return"string"==typeof t?JSON.parse(t):t}catch(e){return null}})();if(t&&t.timestamp&&Date.now()-t.timestamp<144e5)m(t.data||[]);else try{const t=await nt.getSystemList({});if(t&&t.code===e.StatusOK){const e=t.data||[];m(e),(t=>{B("systemListCache",JSON.stringify({data:t,timestamp:Date.now()}))})(e)}else _({title:t&&(t.msg||t.message)||"获取系统列表失败",icon:"none"})}catch(s){_({title:"获取系统列表失败",icon:"none"})}}function f(t){return t?"en"===s.value?t.sysNameEn||t.sysName||t.sysCode:t.sysName||t.sysNameEn||t.sysCode:""}function w(t){t&&t.sysCode&&t.sysCode!==u.value&&R({title:"系统提示",content:"是否切换系统?",confirmText:"确认",cancelText:"取消",success:async s=>{s.confirm&&await async function(t){try{const s=await nt.switchSystem({sysCode:t.sysCode});if(s&&s.code===e.StatusOK){const e=s.data,a="string"==typeof e?e:String(e||""),o=`${t.sysUrl}/#/signin?sysLoginToken=${btoa(a)}`;console.log(o),window.location.replace(o)}else _({title:s&&(s.msg||s.message)||"切换系统失败",icon:"none"})}catch(s){_({title:"切换系统失败",icon:"none"})}}(t)}})}function H({value:t}){w(t)}return n((()=>{g()})),(e,s)=>{const a=U,o=D(N("cwg-icon"),Y),n=C,u=D(N("cwg-dropdown"),q);return c(),l(n,{class:"cwg-system"},{default:i((()=>[r(u,{"menu-list":d.value,onMenuClick:H},{default:i((()=>[r(n,{class:"pc-header-btn"},{default:i((()=>[r(a,{class:"current-system-name"},{default:i((()=>[y(h(p.value),1)])),_:1}),r(o,{name:"crm-chevron-down",color:t.iconColor,darkColor:"#000",size:14},null,8,["color"])])),_:1})])),_:1},8,["menu-list"])])),_:1})}}}),[["__scopeId","data-v-ba2c3c86"]]),lt=s($({__name:"cwg-language",props:{iconColor:{type:String,default:"#97A1C0"}},setup(t){const{t:e,locale:s}=E(),a=O((()=>F.map((t=>({label:e(`language.${t}`),type:t})))));function o({value:t}){const e=(null==t?void 0:t.type)??t;if(!e)return;s.value=e,A.value=e;const a=M[e]||"zh-Hans";J(a)}return(e,s)=>{const n=D(N("cwg-icon"),Y),u=C,d=D(N("cwg-dropdown"),q);return c(),l(u,{class:"cwg-language"},{default:i((()=>[r(d,{"menu-list":a.value,onMenuClick:o},{default:i((()=>[r(u,{class:"pc-header-btn"},{default:i((()=>[r(n,{name:"cwg-lang",color:t.iconColor,size:20},null,8,["color"])])),_:1})])),_:1},8,["menu-list"])])),_:1})}}}),[["__scopeId","data-v-69351430"]]),it={login:t=>ot("/custom/login",t),getUserInfo:()=>ot("/custom/info"),getUserSingle:()=>ot("/wasabi/api/merchant/user/single",{}),logout:()=>ot("/custom/logout",{}),forgetPwd:t=>ot("/custom/update/password/send/email",t),accountDropdown:(t={})=>ot("/wasabi/api/account/dropdown",t),updateEmailPassword:(t={})=>ot("/custom/update/login/password",t)};export{ct as C,q as _,lt as a,it as b,nt as c,at as g,ot as p,st as u};
|