zzzz
2024-04-14 e7a5ac6aaa9e0c31bdf6b1319b8705cded9dc56e
1
"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[3323],{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)},a=[],r=(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)}}}),l=r,n=s(81656),o=(0,n.A)(l,i,a,!1,null,"77f40d14",null),c=o.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)},a=[],r=(s(28215),s(7587)),l=(s(44114),s(93068)),n={name:"perpetualEntrustList",components:{[r.A.name]:r.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="",a="";return i="limit"===s?this.$t("限价"):this.$t("市价"),a="buy"===t&&"open"===e?this.$t("开多"):"sell"===t&&"open"===e?this.$t("开空"):"buy"===t&&"close"===e?this.$t("平多"):this.$t("平空"),i+"/"+a},changeIcon(){this.iconShow=!this.iconShow},goDetail(t){this.$router.push({path:"/entrustDetail?order_no="+t.order_no})},cancelSingle(t){(0,l.$$)(t).then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall",t)}))},recallAll(){(0,l.vc)().then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall")}))}}},o=n,c=s(81656),d=(0,c.A)(o,i,a,!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)},a=[],r=(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})}}}),l=r,n=s(81656),o=(0,n.A)(l,i,a,!1,null,"43c14960",null),c=o.exports},8503:function(t,e,s){s.r(e),s.d(e,{default:function(){return u}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"entrustDetail"},[s("assets-head",{attrs:{title:t.$t("委托详情")}}),s("div",{staticClass:"contBackground h-20 w-full"}),s("div",{staticClass:"grey-line diviLine"}),s("div",{staticClass:"pl-30 pr-30 pt-58 pb-58"},[s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("操作")))]),s("div",{staticClass:"text-green textColor"},[t._v(" "+t._s(t.handleWord(t.detail.direction,t.detail.offset,t.detail.price_type))+" "+t._s(t.detail.name))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("状态")))]),s("div",{staticClass:"textColor"},[t._v(t._s("created"===t.detail.state?t.$t("已完成"):t.$t("未成交")))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("委托金额")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.amount_open))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("剩余金额")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.amount))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("保证金")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.deposit))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("手续费")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.fee))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("订单类型")))]),"limit"===t.detail.price_type?s("div",{staticClass:"textColor"},[t._v(t._s(t.$t("限价委托")))]):s("div",{staticClass:"textColor"},[t._v(t._s(t.$t("市价委托")))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("止盈")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.stop_price_profit))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("止损")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.stop_price_loss))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s("limit"===t.detail.price_type?t.$t("限价"):t.$t("市价")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.price))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("订单号")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.order_no))])]),s("div",{staticClass:"flex justify-between pb-44"},[s("div",{staticClass:"text-grey"},[t._v(t._s(t.$t("委托时间")))]),s("div",{staticClass:"textColor"},[t._v(t._s(t.detail.create_time))])])])],1)},a=[],r=s(93068),l=s(3717),n=(s(14104),s(68118),{name:"entrustDetail",data(){return{detail:{}}},components:{assetsHead:l.A},methods:{handleWord(t,e,s){let i="",a="";return i="limit"===s?this.$t("限价"):this.$t("市价"),a="buy"===t&&"open"===e?this.$t("开多"):"sell"===t&&"open"===e?this.$t("开空"):"buy"===t&&"close"===e?this.$t("平多"):this.$t("平空"),a},onClickLeft(){this.$router.go(-1)},fetchDetail(t){(0,r.B3)(t).then((t=>{this.detail=t}))}},beforeRouteEnter(t,e,s){const{query:{order_no:i}}=t;s((t=>{t.fetchDetail(i)}))}}),o=n,c=s(81656),d=(0,c.A)(o,i,a,!1,null,"32b24d46",null),u=d.exports},7587:function(t,e,s){var i=s(47456),a=s(83462),r=s(33448),l=s(23102),n=(0,i.Y)("circle"),o=n[0],c=n[1],d=3140,u=0;function v(t){return Math.min(Math.max(t,0),100)}function h(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=o({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,a._)(this.size);return{width:t,height:t}},path:function(){return h(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,r.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=v(t),this.increase=this.endRate>this.startRate,this.duration=Math.abs(1e3*(this.startRate-this.endRate)/this.speed),this.speed?((0,l.SA)(this.rafId),this.rafId=(0,l.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",v(parseFloat(s.toFixed(1)))),(this.increase?s<this.endRate:s>this.endRate)&&(this.rafId=(0,l.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)}}]);