import i18n from './locales/index'; import {LOCAL_AREA_ID, LOCAL_WD_PASS, LOCAL_WD_PASS_SET_TIME} from "@constants/localkey"; import {decrypt, encrypt, localStorageGet, localStorageSet} from "@utils/helpers"; // import symbol from "@assets/symbol-defs.svg"; // import symbol_m from "@assets/symbol-mobile.svg"; import area from "@db/area"; global.i18n=i18n; // global.symbol=symbol; // global.symbol_m=symbol_m; global.CASH_BASE=100; global.DOLLAR="R$"; global.currency=""; global.dispatch=null; global.msgBox=null; global.msgBoxShow=(params)=>{ if (global.msgBox)global.msgBox.show(params); } global.msgBoxHide=()=>{ if (global.msgBox)global.msgBox.hide(); } global.authLockPath=null; global.device="mobile"; global.width=100; global.height=100; global.isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent); //游客id 指纹 global.BFP=null; //wd pass global.getWDPass=()=>{ let pass=localStorageGet(LOCAL_WD_PASS,""); if (pass!=null&&pass!==""){ pass=decrypt(pass); let lsettime=localStorageGet(LOCAL_WD_PASS_SET_TIME,""); if (lsettime!=null){ lsettime=Number(lsettime); let now=Date.now(); let during=now-lsettime; //10m let deadline=10*60*1000; if (during{ if (value==null)return; if (value!==""){ value=encrypt(value); } localStorageSet(LOCAL_WD_PASS,value); localStorageSet(LOCAL_WD_PASS_SET_TIME,Date.now()); } global.showDropCoins=()=>{ if (global.dropCoins)global.dropCoins.show(); } global.hideDropCoins=()=>{ if (global.dropCoins)global.dropCoins.hide(); } global.showMailNew=()=>{ if (global.mailNew)global.mailNew.show(); } global.hideMailNew=()=>{ if (global.mailNew)global.mailNew.hide(); } global.showInstallBox=()=>{ if (global.installBox)global.installBox.show(); } global.hideInstallBox=()=>{ if (global.installBox)global.installBox.hide(); } global.showBindPhone=()=>{ if (global.bindPhone)global.bindPhone.show(); } global.hideBindPhone=()=>{ if (global.bindPhone)global.bindPhone.hide(); } global.showBindPrompt=()=>{ if (global.bindPrompt)global.bindPrompt.show(); } global.hideBindPrompt=()=>{ if (global.bindPrompt)global.bindPrompt.hide(); } global.showProtectReward=()=>{ if (global.protectReward)global.protectReward.show(); } global.hideProtectReward=()=>{ if (global.protectReward)global.protectReward.hide(); } global.showLoadingCircular=(showMask=false)=>{ if (global.loadingCircular)global.loadingCircular.show(showMask); } global.hideLoadingCircular=()=>{ if (global.loadingCircular)global.loadingCircular.hide(); } global.showFirstPay=()=>{ if (global.firstPay)global.firstPay.show(); } global.hideFirstPay=()=>{ if (global.firstPay)global.firstPay.hide(); } global.showAreaSelect=(allowClose=true)=>{ if (global.areaSelect)global.areaSelect.show(allowClose); } global.hideAreaSelect=()=>{ if (global.areaSelect)global.areaSelect.hide(); } global.checkDomainArea=()=>{ let areaID=0; let host=window.location.host; for (let i = 0; i < area.length; i++) { let item=area[i]; if (item){ let code=item.code; if (host.startsWith(code)) { areaID=item.id; break; } } } return areaID; } global.getLocalAreaID=()=>{ let areaID=Number(localStorageGet(LOCAL_AREA_ID,0)); if (areaID===0){ let dAreaID=global.checkDomainArea(); if (dAreaID!==0){ localStorageSet(LOCAL_AREA_ID,dAreaID+""); areaID=dAreaID; } } return areaID; } global.setLocalAreaID=(value)=>{ localStorageSet(LOCAL_AREA_ID,value+""); window.location.reload(); } global.getLocalAreaItem=()=>{ let areaID=global.getLocalAreaID(); for (let i = 0; i < area.length; i++) { let item=area[i]; if (item){ if (item.id===areaID){ return item; } } } return null; } global.getLocalAreaAlCode=()=>{ let code='en-US'; let item=global.getLocalAreaItem(); if (item){ code=item.alcode; } return code; } global.showSaveAccount=(info)=>{ if (global.saveAccount)global.saveAccount.show(info); } global.hideSaveAccount=()=>{ if (global.saveAccount)global.saveAccount.hide(); } global.showBonusPack=()=>{ if (global.bonusPack)global.bonusPack.show(); } global.hideBonusPack=()=>{ if (global.bonusPack)global.bonusPack.hide(); } //wd pass