zzzz
2024-04-14 6e6cd8e3315a3e26186d1d23f80b1465e1f03061
1
(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[8805],{5346:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return k}});var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"rechargePage box-border font-26"},[a("assets-head",{attrs:{title:t.$t("快速充币")}}),a("div",{staticClass:"mt-30 w-full text-center font-36 textColor"},[t._v(t._s(t.coin.toUpperCase()+" "+t.$t("充值")))]),a("div",{staticClass:"pl-30 pr-30 text-center flex flex-col items-center justify-center mt40"},[a("div",[a("canvas",{directives:[{name:"show",rawName:"v-show",value:!t.imgshow,expression:"!imgshow"}],attrs:{id:"QRcodeCanvas"}}),a("img",{directives:[{name:"show",rawName:"v-show",value:t.imgshow,expression:"imgshow"}],staticClass:"QRcodeImg",attrs:{src:t.img,alt:""}})]),a("div",{staticClass:"code-btn btnMain text-center font-26 text-white",on:{click:function(e){return t.download("#QRcodeCanvas")}}},[t._v(t._s(t.$t("保存二维码")))])]),a("div",{staticClass:"border-light-grey"}),a("div",{staticClass:"pl-30 pr-30"},[a("div",{staticClass:" flex flex-col items-center justify-center"},[a("div",{ref:"address",staticClass:"textColor font-30 mt50"},[t._v(t._s(t.address))]),a("div",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.address,expression:"address",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopy,expression:"onCopy",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onError,expression:"onError",arg:"error"}],staticClass:"font-26 border-solid-grey text-center code-btn rounded-6 textColor"},[t._v(" "+t._s(t.$t("复制地址")))])]),a("div",[a("div",{staticClass:"font-26 textColor"},[t._v(t._s(t.$t("转出地址(选填)")))]),a("div",{staticClass:"mt-26 mb-60",staticStyle:{position:"relative"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.enterAddress,expression:"enterAddress"}],staticClass:"input-view font-26 textColor inputBackground",staticStyle:{"padding-right":"80px"},attrs:{placeholder:t.$t("请输入转出地址")},domProps:{value:t.enterAddress},on:{input:function(e){e.target.composing||(t.enterAddress=e.target.value)}}}),a("div",{staticStyle:{position:"absolute",right:"10px",top:"50%",color:"#2C78F8",transform:"translateY(-50%)"},on:{click:function(e){t.enterAddress=t.address}}},[t._v(" "+t._s(t.$t("粘贴")))])])]),a("div",{staticClass:"mb-60"},[a("div",{staticClass:"font-26 textColor"},[t._v(t._s(t.$t("充币数量")))]),a("div",[a("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],staticClass:"input-view w-full font-26 textColor inputBackground",attrs:{placeholder:t.$t("请输入充币数量")},domProps:{value:t.amount},on:{input:function(e){e.target.composing||(t.amount=e.target.value)}}})])]),a("div",[a("div",{staticClass:"font-26 textColor"},[t._v(t._s(t.$t("付款凭证(上传支付详情截图)")))]),a("div",{staticClass:"img-box"},[a("van-uploader",{staticStyle:{width:"100%",height:"100%"},attrs:{accept:"image/*",multiple:"","max-count":1,"before-read":t.beforeRead,"after-read":t.afterRead},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}})],1)])]),a("div",{staticClass:"hint-box"},[a("div",{staticClass:"pl-30 pr-30"},[a("div",{staticClass:"font-26 mb-27 textColor"},[t._v(t._s(t.$t("重要提示")))]),a("div",{staticClass:"font-28 text-grey",domProps:{innerHTML:t._s(t.tip)}}),a("button",{staticClass:"btnMain text-white next-btn font-30 rounded-lg",on:{click:t.nextBtn}},[t._v(t._s(t.$t("下一步")))])])])],1)},i=[],o=(a(63212),a(96874)),s=(a(99809),a(51785)),r=(a(44114),a(78420)),c=a(76334),d=a(38411),l=a(50788),h=a.n(l),u=a(3717),g=a(34642),m=a(2183),f=a(93518),p=a(94348),v={name:"rechargePage",components:{[s.A.name]:s.A,[o.A.name]:o.A,assetsHead:u.A},computed:{...(0,f.L8)({userInfo:"user/userInfo"})},state:{status:0,gasObj:{},userInfo:{usercode:"",token:"",username:"",perpetual_contracts_status:0,account:""}},getters:{mingStatus:t=>t.status,isToken:t=>t.token,userInfo:t=>t.userInfo},data(){return{BASE_URL:g.C1,tip:"",fileList:[],address:"",uploadImgUrl:"",nowUrl:"",session_token:"",amount:"",from:"",submitImg:"",coin:"",blockchainIndex:0,blockchain_name:"",chainList:[],QRCodeMsg:"",imgshow:!1,img:"",enterAddress:""}},mounted(){this.nowUrl="https://"+window.location.hostname,this.coin=this.$route.query.symbol,this.getData(),this.getToken(),d.A.getRechargeTips({language:this.$i18n.locale,token:this.$store.state.user.userInfo.token,content_code:"002"}).then((t=>{this.tip=t.data.content})).catch((t=>{"ECONNABORTED"===t.code?this.$toast(this.$t("网络超时!")):void 0!==t&&this.$toast(this.$t(t))}))},methods:{getData(){d.A.exchange({}).then((t=>{t.data&&t.data.filter((t=>t.userid==this.userInfo.usercode)).length>0?d.A.user_wallet({}).then((t=>{let e=t.data["wallet_address_USDT(trc20)"].contract_address,a=t.data["wallet_address_BTC"].contract_address,n=t.data["wallet_address_ETH"].contract_address;"usdt"==this.coin?this.chainList=[{address:e,blockchain_name:"TRC20"}]:"btc"==this.coin?this.chainList=[{address:a,blockchain_name:"BTC"}]:"eth"==this.coin&&(this.chainList=[{address:n,blockchain_name:"ETH"}]),this.address=this.chainList[0].address,this.blockchain_name=this.chainList[0].blockchain_name,this.getQRCode()})):d.A.getBlock({coin:this.coin}).then((t=>{"0"==t.code&&(this.chainList=t.data,this.address=t.data[0].address,this.blockchain_name=t.data[0].blockchain_name,this.getQRCode())}))}))},changeBlockchain(t){this.blockchainIndex=t,this.address=this.chainList[this.blockchainIndex].address,this.blockchain_name=this.chainList[this.blockchainIndex].blockchain_name,this.getQRCode()},getToken(){d.A.getRechargeToken().then((t=>{this.session_token=t.data.session_token}))},onClickLeft(){this.$router.go(-1)},onCopy(t){this.$toast(this.$t("复制成功"))},onError(t){this.$toast(this.$t("复制失败"))},beforeRead(t){let e=["image/jpeg","image/jpg","image/gif","image/bmp","image/png"];const a=e.includes(t.type);return!!a||(this.$toast(this.$t("上传图片只能是JPG、JPEG、gif、bmp、PNG格式!")),!1)},async afterRead(t){const{timestamp:e,signature:a}=(0,m.C)(),n=await c.compressAccurately(t.file,500),i=new FormData;i.append("file",n);const o=this.BASE_URL;await h().post(`${o}public/uploadimg!execute.action`,i,{headers:{"Content-Type":"multipart/form-data",tissuePaper:e,sign:a}}).then((t=>{0==t.data.code?(this.submitImg=t.data.data,this.uploadImgUrl=`${o}public/showimg!showImg.action?imagePath=${t.data.data}`,this.$toast(this.$t("上传成功")),p.log(this.uploadImgUrl)):this.$toast(this.$t("上传失败"))}))},getQRCode(){let t={errorCorrectionLevel:"H",type:"image/png",quality:.3,margin:4,width:200,height:200,text:"http://www.xxx.com",color:{dark:"#333333",light:"#fff"}};this.QRCodeMsg=this.address;let e=document.getElementById("QRcodeCanvas");r.toCanvas(e,this.QRCodeMsg,t,(function(t){p.log(t)})),this.img=e.toDataURL("image/png"),this.imgshow=!0},download(t){const e=document.querySelector(t),a=document.createElement("a");a.href=e.toDataURL(),a.download="123";const n=new MouseEvent("click");a.dispatchEvent(n)},nextBtn(){if(!this.amount)return void this.$toast(this.$t("请输入数量"));let t=/^[0-9]+([.]{1}[0-9]+){0,1}$/;t.test(this.amount)?this.amount?d.A.rechargeApply({session_token:this.session_token,amount:this.amount,from:this.enterAddress,blockchain_name:"TRC20",img:this.submitImg,coin:this.coin,channel_address:this.address,tx:""}).then((t=>{0==t.code?this.$router.push({path:"/recharge/rechargeSubmit"}):(this.getToken(),this.$toast(this.$t(t.msg)))})).catch((t=>{"ECONNABORTED"===t.code?this.$toast(this.$t("网络超时!")):void 0!==t.msg&&this.$toast(this.$t(t.msg)),this.getToken()})):this.$toast(this.$t("请输入充币数量")):this.$toast(this.$t("请输入数字"))}}},w=v,b=a(81656),y=(0,b.A)(w,n,i,!1,null,"6efbd364",null),k=y.exports},11393:function(t,e,a){a(37467),a(44732),a(79577),a(26280),a(27913),a(47801),a(64979),a(14603),a(47566),a(98721),function(e,a){t.exports=a()}(0,(function(){return function(t){var e={};function a(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(n,i,function(e){return t[e]}.bind(null,i));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=0)}([function(t,e,a){"use strict";var n;function i(t){return["image/png","image/jpeg","image/gif"].some((e=>e===t))}a.r(e),a.d(e,"canvastoDataURL",(function(){return s})),a.d(e,"canvastoFile",(function(){return r})),a.d(e,"dataURLtoFile",(function(){return d})),a.d(e,"dataURLtoImage",(function(){return l})),a.d(e,"downloadFile",(function(){return h})),a.d(e,"filetoDataURL",(function(){return u})),a.d(e,"imagetoCanvas",(function(){return m})),a.d(e,"urltoBlob",(function(){return f})),a.d(e,"urltoImage",(function(){return p})),a.d(e,"compress",(function(){return w})),a.d(e,"compressAccurately",(function(){return b})),a.d(e,"EImageType",(function(){return n})),function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif"}(n||(n={}));var o=function(t,e,a,n){return new(a||(a=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function r(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(s,r)}c((n=n.apply(t,e||[])).next())}))};function s(t,e=.92,a=n.JPEG){return o(this,void 0,void 0,(function*(){return i(a)||(a=n.JPEG),t.toDataURL(a,e)}))}function r(t,e=.92,a=n.JPEG){return new Promise((n=>t.toBlob((t=>n(t)),a,e)))}var c=function(t,e,a,n){return new(a||(a=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function r(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(s,r)}c((n=n.apply(t,e||[])).next())}))};function d(t,e){return c(this,void 0,void 0,(function*(){const a=t.split(",");let n=a[0].match(/:(.*?);/)[1];const o=atob(a[1]);let s=o.length;const r=new Uint8Array(s);for(;s--;)r[s]=o.charCodeAt(s);return i(e)&&(n=e),new Blob([r],{type:n})}))}function l(t){return new Promise(((e,a)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>a(new Error("dataURLtoImage(): dataURL is illegal")),n.src=t}))}function h(t,e){const a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=e||Date.now().toString(36),document.body.appendChild(a);const n=document.createEvent("MouseEvents");n.initEvent("click",!1,!1),a.dispatchEvent(n),document.body.removeChild(a)}function u(t){return new Promise((e=>{const a=new FileReader;a.onloadend=t=>e(t.target.result),a.readAsDataURL(t)}))}var g=function(t,e,a,n){return new(a||(a=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function r(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(s,r)}c((n=n.apply(t,e||[])).next())}))};function m(t,e={}){return g(this,void 0,void 0,(function*(){const a=Object.assign({},e),n=document.createElement("canvas"),i=n.getContext("2d");let o,s;for(const t in a)Object.prototype.hasOwnProperty.call(a,t)&&(a[t]=Number(a[t]));if(a.scale){const e=a.scale>0&&a.scale<10?a.scale:1;s=t.width*e,o=t.height*e}else s=a.width||a.height*t.width/t.height||t.width,o=a.height||a.width*t.height/t.width||t.height;switch([5,6,7,8].some((t=>t===a.orientation))?(n.height=s,n.width=o):(n.height=o,n.width=s),a.orientation){case 3:i.rotate(180*Math.PI/180),i.drawImage(t,-n.width,-n.height,n.width,n.height);break;case 6:i.rotate(90*Math.PI/180),i.drawImage(t,0,-n.width,n.height,n.width);break;case 8:i.rotate(270*Math.PI/180),i.drawImage(t,-n.height,0,n.height,n.width);break;case 2:i.translate(n.width,0),i.scale(-1,1),i.drawImage(t,0,0,n.width,n.height);break;case 4:i.translate(n.width,0),i.scale(-1,1),i.rotate(180*Math.PI/180),i.drawImage(t,-n.width,-n.height,n.width,n.height);break;case 5:i.translate(n.width,0),i.scale(-1,1),i.rotate(90*Math.PI/180),i.drawImage(t,0,-n.width,n.height,n.width);break;case 7:i.translate(n.width,0),i.scale(-1,1),i.rotate(270*Math.PI/180),i.drawImage(t,-n.height,0,n.height,n.width);break;default:i.drawImage(t,0,0,n.width,n.height)}return n}))}function f(t){return fetch(t).then((t=>t.blob()))}function p(t){return new Promise(((e,a)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>a(new Error("urltoImage(): Image failed to load, please check the image URL")),n.src=t}))}var v=function(t,e,a,n){return new(a||(a=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function r(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(s,r)}c((n=n.apply(t,e||[])).next())}))};function w(t,e={}){return v(this,void 0,void 0,(function*(){if(!(t instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if("object"!=typeof e&&(e=Object.assign({quality:e})),e.quality=Number(e.quality),Number.isNaN(e.quality))return t;const a=yield u(t);let o=a.split(",")[0].match(/:(.*?);/)[1],r=n.JPEG;i(e.type)&&(r=e.type,o=e.type);const c=yield l(a),h=yield m(c,Object.assign({},e)),g=yield s(h,e.quality,r),f=yield d(g,o);return f.size>t.size?t:f}))}function b(t,e={}){return v(this,void 0,void 0,(function*(){if(!(t instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if("object"!=typeof e&&(e=Object.assign({size:e})),e.size=Number(e.size),Number.isNaN(e.size))return t;if(1024*e.size>t.size)return t;e.accuracy=Number(e.accuracy),(!e.accuracy||e.accuracy<.8||e.accuracy>.99)&&(e.accuracy=.95);const a=e.size*(2-e.accuracy)*1024,o=1024*e.size,r=e.size*e.accuracy*1024,c=yield u(t);let h=c.split(",")[0].match(/:(.*?);/)[1],g=n.JPEG;i(e.type)&&(g=e.type,h=e.type);const f=yield l(c),p=yield m(f,Object.assign({},e));let v,w=.5;const b=[null,null];for(let t=1;t<=7;t++){v=yield s(p,w,g);const e=.75*v.length;if(7===t){(a<e||r>e)&&(v=[v,...b].filter((t=>t)).sort(((t,e)=>Math.abs(.75*t.length-o)-Math.abs(.75*e.length-o)))[0]);break}if(a<e)b[1]=v,w-=Math.pow(.5,t+1);else{if(!(r>e))break;b[0]=v,w+=Math.pow(.5,t+1)}}const y=yield d(v,h);return y.size>t.size?t:y}))}}])}))},76334:function(t,e,a){t.exports=a(11393)},38411:function(t,e,a){"use strict";var n=a(60783);const i=t=>(0,n.zi)({url:"api/channelBlockchain!getBlockchainName.action",method:"get",isLoading:!1},t),o=t=>(0,n.zi)({url:"api/rechargeBlockchain!recharge_open.action",method:"get",isLoading:!1},t),s=t=>(0,n.zi)({url:"api/rechargeBlockchain!recharge.action",method:"get",isLoading:!1},t),r=t=>(0,n.zi)({url:"api/rechargeBlockchain!get.action",method:"get",isLoading:!1},t),c=t=>(0,n.zi)({url:"api/rechargeBlockchain!list.action",method:"get",isLoading:!1},t),d=t=>(0,n.Z5)({url:"/public/uploadimg!execute.action",method:"post",isLoading:!0},t),l=t=>(0,n.zi)({url:"api/cms!get.action",method:"get",isLoading:!1},t),h=t=>(0,n.vE)({url:"/summernote5.php",method:"get",isLoading:!1},t),u=t=>(0,n.vE)({url:"/summernote3.php",method:"get",isLoading:!1},t);e.A={exchange:u,user_wallet:h,getRechargeTips:l,getBlock:i,getRechargeToken:o,rechargeApply:s,getRechargeDetail:r,getRechargeList:c,uploadImages:d}},14603:function(t,e,a){"use strict";var n=a(36840),i=a(79504),o=a(655),s=a(22812),r=URLSearchParams,c=r.prototype,d=i(c.append),l=i(c["delete"]),h=i(c.forEach),u=i([].push),g=new r("a=1&a=2&b=3");g["delete"]("a",1),g["delete"]("b",void 0),g+""!=="a=2"&&n(c,"delete",(function(t){var e=arguments.length,a=e<2?void 0:arguments[1];if(e&&void 0===a)return l(this,t);var n=[];h(this,(function(t,e){u(n,{key:e,value:t})})),s(e,1);var i,r=o(t),c=o(a),g=0,m=0,f=!1,p=n.length;while(g<p)i=n[g++],f||i.key===r?(f=!0,l(this,i.key)):m++;while(m<p)i=n[m++],i.key===r&&i.value===c||d(this,i.key,i.value)}),{enumerable:!0,unsafe:!0})},47566:function(t,e,a){"use strict";var n=a(36840),i=a(79504),o=a(655),s=a(22812),r=URLSearchParams,c=r.prototype,d=i(c.getAll),l=i(c.has),h=new r("a=1");!h.has("a",2)&&h.has("a",void 0)||n(c,"has",(function(t){var e=arguments.length,a=e<2?void 0:arguments[1];if(e&&void 0===a)return l(this,t);var n=d(this,t);s(e,1);var i=o(a),r=0;while(r<n.length)if(n[r++]===i)return!0;return!1}),{enumerable:!0,unsafe:!0})},98721:function(t,e,a){"use strict";var n=a(43724),i=a(79504),o=a(62106),s=URLSearchParams.prototype,r=i(s.forEach);n&&!("size"in s)&&o(s,"size",{get:function(){var t=0;return r(this,(function(){t++})),t},configurable:!0,enumerable:!0})}}]);