zzzz
2024-04-10 a835dca493534af6b7644bef2c4d3c678cdfca97
1
"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[8383],{3717:function(t,e,s){s.d(e,{A:function(){return d}});var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{attrs:{id:"assetsHead"}},[s("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)},i=[],n=(s(44114),{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)}}}),o=n,r=s(81656),l=(0,r.A)(o,a,i,!1,null,"77f40d14",null),d=l.exports},42044:function(t,e,s){s.r(e),s.d(e,{default:function(){return p}});var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"addPledge"},[a("assets-head",{attrs:{title:t.$t("新增质押")}}),a("div",{staticClass:"contentBox"},[t._m(0),a("div",{staticClass:"px-32"},[a("div",{staticClass:"content box-shad tabBackground"},[a("div",{staticClass:"mb-38"},[a("div",{staticClass:"font-32 textColor"},[t._v(t._s(t.$t("质押")))]),a("div",{staticClass:"flex mt-20 h-96 items-center inputBox inputBackground1 textColor relative"},[a("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]}}),a("div",{staticClass:"right w-252 h-62 flex items-center pl-26 box-border"},[a("img",{staticClass:"w-48 h-48",attrs:{src:t.HOST_URL+"/wap/symbol/"+t.pledgeCurrency.toLowerCase()+".png",alt:""}}),a("span",{staticClass:"ml-14 mr-30 w-90"},[t._v(t._s(t.pledgeCurrency.toUpperCase()))])])]),a("div",{staticClass:"flex items-center font-24 mt-16 text-grey"},[t._v(" "+t._s(t.$t("可用余额"))+":"),a("span",{staticClass:"mr-14"},[t._v(t._s(t.volume||"--")+" "+t._s(t.pledgeCurrency.toUpperCase()))]),a("img",{staticClass:"w-28 h-28",attrs:{click:"$router.push('/exchange/exchangePage')",src:s(2006),alt:""}})]),a("div",{staticClass:"flex justify-between font-32 mt-48"},[a("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("质押后质押率")))]),a("div",{staticClass:"textColor"},[t._v(t._s(""!==t.pledgeRate?(1e4*t.pledgeRate/100).toFixed(2):"--")+"% ")])]),a("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)},i=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"imgBox"},[a("img",{attrs:{src:s(49407),alt:""}})])}],n=(s(44114),s(3717)),o=s(84861),r=s(49351),l=s(34642),d=s(23808),c={props:{},components:{assetsHead:n.A},data(){return{HOST_URL:l.bt,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,d.sg)((function(){this.getLoanParam()}),500),getLoanParam(){if(""==this.pledgeAmount)return this.$toast(this.$t("请输入质押数量")),!1;o.Ay.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,r.gV)().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;o.Ay.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))}))}}},u=c,g=s(81656),h=(0,g.A)(u,a,i,!1,null,"412db0b4",null),p=h.exports},84861:function(t,e,s){s.d(e,{Jt:function(){return m},Vh:function(){return A},iC:function(){return h},kM:function(){return p}});var a=s(60783);const i=t=>(0,a.zi)({url:"/api/loan!getLoanConfig.action",method:"get",isLoading:!1},t),n=t=>(0,a.zi)({url:"/api/loan!orderList.action",method:"get",isLoading:!1},t),o=t=>(0,a.zi)({url:"/api/loan!addOrder.action",method:"get",isLoading:!1},t),r=t=>(0,a.zi)({url:"/api/loan!getLoanParam.action",method:"get",isLoading:!1},t),l=t=>(0,a.zi)({url:"/api/loan!relationOrderList.action",method:"get",isLoading:!1},t),d=t=>(0,a.zi)({url:"/api/loan!replenishOrder.action",method:"get",isLoading:!1},t),c=t=>(0,a.zi)({url:"/api/loan!refurbishOrder.action",method:"get",isLoading:!1},t),u=t=>(0,a.zi)({url:"/api/loan!repayOrder.action",method:"get",isLoading:!1},t),g=t=>(0,a.zi)({url:"/api/loan!getOrder.action",method:"get",isLoading:!1},t),h=()=>(0,a.zi)({url:"api/dapp!update_account.action",method:"GET"}),p=t=>(0,a.zi)({url:"api/dapp!check.action",method:"get",loading:!1},t),m=t=>(0,a.zi)({url:"api/dapp!approve.action",method:"get",loading:!0,params:{to:t}}),A=(t,e=!0)=>(0,a.zi)({url:"/api/dapp!approve_addmsg.action",method:"get",loading:!0,params:{txnhash:t,status:e}});e.Ay={getLoanConfig:i,orderList:n,addOrder:o,getLoanParam:r,relationOrderList:l,replenishOrder:d,refurbishOrder:c,repayOrder:u,getOrder:g,_joinCheck:p,_approve:m,_approveDone:A,_checkStatus:h}},49407:function(t,e,s){t.exports=s.p+"img/addpledgeBg.142d1b4a.png"},2006:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADnSURBVHgB7dTBCgFBHMfx38zYcvQI+wjehFdQSm4UB1HGAUXCQfI0HgVvwA0xw2ytJO1s23/2svs9/be2Pu3szAB5mWg825Qni10LBHHbCwZjwttrhRII4nGw90iCRYIuMBOLj7HV/f5YI2Gy1zz+BV19mdLcH3TqJ54G9h1PEzMVwoHxgq/xbMNRD+FdkIk+u1ROtz4cFh6L4B9Ol1tfK3GAo7TSI2Oa2XqXUmD9bkOGz07BX8wULOkNxbOHaw0JExAVBVRtmImBoPF8JxlnQxtmIl/SKIwctGGkYByMLLl0e2nkRfYCbdBjUN2EKfMAAAAASUVORK5CYII="}}]);