"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[4381],{3717:function(t,e,s){s.d(e,{A:function(){return c}});var i=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)},n=[],o=(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)}}}),a=o,r=s(81656),l=(0,r.A)(a,i,n,!1,null,"77f40d14",null),c=l.exports},14104:function(t,e,s){s.d(e,{A:function(){return u}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t.listData.length>0?t._l(t.listData,(function(e){return s("div",{key:e.order_no,staticClass:"border-b-color"},[s("div",{staticClass:"flex justify-between items-center pt-34 pb-19"},[s("div",{staticClass:"flex flex-col"},[s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"font-31 w-100 buy-title",class:"buy"==e.direction?" text-green":"text-red"},[t._v(" "+t._s(t.handleWord(e.direction,e.offset,e.order_price_type))+" ")]),s("div",{staticClass:"ml-20 font-31 font-600 textColor"},[t._v(t._s(e.name))])])]),s("div",{staticClass:"text-grey font-26 flex flex-col justify-between"},[t._v(" "+t._s(e.create_time)+" ")])]),s("div",{staticClass:"flex justify-between pb-34"},[s("div",{staticClass:"flex items-center flex-between"},[s("div",{staticClass:"w-100"},[s("van-circle",{attrs:{rate:1-e.volume/e.volume_open*100,speed:100,text:t.text,"layer-color":"#EAEBEF","stroke-width":60,size:"65px"},model:{value:t.currentRate,callback:function(e){t.currentRate=e},expression:"currentRate"}})],1),s("div",{staticClass:"ml-62"},[s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"text-grey"},[s("div",[t._v(t._s(t.$t("数量")))])]),s("div",{staticClass:"ml-25 font-26 textColor"},[t._v(t._s(e.volume_open-e.volume)+"/"+t._s(e.volume_open))])]),s("div",{staticClass:"flex mt-35 items-center"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("价格")))]),s("div",{staticClass:"ml-25 font-26 textColor"},[t._v(t._s(e.price))])])])]),s("div",{staticClass:"btn-wrap mt-75"},[s("button",{staticClass:"order-btn colorMain borderMain bg-white",on:{click:function(s){return s.stopPropagation(),t.goDetail(e)}}},[t._v(" "+t._s(t.$t("详情")))]),s("button",{staticClass:"ml-19 order-btn border-none greyBg",on:{click:function(s){return s.stopPropagation(),t.cancelSingle(e.order_no)}}},[t._v(" "+t._s(t.$t("撤单")))])])])])})):t._e(),t.listData.length?t._e():s("div",{staticClass:"text-grey text-center py-300"},[t._v(t._s(t.$t("还没有委托")))])],2)},n=[],o=(s(28215),s(7587)),a=(s(44114),s(93068)),r={name:"perpetualEntrustList",components:{[o.A.name]:o.A},props:{listData:{type:Array,default(){return[]}}},data(){return{currentRate:0,iconShow:!1}},computed:{text(){return this.currentRate.toFixed(0)+"%"}},mounted(){},methods:{handleWord(t,e,s){let i="",n="";return i="limit"===s?this.$t("限价"):this.$t("市价"),n="buy"===t&&"open"===e?this.$t("开多"):"sell"===t&&"open"===e?this.$t("开空"):"buy"===t&&"close"===e?this.$t("平多"):this.$t("平空"),i+"/"+n},changeIcon(){this.iconShow=!this.iconShow},goDetail(t){this.$router.push({path:"/entrustDetail?order_no="+t.order_no})},cancelSingle(t){(0,a.$$)(t).then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall",t)}))},recallAll(){(0,a.vc)().then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall")}))}}},l=r,c=s(81656),d=(0,c.A)(l,i,n,!1,null,"1a03bf14",null),u=d.exports},68118:function(t,e,s){s.d(e,{A:function(){return c}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t.listData.length>0?t._l(t.listData,(function(e){return s("div",{key:e.order_no,staticClass:"border-b-color list-item"},[s("div",{staticClass:"flex justify-between pt-30 pb-28"},[s("div",{staticClass:"flex items-center"},[s("div",{staticClass:"pl-28 pr-28 pt-10 pb-10 text-white rounded-md",class:"buy"==e.direction?" bg-green":"bg-red"},[t._v(" "+t._s("buy"==e.direction?t.$t("开多"):t.$t("开空"))+" ")]),s("div",{staticClass:"ml-22 font-30 font-700 textColor"},[t._v(t._s(e.name)+" "+t._s(t.$t("永续")))])])]),s("div",{staticClass:"flex justify-between pb-28"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("价格")))]),s("div",{staticClass:"textColor"},[t._v(t._s(e.trade_avg_price))])]),s("div",{staticClass:"flex justify-between pb-28"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("成交数量")))]),s("div",{staticClass:"textColor"},[t._v(t._s(e.volume_open))])]),s("div",{staticClass:"flex justify-between pb-28"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("手续费")))]),s("div",{staticClass:"textColor"},[t._v(t._s(e.fee))])]),s("div",{staticClass:"flex justify-between pb-28"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("实现盈亏")))]),s("div",{class:{"text-green":e.profit/1>0,"text-red":e.profit/1<0}},[t._v(t._s(e.profit/1>0?"+"+e.profit:e.profit))])]),s("div",{staticClass:"flex justify-between pb-28"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("订单号")))]),s("div",{staticClass:"textColor"},[t._v(t._s(e.order_no))])]),s("div",{staticClass:"flex justify-between pb-28 items-center"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("操作")))]),s("button",{staticClass:"border-none w-125 h-60 detail-btn text-blue bg-none colorMain",on:{click:function(s){return t.goDetail(e)}}},[t._v(t._s(t.$t("详情")))])])])})):t._e()],2)},n=[],o=(s(44114),{name:"perpetualHistoryPosition",props:{listData:{type:Array,default(){return[]}}},data(){return{historyData:[{name:"BTC/USDT",direction:"buy",amount:"200",price:"23000",create_time:"2022-07-20 10:05:15"}]}},methods:{goDetail(t){this.$router.push({path:"/orderDetail?order_no="+t.order_no})}}}),a=o,r=s(81656),l=(0,r.A)(a,i,n,!1,null,"43c14960",null),c=l.exports},29645:function(t,e,s){s.r(e),s.d(e,{default:function(){return x}});var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"perpetualHistory"},[i("assets-head",{attrs:{title:t.$t("U本位合约历史"),backFunc:function(){t.$route.query.goback?t.$router.push({path:"/funds",query:{tab:2,index:0}}):t.$router.go(-1)}}}),i("div",[i("van-tabs",{ref:"tabs",attrs:{sticky:""},on:{change:t.onChange},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},t._l(t.selectData,(function(e){return i("van-tab",{key:e.title,attrs:{title:e.title,name:e.type}},[t.symbol?i("div",{staticClass:"all-select flex justify-end"},[i("div",{staticClass:"select-box flex",on:{click:function(e){e.stopPropagation(),t.isAll=!t.isAll}}},["wld"===t.symbol?i("div",{staticClass:"flex-1 font-24"},[t._v(" FTB/USDT ")]):"mln"===t.symbol?i("div",{staticClass:"flex-1 font-24"},[t._v(" DKL/USDT ")]):"qtum"===t.symbol?i("div",{staticClass:"flex-1 font-24"},[t._v(" BQHN/USDT ")]):"knc"===t.symbol?i("div",{staticClass:"flex-1 font-24"},[t._v(" XCM/USDT ")]):"vet"===t.symbol?i("div",{staticClass:"flex-1 font-24"},[t._v(" ACG/USDT ")]):i("div",{staticClass:"flex-1 font-24"},[t._v(" "+t._s(t.symbol.toUpperCase())+"/USDT ")]),i("van-icon",{attrs:{name:"arrow-down"}}),t.isAll?i("div",{staticClass:"select-data"},t._l(t.currencyList,(function(e,s){return i("div",{key:s,staticClass:"select-item font-24",on:{click:function(s){return s.stopPropagation(),t.selectItem(e)}}},[t._v(t._s(e.symbolFullName))])})),0):t._e()],1)]):t._e(),"orders"===t.type?[i("van-list",{attrs:{"loading-text":t.$t("加载中..."),finished:t.finished,"finished-text":t.dataList.orders.length?t.$t("已经全部加载完毕"):"",offset:130},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},["orders"===t.type?i("PerpetualEntrustList",{attrs:{"list-data":t.dataList.orders},on:{recall:t.recall}}):t._e(),t.dataList.orders.length||t.loading?t._e():i("div",{staticClass:"flex flex-col justify-center pt-50 pb-20 items-center"},[i("img",{staticClass:"w-180 h-180",attrs:{src:s(36928),alt:""}}),i("p",{staticClass:"text-grey mt-10"},[t._v(t._s(t.$t("暂无记录")))])])],1)]:t._e(),"hisorders"===t.type?[i("van-list",{attrs:{"loading-text":t.$t("加载中..."),finished:t.finished,"finished-text":t.dataList.hisorders.length?t.$t("已经全部加载完毕"):"",offset:130},on:{load:t.onLoad},model:{value:t.loading,callback:function(e){t.loading=e},expression:"loading"}},[i("PerpetualHistoryPosition",{attrs:{"list-data":t.dataList.hisorders}}),t.dataList.hisorders.length||t.loading?t._e():i("div",{staticClass:"flex flex-col justify-center pt-50 pb-20 items-center"},[i("img",{staticClass:"w-180 h-180",attrs:{src:s(36928),alt:""}}),i("p",{staticClass:"text-grey mt-10"},[t._v(t._s(t.$t("暂无记录")))])])],1)]:t._e()],2)})),1)],1)],1)},n=[],o=(s(96356),s(162)),a=(s(1751),s(26852)),r=(s(7287),s(10339)),l=(s(57352),s(99502)),c=(s(94156),s(84458)),d=s(3717),u=s(14104),h=s(68118),p=s(93068),f=s(2223),v=s(94348),m={data(){return{type:"orders",dataList:{orders:[],hisorders:[]},isAll:!1,symbol:"",selectData:[{title:this.$t("当前委托"),type:"orders"},{title:this.$t("历史仓位"),type:"hisorders"}],loading:!1,finished:!1,page:1}},mounted(){this.getCoins(),this.symbol=this.$route.query.symbol},methods:{getCoins(){(0,f.Ks)().then((t=>{v.log(t),this.currencyList=t}))},onChange(t){this.dataList[t]=[],this.finished=!1,this.page=1,this.type=t,this.loading=!0,this.loading&&this.fetchList(this.symbol)},onClickLeft(){this.$router.go(-1)},async fetchList(t){const e="orders"===this.type?p.g3:p.RX,s=this.type;e(t,s,this.page).then((t=>{this.dataList[s]=this.dataList[s].concat(t),this.loading=!1,t.length<10&&(this.finished=!0),this.page++}))},recall(){this.page=1,this.dataList.orders=[],this.fetchList(this.symbol)},onLoad(){this.fetchList(this.symbol)},selectItem(t){this.dataList[this.type]=[],this.page=1,this.symbol=t.symbol,this.fetchList(this.symbol),this.isAll=!1}},components:{PerpetualEntrustList:u.A,PerpetualHistoryPosition:h.A,assetsHead:d.A,[c.A.name]:c.A,[l.A.name]:l.A,[r.A.name]:r.A,[a.A.name]:a.A,[o.A.name]:o.A},beforeRouteEnter(t,e,s){const{query:{symbol:i}}=t;s((t=>{t.symbol=i}))}},y=m,g=s(81656),b=(0,g.A)(y,i,n,!1,null,"9711c028",null),x=b.exports},7587:function(t,e,s){var i=s(47456),n=s(83462),o=s(33448),a=s(23102),r=(0,i.Y)("circle"),l=r[0],c=r[1],d=3140,u=0;function h(t){return Math.min(Math.max(t,0),100)}function p(t,e){var s=t?1:0;return"M "+e/2+" "+e/2+" m 0, -500 a 500, 500 0 1, "+s+" 0, 1000 a 500, 500 0 1, "+s+" 0, -1000"}e.A=l({props:{text:String,size:[Number,String],color:[String,Object],layerColor:String,strokeLinecap:String,value:{type:Number,default:0},speed:{type:[Number,String],default:0},fill:{type:String,default:"none"},rate:{type:[Number,String],default:100},strokeWidth:{type:[Number,String],default:40},clockwise:{type:Boolean,default:!0}},beforeCreate:function(){this.uid="van-circle-gradient-"+u++},computed:{style:function(){var t=(0,n._)(this.size);return{width:t,height:t}},path:function(){return p(this.clockwise,this.viewBoxSize)},viewBoxSize:function(){return+this.strokeWidth+1e3},layerStyle:function(){return{fill:""+this.fill,stroke:""+this.layerColor,strokeWidth:this.strokeWidth+"px"}},hoverStyle:function(){var t=d*this.value/100;return{stroke:""+(this.gradient?"url(#"+this.uid+")":this.color),strokeWidth:+this.strokeWidth+1+"px",strokeLinecap:this.strokeLinecap,strokeDasharray:t+"px "+d+"px"}},gradient:function(){return(0,o.Gv)(this.color)},LinearGradient:function(){var t=this,e=this.$createElement;if(this.gradient){var s=Object.keys(this.color).sort((function(t,e){return parseFloat(t)-parseFloat(e)})).map((function(s,i){return e("stop",{key:i,attrs:{offset:s,"stop-color":t.color[s]}})}));return e("defs",[e("linearGradient",{attrs:{id:this.uid,x1:"100%",y1:"0%",x2:"0%",y2:"0%"}},[s])])}}},watch:{rate:{handler:function(t){this.startTime=Date.now(),this.startRate=this.value,this.endRate=h(t),this.increase=this.endRate>this.startRate,this.duration=Math.abs(1e3*(this.startRate-this.endRate)/this.speed),this.speed?((0,a.SA)(this.rafId),this.rafId=(0,a.er)(this.animate)):this.$emit("input",this.endRate)},immediate:!0}},methods:{animate:function(){var t=Date.now(),e=Math.min((t-this.startTime)/this.duration,1),s=e*(this.endRate-this.startRate)+this.startRate;this.$emit("input",h(parseFloat(s.toFixed(1)))),(this.increase?sthis.endRate)&&(this.rafId=(0,a.er)(this.animate))}},render:function(){var t=arguments[0];return t("div",{class:c(),style:this.style},[t("svg",{attrs:{viewBox:"0 0 "+this.viewBoxSize+" "+this.viewBoxSize}},[this.LinearGradient,t("path",{class:c("layer"),style:this.layerStyle,attrs:{d:this.path}}),t("path",{attrs:{d:this.path},class:c("hover"),style:this.hoverStyle})]),this.slots()||this.text&&t("div",{class:c("text")},[this.text])])}})},28215:function(t,e,s){s(76952)},99502:function(t,e,s){var i=s(47456),n=s(48499),o=s(52835),a=s(99297),r=s(9471),l=s(96874),c=s(75187),d=(0,i.Y)("dropdown-item"),u=d[0],h=d[1];e.A=u({mixins:[(0,o.m)({ref:"wrapper"}),(0,a.b)("vanDropdownMenu")],props:{value:null,title:String,disabled:Boolean,titleClass:String,options:{type:Array,default:function(){return[]}},lazyRender:{type:Boolean,default:!0}},data:function(){return{transition:!0,showPopup:!1,showWrapper:!1}},computed:{displayTitle:function(){var t=this;if(this.title)return this.title;var e=this.options.filter((function(e){return e.value===t.value}));return e.length?e[0].text:""}},watch:{showPopup:function(t){this.bindScroll(t)}},beforeCreate:function(){var t=this,e=function(e){return function(){return t.$emit(e)}};this.onOpen=e("open"),this.onClose=e("close"),this.onOpened=e("opened")},methods:{toggle:function(t,e){void 0===t&&(t=!this.showPopup),void 0===e&&(e={}),t!==this.showPopup&&(this.transition=!e.immediate,this.showPopup=t,t&&(this.parent.updateOffset(),this.showWrapper=!0))},bindScroll:function(t){var e=this.parent.scroller,s=t?n.on:n.AU;s(e,"scroll",this.onScroll,!0)},onScroll:function(){this.parent.updateOffset()},onClickWrapper:function(t){this.getContainer&&t.stopPropagation()}},render:function(){var t=this,e=arguments[0],s=this.parent,i=s.zIndex,n=s.offset,o=s.overlay,a=s.duration,d=s.direction,u=s.activeColor,p=s.closeOnClickOverlay,f=this.options.map((function(s){var i=s.value===t.value;return e(r.A,{attrs:{clickable:!0,icon:s.icon,title:s.text},key:s.value,class:h("option",{active:i}),style:{color:i?u:""},on:{click:function(){t.showPopup=!1,s.value!==t.value&&(t.$emit("input",s.value),t.$emit("change",s.value))}}},[i&&e(l.A,{class:h("icon"),attrs:{color:u,name:"success"}})])})),v={zIndex:i};return"down"===d?v.top=n+"px":v.bottom=n+"px",e("div",[e("div",{directives:[{name:"show",value:this.showWrapper}],ref:"wrapper",style:v,class:h([d]),on:{click:this.onClickWrapper}},[e(c.A,{attrs:{overlay:o,position:"down"===d?"top":"bottom",duration:this.transition?a:0,lazyRender:this.lazyRender,overlayStyle:{position:"absolute"},closeOnClickOverlay:p},class:h("content"),on:{open:this.onOpen,close:this.onClose,opened:this.onOpened,closed:function(){t.showWrapper=!1,t.$emit("closed")}},model:{value:t.showPopup,callback:function(e){t.showPopup=e}}},[f,this.slots("default")])])])}})},57352:function(t,e,s){s(76952),s(69176),s(98992),s(22795),s(90504),s(65270)},84458:function(t,e,s){var i=s(47456),n=s(33448),o=s(32486),a=s(99297),r=s(26063),l=(0,i.Y)("dropdown-menu"),c=l[0],d=l[1];e.A=c({mixins:[(0,a.G)("vanDropdownMenu"),(0,r.f)({event:"click",method:"onClickOutside"})],props:{zIndex:[Number,String],activeColor:String,overlay:{type:Boolean,default:!0},duration:{type:[Number,String],default:.2},direction:{type:String,default:"down"},closeOnClickOverlay:{type:Boolean,default:!0}},data:function(){return{offset:0}},computed:{scroller:function(){return(0,o.Rm)(this.$el)},opened:function(){return this.children.some((function(t){return t.showWrapper}))},barStyle:function(){if(this.opened&&(0,n.C8)(this.zIndex))return{zIndex:1+this.zIndex}}},methods:{updateOffset:function(){if(this.$refs.bar){var t=this.$refs.bar.getBoundingClientRect();"down"===this.direction?this.offset=t.bottom:this.offset=window.innerHeight-t.top}},toggleItem:function(t){this.children.forEach((function(e,s){s===t?e.toggle():e.showPopup&&e.toggle(!1,{immediate:!0})}))},onClickOutside:function(){this.children.forEach((function(t){t.toggle(!1)}))}},render:function(){var t=this,e=arguments[0],s=this.children.map((function(s,i){return e("div",{attrs:{role:"button",tabindex:s.disabled?-1:0},class:d("item",{disabled:s.disabled}),on:{click:function(){s.disabled||t.toggleItem(i)}}},[e("span",{class:[d("title",{active:s.showPopup,down:s.showPopup===("down"===t.direction)}),s.titleClass],style:{color:s.showPopup?t.activeColor:""}},[e("div",{class:"van-ellipsis"},[s.slots("title")||s.displayTitle])])])}));return e("div",{class:d()},[e("div",{ref:"bar",style:this.barStyle,class:d("bar",{opened:this.opened})},[s]),this.slots("default")])}})},94156:function(t,e,s){s(76952)},26063:function(t,e,s){s.d(e,{f:function(){return n}});var i=s(48499),n=function(t){return{props:{closeOnClickOutside:{type:Boolean,default:!0}},data:function(){var e=this,s=function(s){e.closeOnClickOutside&&!e.$el.contains(s.target)&&e[t.method]()};return{clickOutsideHandler:s}},mounted:function(){(0,i.on)(document,t.event,this.clickOutsideHandler)},beforeDestroy:function(){(0,i.AU)(document,t.event,this.clickOutsideHandler)}}}},36928:function(t,e,s){t.exports=s.p+"img/no-data.ecf2b7d7.png"}}]);