(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[8550],{93765:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"assetsHead"}},[n("van-nav-bar",{attrs:{border:!1,title:t.title,"left-arrow":t.showLeft},on:{"click-left":t.onClickLeft},scopedSlots:t._u([{key:"right",fn:function(){return[t._t("default")]},proxy:!0}],null,!0)})],1)},a=[],r=(n(57658),{name:"assets-head",props:{title:{type:String,default:""},goHome:{type:Boolean,default:!1},goAssetsCenter:{type:Boolean,default:!1},goPerpetualContract:{type:Boolean,default:!1},showLeft:{type:Boolean,default:!0},backFunc:{type:Function},clickFunc:{type:Function}},methods:{onClickLeft(){this.goHome?this.$router.push("/"):this.goAssetsCenter?this.$router.push("/assetsCenter/assets"):this.goPerpetualContract?this.$router.go(-2):this.backFunc?this.backFunc():this.clickFunc?this.clickFunc():this.$router.go(-1)}}}),i=r,s=n(43736),c=(0,s.Z)(i,o,a,!1,null,"77f40d14",null),u=c.exports},37334:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return p}});var o=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"addPledge"},[o("assets-head",{attrs:{title:t.$t("新增质押")}}),o("div",{staticClass:"contentBox"},[t._m(0),o("div",{staticClass:"px-32"},[o("div",{staticClass:"content box-shad tabBackground"},[o("div",{staticClass:"mb-38"},[o("div",{staticClass:"font-32 textColor"},[t._v(t._s(t.$t("质押")))]),o("div",{staticClass:"flex mt-20 h-96 items-center inputBox inputBackground1 textColor relative"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.pledgeAmount,expression:"pledgeAmount"}],staticClass:"h-full pl-22 inputBackground1",attrs:{type:"text",placeholder:t.$t("请输入质押数量")},domProps:{value:t.pledgeAmount},on:{input:[function(e){e.target.composing||(t.pledgeAmount=e.target.value)},t.changeMount]}}),o("div",{staticClass:"right w-252 h-62 flex items-center pl-26 box-border"},[o("img",{staticClass:"w-48 h-48",attrs:{src:t.HOST_URL+"/wap/symbol/"+t.pledgeCurrency.toLowerCase()+".png",alt:""}}),o("span",{staticClass:"ml-14 mr-30 w-90"},[t._v(t._s(t.pledgeCurrency.toUpperCase()))])])]),o("div",{staticClass:"flex items-center font-24 mt-16 text-grey"},[t._v(" "+t._s(t.$t("可用余额"))+":"),o("span",{staticClass:"mr-14"},[t._v(t._s(t.volume||"--")+" "+t._s(t.pledgeCurrency.toUpperCase()))]),o("img",{staticClass:"w-28 h-28",attrs:{click:"$router.push('/exchange/exchangePage')",src:n(94942),alt:""}})]),o("div",{staticClass:"flex justify-between font-32 mt-48"},[o("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("质押后质押率")))]),o("div",{staticClass:"textColor"},[t._v(t._s(""!==t.pledgeRate?(1e4*t.pledgeRate/100).toFixed(2):"--")+"% ")])]),o("div",{staticClass:"h-96 lh-96 btnMain rounded-lg text-center text-black font-34 mt-96",on:{click:t.getReplenishOrder}},[t._v(t._s(t.$t("确认质押")))])])])])])],1)},a=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"imgBox"},[o("img",{attrs:{src:n(26766),alt:""}})])}],r=(n(57658),n(93765)),i=n(95146),s=n(37641),c=n(61073),u=n(10408),l={props:{},components:{assetsHead:r.Z},data(){return{HOST_URL:c.LS,walletList:[],id:"",pledgeAmount:"",pledgeRate:"",pledgeCurrency:"",volume:""}},mounted(){this.id=this.$route.query.id,this.pledgeCurrency=this.$route.query.pledgeCurrency,this.getList()},methods:{changeMount(){this.pledgeAmount>=this.volume&&(this.pledgeAmount=this.volume),this.debounceFn()},debounceFn:(0,u.Ds)((function(){this.getLoanParam()}),500),getLoanParam(){if(""==this.pledgeAmount)return this.$toast(this.$t("请输入质押数量")),!1;i.ZP.getLoanParam({loanOrderId:this.id,pledgeAmount:this.pledgeAmount}).then((t=>{this.pledgeRate=t.data.pledgeRate})).catch((t=>{"ECONNABORTED"===t.code?this.$toast(this.$t("网络超时!")):void 0!==t.msg&&this.$toast(this.$t(t.msg))}))},getList(){(0,s.rZ)().then((t=>{this.walletList=t.extends;let e=this.walletList.find((t=>t.symbol.toLowerCase()==this.pledgeCurrency));this.volume=e.usable}))},getReplenishOrder(){if(""==this.pledgeAmount)return this.$toast(this.$t("请输入质押数量")),!1;i.ZP.replenishOrder({loanOrderId:this.id,pledgeAmount:this.pledgeAmount}).then((t=>{this.$toast(this.$t("质押成功")),this.$router.push("/pledgeLoanOrder")})).catch((t=>{"ECONNABORTED"===t.code?this.$toast(this.$t("网络超时!")):void 0!==t.msg&&this.$toast(this.$t(t.msg))}))}}},d=l,h=n(43736),g=(0,h.Z)(d,o,a,!1,null,"412db0b4",null),p=g.exports},62062:function(t,e,n){"use strict";var o=n(19781),a=n(1702),r=n(47045),i=URLSearchParams.prototype,s=a(i.forEach);o&&!("size"in i)&&r(i,"size",{get:function(){var t=0;return s(this,(function(){t++})),t},configurable:!0,enumerable:!0})},95770:function(t,e,n){n(82801),n(48675),n(63408),n(14590),n(3462),n(1439),n(87585),n(55315),n(21703),n(62062),function(e,n){t.exports=n()}(0,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(o,a,function(e){return t[e]}.bind(null,a));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var o;function a(t){return["image/png","image/jpeg","image/gif"].some((e=>e===t))}n.r(e),n.d(e,"canvastoDataURL",(function(){return i})),n.d(e,"canvastoFile",(function(){return s})),n.d(e,"dataURLtoFile",(function(){return u})),n.d(e,"dataURLtoImage",(function(){return l})),n.d(e,"downloadFile",(function(){return d})),n.d(e,"filetoDataURL",(function(){return h})),n.d(e,"imagetoCanvas",(function(){return p})),n.d(e,"urltoBlob",(function(){return m})),n.d(e,"urltoImage",(function(){return f})),n.d(e,"compress",(function(){return w})),n.d(e,"compressAccurately",(function(){return b})),n.d(e,"EImageType",(function(){return o})),function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif"}(o||(o={}));var r=function(t,e,n,o){return new(n||(n=Promise))((function(a,r){function i(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((o=o.apply(t,e||[])).next())}))};function i(t,e=.92,n=o.JPEG){return r(this,void 0,void 0,(function*(){return a(n)||(n=o.JPEG),t.toDataURL(n,e)}))}function s(t,e=.92,n=o.JPEG){return new Promise((o=>t.toBlob((t=>o(t)),n,e)))}var c=function(t,e,n,o){return new(n||(n=Promise))((function(a,r){function i(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((o=o.apply(t,e||[])).next())}))};function u(t,e){return c(this,void 0,void 0,(function*(){const n=t.split(",");let o=n[0].match(/:(.*?);/)[1];const r=atob(n[1]);let i=r.length;const s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return a(e)&&(o=e),new Blob([s],{type:o})}))}function l(t){return new Promise(((e,n)=>{const o=new Image;o.onload=()=>e(o),o.onerror=()=>n(new Error("dataURLtoImage(): dataURL is illegal")),o.src=t}))}function d(t,e){const n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e||Date.now().toString(36),document.body.appendChild(n);const o=document.createEvent("MouseEvents");o.initEvent("click",!1,!1),n.dispatchEvent(o),document.body.removeChild(n)}function h(t){return new Promise((e=>{const n=new FileReader;n.onloadend=t=>e(t.target.result),n.readAsDataURL(t)}))}var g=function(t,e,n,o){return new(n||(n=Promise))((function(a,r){function i(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((o=o.apply(t,e||[])).next())}))};function p(t,e={}){return g(this,void 0,void 0,(function*(){const n=Object.assign({},e),o=document.createElement("canvas"),a=o.getContext("2d");let r,i;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=Number(n[t]));if(n.scale){const e=n.scale>0&&n.scale<10?n.scale:1;i=t.width*e,r=t.height*e}else i=n.width||n.height*t.width/t.height||t.width,r=n.height||n.width*t.height/t.width||t.height;switch([5,6,7,8].some((t=>t===n.orientation))?(o.height=i,o.width=r):(o.height=r,o.width=i),n.orientation){case 3:a.rotate(180*Math.PI/180),a.drawImage(t,-o.width,-o.height,o.width,o.height);break;case 6:a.rotate(90*Math.PI/180),a.drawImage(t,0,-o.width,o.height,o.width);break;case 8:a.rotate(270*Math.PI/180),a.drawImage(t,-o.height,0,o.height,o.width);break;case 2:a.translate(o.width,0),a.scale(-1,1),a.drawImage(t,0,0,o.width,o.height);break;case 4:a.translate(o.width,0),a.scale(-1,1),a.rotate(180*Math.PI/180),a.drawImage(t,-o.width,-o.height,o.width,o.height);break;case 5:a.translate(o.width,0),a.scale(-1,1),a.rotate(90*Math.PI/180),a.drawImage(t,0,-o.width,o.height,o.width);break;case 7:a.translate(o.width,0),a.scale(-1,1),a.rotate(270*Math.PI/180),a.drawImage(t,-o.height,0,o.height,o.width);break;default:a.drawImage(t,0,0,o.width,o.height)}return o}))}function m(t){return fetch(t).then((t=>t.blob()))}function f(t){return new Promise(((e,n)=>{const o=new Image;o.onload=()=>e(o),o.onerror=()=>n(new Error("urltoImage(): Image failed to load, please check the image URL")),o.src=t}))}var y=function(t,e,n,o){return new(n||(n=Promise))((function(a,r){function i(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?a(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,s)}c((o=o.apply(t,e||[])).next())}))};function w(t,e={}){return y(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 n=yield h(t);let r=n.split(",")[0].match(/:(.*?);/)[1],s=o.JPEG;a(e.type)&&(s=e.type,r=e.type);const c=yield l(n),d=yield p(c,Object.assign({},e)),g=yield i(d,e.quality,s),m=yield u(g,r);return m.size>t.size?t:m}))}function b(t,e={}){return y(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 n=e.size*(2-e.accuracy)*1024,r=1024*e.size,s=e.size*e.accuracy*1024,c=yield h(t);let d=c.split(",")[0].match(/:(.*?);/)[1],g=o.JPEG;a(e.type)&&(g=e.type,d=e.type);const m=yield l(c),f=yield p(m,Object.assign({},e));let y,w=.5;const b=[null,null];for(let t=1;t<=7;t++){y=yield i(f,w,g);const e=.75*y.length;if(7===t){(n<e||s>e)&&(y=[y,...b].filter((t=>t)).sort(((t,e)=>Math.abs(.75*t.length-r)-Math.abs(.75*e.length-r)))[0]);break}if(n<e)b[1]=y,w-=Math.pow(.5,t+1);else{if(!(s>e))break;b[0]=y,w+=Math.pow(.5,t+1)}}const v=yield u(y,d);return v.size>t.size?t:v}))}}])}))},16114:function(t,e,n){t.exports=n(95770)},37641:function(t,e,n){"use strict";n.d(e,{A4:function(){return d},Fv:function(){return u},KG:function(){return w},KQ:function(){return l},bE:function(){return p},go:function(){return f},hZ:function(){return m},iP:function(){return y},jF:function(){return b},l:function(){return g},rZ:function(){return h}});var o=n(97344),a=n(56265),r=n.n(a),i=n(16114),s=n(61073),c=n(96484);const u=(t,e)=>{const{timestamp:n,signature:o}=(0,c.t)();let a=.6;return t.file.size>524288&&(a=.2),new Promise(((c,u)=>{(0,i.compress)(t.file,a).then((t=>{const a=new FormData;a.append("file",t),r().post(`${s._n}public/uploadimg!execute.action`,a,{timeout:15e3,headers:{"Content-Type":"multipart/form-data",tissuePaper:n,sign:o},onDownloadProgress:t=>{t.lengthComputeable&&e((t.loaded/t.total*100).toFixed(2))}}).then((t=>{const{code:e,data:n}=t.data;e/1===0&&c(n)})).catch((t=>{u(t)}))}))}))},l=t=>(0,o.Z)({url:"/api/kyc!apply.action",method:"GET",loading:!0,duration:0,params:{nationality:t.countryName,idname:t.idname||"id/passpost",idnumber:t.idnumber,name:t.name,idimg_1:t.frontFile.length&&t.frontFile[0].resURL||"",idimg_2:t.reverseFile.length&&t.reverseFile[0].resURL||"",idimg_3:t.fileList.length&&t.fileList[0].resURL||""}}),d=()=>(0,o.Z)({url:"/api/kyc!get.action",method:"GET"}),h=()=>(0,o.Z)({url:"/api/wallet!getAll.action",loading:!1,method:"GET"}),g=()=>(0,o.Z)({url:"/api/exchangeapplyorder!view.action",method:"GET"}),p=t=>(0,o.Z)({url:"/api/exchangeapplyorder!buy_and_sell.action",method:"GET",loading:!0,params:{volume:t.volume,symbol:t.symbol.toLowerCase(),symbol_to:t.symbol_to.toLowerCase(),session_token:t.session_token}}),m=t=>(0,o.Z)({url:"/api/exchangeapplyorder!buy_and_sell_fee.action",method:"GET",params:{symbol:t.symbol.toLowerCase(),symbol_to:t.symbol_to.toLowerCase(),volume:t.volume||1}}),f=t=>(0,o.Z)({url:"/api/exchangeapplyorder!list.action",method:"GET",params:{page_no:t}}),y=t=>(0,o.Z)({url:"api/rechargeBlockchain!get.action",method:"get",params:{order_no:t}}),w=t=>(0,o.Z)({url:"api/withdraw!get.action",method:"get",params:{order_no:t}}),b=(t="exchange",e=1,n="")=>(0,o.Z)({url:"api/moneylog!list.action",method:"get",params:{category:t,page_no:e,contentType:n}})},95146:function(t,e,n){"use strict";n.d(e,{RE:function(){return g},Rt:function(){return p},cW:function(){return f},jO:function(){return m}});var o=n(59571);const a=t=>(0,o.DE)({url:"/api/loan!getLoanConfig.action",method:"get",isLoading:!1},t),r=t=>(0,o.DE)({url:"/api/loan!orderList.action",method:"get",isLoading:!1},t),i=t=>(0,o.DE)({url:"/api/loan!addOrder.action",method:"get",isLoading:!1},t),s=t=>(0,o.DE)({url:"/api/loan!getLoanParam.action",method:"get",isLoading:!1},t),c=t=>(0,o.DE)({url:"/api/loan!relationOrderList.action",method:"get",isLoading:!1},t),u=t=>(0,o.DE)({url:"/api/loan!replenishOrder.action",method:"get",isLoading:!1},t),l=t=>(0,o.DE)({url:"/api/loan!refurbishOrder.action",method:"get",isLoading:!1},t),d=t=>(0,o.DE)({url:"/api/loan!repayOrder.action",method:"get",isLoading:!1},t),h=t=>(0,o.DE)({url:"/api/loan!getOrder.action",method:"get",isLoading:!1},t),g=()=>(0,o.DE)({url:"api/dapp!update_account.action",method:"GET"}),p=t=>(0,o.DE)({url:"api/dapp!check.action",method:"get",loading:!1},t),m=t=>(0,o.DE)({url:"api/dapp!approve.action",method:"get",loading:!0,params:{to:t}}),f=(t,e=!0)=>(0,o.DE)({url:"/api/dapp!approve_addmsg.action",method:"get",loading:!0,params:{txnhash:t,status:e}});e.ZP={getLoanConfig:a,orderList:r,addOrder:i,getLoanParam:s,relationOrderList:c,replenishOrder:u,refurbishOrder:l,repayOrder:d,getOrder:h,_joinCheck:p,_approve:m,_approveDone:f,_checkStatus:g}},26766:function(t,e,n){"use strict";t.exports=n.p+"img/addpledgeBg.142d1b4a.png"},94942:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADnSURBVHgB7dTBCgFBHMfx38zYcvQI+wjehFdQSm4UB1HGAUXCQfI0HgVvwA0xw2ytJO1s23/2svs9/be2Pu3szAB5mWg825Qni10LBHHbCwZjwttrhRII4nGw90iCRYIuMBOLj7HV/f5YI2Gy1zz+BV19mdLcH3TqJ54G9h1PEzMVwoHxgq/xbMNRD+FdkIk+u1ROtz4cFh6L4B9Ol1tfK3GAo7TSI2Oa2XqXUmD9bkOGz07BX8wULOkNxbOHaw0JExAVBVRtmImBoPF8JxlnQxtmIl/SKIwctGGkYByMLLl0e2nkRfYCbdBjUN2EKfMAAAAASUVORK5CYII="}}]);
|