"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[7434],{3717:function(t,e,a){a.d(e,{A:function(){return u}});var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"assetsHead"}},[a("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)},s=[],o=(a(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)}}}),i=o,r=a(81656),l=(0,r.A)(i,n,s,!1,null,"77f40d14",null),u=l.exports},2246:function(t,e,a){a.r(e),a.d(e,{default:function(){return h}});var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"repayment"},[n("assets-head",{attrs:{title:t.$t("还款")}}),n("div",{staticClass:"contentBox"},[n("div",{staticClass:"content mt-24 box-shad tabBackground"},[n("div",{staticClass:"mb-38"},[n("div",{staticClass:"font-32 textColor"},[t._v(t._s(t.$t("还款")))]),n("div",{staticClass:"flex mt-20 h-96 pr-34 items-center inputBox inputBackground1 textColor"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.repayAmount,expression:"repayAmount"}],staticClass:"h-full pl-22 inputBackground1",attrs:{type:"text",placeholder:t.$t("请输入还款数量")},domProps:{value:t.repayAmount},on:{input:[function(e){e.target.composing||(t.repayAmount=e.target.value)},t.changeMount]}}),n("div",{staticClass:"right h-62 flex items-center pl-26 box-border relative font-30"},[n("span",[t._v("USDT")]),n("span",{staticClass:"skyColor ml-28",on:{click:t.repayAll}},[t._v("ALL")])])]),n("div",{staticClass:"flex items-center font-24 mt-24 text-grey"},[t._v(" "+t._s(t.$t("可用余额"))+":"),n("span",{staticClass:"mr-14"},[t._v(t._s(t.volume||"--")+" USDT")]),n("img",{staticClass:"w-28 h-28",attrs:{src:a(2006),alt:""},on:{click:function(e){return t.$router.push("/exchange/exchangePage")}}})]),n("p",{staticClass:"mt-84 text-grey font-28 flex justify-between"},[n("span",[t._v(t._s(t.$t("总负债")))]),n("span",{staticClass:"textColor"},[t._v(t._s(t.debtAmount||"--")+" USDT")])]),n("p",{staticClass:"mt-36 text-grey font-28 flex justify-between"},[n("span",[t._v(t._s(t.$t("利息")))]),n("span",{staticClass:"textColor"},[t._v(t._s(""!==t.interestAmount?t.interestAmount:"--")+" USDT")])]),n("p",{staticClass:"mt-36 text-grey font-28 flex justify-between"},[n("span",[t._v(t._s(t.$t("本金还款")))]),n("span",{staticClass:"textColor"},[t._v(t._s(t.loanAmount||"--")+" USDT")])]),n("p",{staticClass:"mt-36 font-32 text-grey flex justify-between"},[n("span",[t._v(t._s(t.$t("还款后质押率")))]),n("span",{staticClass:"textColor"},[t._v(t._s(""!==t.pledgeRate?(1e4*t.pledgeRate/100).toFixed(2):"--")+"%")])]),n("div",{staticClass:"h-96 lh-96 rounded-lg text-center font-34 mt-84",class:t.repayAmount?"btnMain text-black ":"bgDark text-grey",on:{click:t.submit}},[t._v(" "+t._s(t.$t("确认还款"))+" ")])])])])],1)},s=[],o=(a(44114),a(3717)),i=a(84861),r=a(23808),l=a(49351),u={props:{},components:{assetsHead:o.A},data(){return{id:"",debtAmount:"",interestAmount:"",loanAmount:"",repayAmount:"",volume:"",pledgeRate:""}},mounted(){this.id=this.$route.query.id,this.debtAmount=this.$route.query.debtAmount,this.interestAmount=this.$route.query.interestAmount,this.loanAmount=this.$route.query.loanAmount,this.getList()},methods:{changeMount(){""!==this.repayAmount?this.debounceFn():this.pledgeRate=""},debounceFn:(0,r.sg)((function(){this.getLoanParam()}),500),getLoanParam(){i.Ay.getLoanParam({repayAmount:this.repayAmount,loanOrderId:this.id}).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,l.gV)().then((t=>{let e=t.extends,a=e.find((t=>"usdt"==t.symbol.toLowerCase()));this.volume=a.volume}))},repayAll(){this.repayAmount=this.debtAmount,this.getLoanParam()},submit(){i.Ay.repayOrder({repayAmount:this.repayAmount,loanOrderId:this.id}).then((t=>{this.$toast(this.$t("还款成功")),this.$router.push("/pledgeLoanOrder")}))}}},d=u,c=a(81656),p=(0,c.A)(d,n,s,!1,null,"43c77ea5",null),h=p.exports},84861:function(t,e,a){a.d(e,{Jt:function(){return g},Vh:function(){return A},iC:function(){return h},kM:function(){return m}});var n=a(60783);const s=t=>(0,n.zi)({url:"/api/loan!getLoanConfig.action",method:"get",isLoading:!1},t),o=t=>(0,n.zi)({url:"/api/loan!orderList.action",method:"get",isLoading:!1},t),i=t=>(0,n.zi)({url:"/api/loan!addOrder.action",method:"get",isLoading:!1},t),r=t=>(0,n.zi)({url:"/api/loan!getLoanParam.action",method:"get",isLoading:!1},t),l=t=>(0,n.zi)({url:"/api/loan!relationOrderList.action",method:"get",isLoading:!1},t),u=t=>(0,n.zi)({url:"/api/loan!replenishOrder.action",method:"get",isLoading:!1},t),d=t=>(0,n.zi)({url:"/api/loan!refurbishOrder.action",method:"get",isLoading:!1},t),c=t=>(0,n.zi)({url:"/api/loan!repayOrder.action",method:"get",isLoading:!1},t),p=t=>(0,n.zi)({url:"/api/loan!getOrder.action",method:"get",isLoading:!1},t),h=()=>(0,n.zi)({url:"api/dapp!update_account.action",method:"GET"}),m=t=>(0,n.zi)({url:"api/dapp!check.action",method:"get",loading:!1},t),g=t=>(0,n.zi)({url:"api/dapp!approve.action",method:"get",loading:!0,params:{to:t}}),A=(t,e=!0)=>(0,n.zi)({url:"/api/dapp!approve_addmsg.action",method:"get",loading:!0,params:{txnhash:t,status:e}});e.Ay={getLoanConfig:s,orderList:o,addOrder:i,getLoanParam:r,relationOrderList:l,replenishOrder:u,refurbishOrder:d,repayOrder:c,getOrder:p,_joinCheck:m,_approve:g,_approveDone:A,_checkStatus:h}},2006:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADnSURBVHgB7dTBCgFBHMfx38zYcvQI+wjehFdQSm4UB1HGAUXCQfI0HgVvwA0xw2ytJO1s23/2svs9/be2Pu3szAB5mWg825Qni10LBHHbCwZjwttrhRII4nGw90iCRYIuMBOLj7HV/f5YI2Gy1zz+BV19mdLcH3TqJ54G9h1PEzMVwoHxgq/xbMNRD+FdkIk+u1ROtz4cFh6L4B9Ol1tfK3GAo7TSI2Oa2XqXUmD9bkOGz07BX8wULOkNxbOHaw0JExAVBVRtmImBoPF8JxlnQxtmIl/SKIwctGGkYByMLLl0e2nkRfYCbdBjUN2EKfMAAAAASUVORK5CYII="}}]);