"use strict";(self["webpackChunkexchange"]=self["webpackChunkexchange"]||[]).push([[4297],{20550:function(t,e,s){s.d(e,{A:function(){return m}});var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"contract-header"},[i("div",{staticClass:"pl-30 pr-30"},[i("div",{staticClass:"flex pt-45 before"},[i("div",{staticClass:"flex items-center justify-center"},[i("img",{staticClass:"w-35 h-35",attrs:{src:s(81555)("./"+t.theme+"/image/convert.png"),alt:"convert-img"},on:{click:t.onSidebar}}),i("div",{staticClass:"flex pl-21 textColor",on:{click:t.onSidebar}},[i("div",{staticClass:"font-35"},[t._v(t._s(t.symbol.toUpperCase()||"--")+"/USDT")]),i("div",{staticClass:"ml-15"},[t._v(t._s(t.title))])]),i("div",{staticClass:"pl-30 w-160",class:{"text-green":t.range>0,"text-red":t.range<=0}},[t._v(" "+t._s(t.range>0?"+":"")+t._s(t.range||"--")+"% ")])])]),i("div",{staticClass:"flex justify-between pt-34"},[i("button",{staticClass:"w-368 h-74 lh-74",class:1==t.selectIndex?"select-active":"no-select",on:{click:function(e){return t.changeTab(1)}}},[t._v(" "+t._s(t.$t("永续合约"))+" ")]),i("button",{staticClass:"w-368 h-74 lh-74",class:2==t.selectIndex?"select-active":"no-select",on:{click:function(e){return t.changeTab(2)}}},[t._v(" "+t._s(t.$t("交割合约"))+" ")])])])]),i("van-popup",{staticClass:"popup",attrs:{round:"","close-icon-position":"top-left",position:"left"},on:{closed:t.onClose},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("div",{staticClass:"pl-42 border-b-color pt-48 pb-48"},[i("div",{staticClass:"textColor"},[i("span",{staticClass:"font-bold font-45 mr-12"},[t._v(t._s(t.title)+" "+t._s(t.$t("合约")))]),i("span",{staticClass:"font-30"},[t._v("/ USDT")])])]),i("div",{staticClass:"pl-42 pr-40"},[i("div",{staticClass:"flex justify-between mb-42 mt-53"},[i("div",{staticClass:"flex items-center text-grey"},[i("div",{staticClass:"mr-12"},[t._v(t._s(t.$t("名称")))])]),i("div",{staticClass:"flex text-grey"},[i("div",{staticClass:"flex items-center"},[i("div",{},[t._v(t._s(t.$t("最新价格")))])]),i("div",{staticClass:"flex items-center"},[i("div",{staticClass:"mr-12"},[t._v("/24H"+t._s(t.$t("涨跌")))])])])]),t._l(t.list,(function(e){return i("div",{key:e.name,staticClass:"flex justify-between mb-50",on:{click:function(s){return t.onRoute(e)}}},[i("div",[i("div",{staticClass:"textColor"},[t._v(t._s(e.name))]),i("div",{staticClass:"text-grey mt-10"},[t._v(" "+t._s(1==t.selectIndex?t.$t("永续"):t.$t("交割"))+" ")])]),i("div",{staticClass:"text-right"},[i("div",{staticClass:"textColor"},[t._v(t._s(e.close))]),i("div",{staticClass:"mt-10",class:e.change_ratio>0?"text-green":"text-red"},[t._v(" "+t._s(e.change_ratio||(0===e.change_ratio?0:"--"))+"% ")])])])}))],2)])],1)},a=[],n=(s(93093),s(75187)),o=(s(44114),s(93518)),r=s(45313),l=s(23808),c=s(94348),u={name:"contractHeader",props:{backFunc:{type:Function,default:null},balance:{type:[String,Number],default:0},symbol:{type:String,default:""},range:{type:String,defalult:""},selectIndex:{type:[String,Number],defalult:""}},components:{[n.A.name]:n.A},computed:{...(0,o.L8)({coinList:"home/coinList",theme:"home/theme"}),title(){return[this.$t("永续"),this.$t("交割")][this.selectIndex-1]}},data(){return{show:!1,timeout:null,list:[]}},created(){},methods:{onRoute(t){this.$route.params.symbol!==t.symbol&&(this.$router.push(`/perpetualContract/${t.symbol}`),this.$emit("update-coin",t.symbol),(0,l.cT)("symbol",t.symbol),this.onClose(),this.$forceUpdate()),this.show=!1},onSidebar(){c.log(this.userInfo),this.coins=this.coinList.map((t=>t.symbol)),this.show=!0,this.fetchList()},fetchList(){(0,r.RK)(this.coins.join(",")).then((t=>{this.list=t,this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.timeout=setTimeout((()=>{this.fetchList()}),1e3)}))},onClose(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},jump(){this.$router.push(`/trendDetails/${this.symbol}`)},changeTab(t){this.$emit("tab",t)}}},d=u,h=s(81656),p=(0,h.A)(d,i,a,!1,null,"5445f148",null),m=p.exports},14104:function(t,e,s){s.d(e,{A:function(){return d}});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=[],n=(s(28215),s(7587)),o=(s(44114),s(93068)),r={name:"perpetualEntrustList",components:{[n.A.name]:n.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,o.$$)(t).then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall",t)}))},recallAll(){(0,o.vc)().then((()=>{this.$toast(this.$t("撤单成功")),this.$emit("recall")}))}}},l=r,c=s(81656),u=(0,c.A)(l,i,a,!1,null,"1a03bf14",null),d=u.exports},16244:function(t,e,s){s.d(e,{A:function(){return p}});var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"position"},[t._l(t.listData,(function(e){return i("div",{key:e.order_no,staticClass:"position-padding"},[i("div",{staticClass:"position-tag "},[i("div",{staticClass:"position-tag-style",class:"buy"===e.direction?"green":"red"},[t._v(" "+t._s("buy"===e.direction?t.$t("开多"):t.$t("开空")))]),i("div",{staticClass:"position-tag-title textColor"},[t._v(t._s(e.name)+" "+t._s(t.$t("交割")))]),i("div",{staticClass:"position-tag-title2"},[t._v(t._s(t.$t("全仓")))]),i("img",{staticClass:"position-tag-img",attrs:{src:s(98477)}})]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("数量")))]),i("span",{staticClass:"position-text2 textColor"},[t._v(t._s(e.volume))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("方向")))]),i("span",{staticClass:"position-text2",class:"buy"===e.direction?"color-green":"color-red"},[t._v(" "+t._s("buy"===e.direction?t.$t("开多"):t.$t("开空")))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("交割时间")))]),i("span",{staticClass:"position-text2 textColor"},[t._v(t._s(e.time_num+e.time_unit))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("购买价"))+"(USDT)")]),i("span",{staticClass:"position-text2 textColor"},[t._v(t._s(e.open_price))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("结算价"))+"(USDT)")]),i("span",{staticClass:"position-text2 textColor"},[t._v(t._s(e.close_price))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("盈亏")))]),i("span",{staticClass:"position-text2",class:e.profit>0?"color-green":"color-red"},[t._v(" "+t._s(e.profit>0?"+"+e.profit:e.profit)+" ")])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("到期时间")))]),i("span",{staticClass:"position-text2 textColor"},[t._v(t._s(e.close_time))])]),i("div",{staticClass:"position-div1"},[i("span",{staticClass:"position-text1"},[t._v(t._s(t.$t("操作")))]),i("span",{staticClass:"position-text2 colorMain",on:{click:function(s){return t.onDetail(e)}}},[t._v(t._s(t.$t("详情")))])]),i("div",{staticClass:"bgDark",staticStyle:{"margin-top":"33px",width:"100%",height:"1px",float:"left"}})])})),t.listData.length||"perpetualContract"!=t.$route.name?t._e():i("div",{staticClass:"text-grey text-center py-300"},[t._v(t._s(t.$t("您目前没有持仓")))]),i("van-popup",{model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("popup-delivery",{key:t.detailData.order_no,attrs:{showBtns:"",detailData:t.detailData,disabled:!0},on:{close:function(e){t.show=!1}}})],1)],2)},a=[],n=(s(93093),s(75187)),o=(s(1751),s(26852)),r=(s(96356),s(162)),l=s(31022),c={data(){return{active:2,show:!1,detailData:{}}},props:{listData:{type:Array,default(){return[]}}},components:{[r.A.name]:r.A,[o.A.name]:o.A,[n.A.name]:n.A,PopupDelivery:l.A},methods:{onDetail(t){this.show=!0,this.detailData=t}}},u=c,d=s(81656),h=(0,d.A)(u,i,a,!1,null,"0c9fea0a",null),p=h.exports},86773:function(t,e,s){s.r(e),s.d(e,{default:function(){return st}});var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{key:t.symbol,staticClass:"pb-108 no_touch"},["wld"===t.symbol?s("ContractHeader",{attrs:{symbol:"FTB",range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}):"mln"===t.symbol?s("ContractHeader",{attrs:{symbol:"DKL",range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}):"qtum"===t.symbol?s("ContractHeader",{attrs:{symbol:"BQHN",range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}):"knc"===t.symbol?s("ContractHeader",{attrs:{symbol:"XCM",range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}):"vet"===t.symbol?s("ContractHeader",{attrs:{symbol:"ACG",range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}):s("ContractHeader",{attrs:{symbol:t.symbol,range:t.range,selectIndex:t.selectIndex,balance:t.userInfo.balance},on:{tab:t.onTopTab,"update-coin":t.onUpdate}}),1===t.selectIndex?s("div",{class:{slide2:t.animated1}},[s("div",{key:"x",staticClass:"mainBackground"},[s("PerpetualOpen",{key:t.keyIndex+"a",staticClass:"pl-30 pr-30",attrs:{selectIndex:t.selectIndex,symbol:t.symbol,"green-data":t.bids,"red-data":t.asks,price:t.price,"init-open":t.initOpen,"init-close":t.initClose,"init-futrue":t.initFutrue,currentType:t.currentType},on:{ordered:t.onOrdered,changeCurrentType:t.changeCurrentType,changeValueBack:t.changeValueBack}}),s("PerpetualOrder",{key:t.keyIndex+"b",staticClass:"pl-30 pr-30",attrs:{symbol:t.symbol,"order-cur":t.orderCur,"order-hold":t.orderHold,topIndex:t.selectIndex,"futrue-hold":t.futrueHold,"futrue-histroy":t.futrueHistroy},on:{tab:t.onTab,recall:t.onRecall}})],1)]):s("div",{class:{slide1:t.animated2}},[s("div",{key:"y",staticClass:"mainBackground"},[s("PerpetualOpen",{key:t.keyIndex+"c",staticClass:"pl-30 pr-30",attrs:{selectIndex:t.selectIndex,symbol:t.symbol,"green-data":t.bids,"red-data":t.asks,price:t.price,"init-open":t.initOpen,"init-close":t.initClose,"init-futrue":t.initFutrue},on:{ordered:t.onOrdered,changeValueBack:t.changeValueBack}}),s("div",{staticClass:"line"}),s("PerpetualOrder",{key:t.keyIndex+"d",staticClass:"pl-30 pr-30",attrs:{symbol:t.symbol,"order-cur":t.orderCur,"order-hold":t.orderHold,price:t.price,topIndex:t.selectIndex,"futrue-hold":t.futrueHold,"futrue-histroy":t.futrueHistroy},on:{tab:t.onTab,recall:t.onRecall}})],1)]),s("div",{staticClass:"fixed w-full shadow z-10 tabBackground1"},[s("div",{staticClass:"flex justify-between px-30 py-10"},["wld"===t.symbol?s("span",{staticClass:"font-24 textColor2"},[t._v("FTB/USDT "+t._s(t.$t("k线图表")))]):"mln"===t.symbol?s("span",{staticClass:"font-24 textColor2"},[t._v("DKL/USDT "+t._s(t.$t("k线图表")))]):"qtum"===t.symbol?s("span",{staticClass:"font-24 textColor2"},[t._v("BQHN/USDT "+t._s(t.$t("k线图表")))]):"knc"===t.symbol?s("span",{staticClass:"font-24 textColor2"},[t._v("XCM/USDT "+t._s(t.$t("k线图表")))]):"vet"===t.symbol?s("span",{staticClass:"font-24 textColor2"},[t._v("ACG/USDT "+t._s(t.$t("k线图表")))]):s("span",{staticClass:"font-24 textColor2"},[t._v(t._s(t.symbol.toUpperCase())+"/USDT "+t._s(t.$t("k线图表")))]),s("van-icon",{staticClass:"textColor",attrs:{name:t.showCharts?"arrow-down":"arrow-up"},on:{click:function(e){e.stopPropagation(),t.showCharts=!t.showCharts}}})],1),t.symbol&&t.showCharts?s("k-line-charts",{attrs:{"update-key":t.updateKey,"update-data":t.quote,symbol:t.symbol,showBottom:!1}}):t._e()],1)],1)},a=[],n=(s(83239),s(36749)),o=(s(36933),s(77235)),r=(s(93093),s(75187)),l=(s(44114),s(20550)),c=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"perpetual-open"},[i("div",{staticClass:"pt-30 pb-20"},[i("div",{staticClass:"flex"},[i("div",{staticClass:"mr-30"},[i("div",{staticClass:"w-290 flex justify-between newcolor1 font-22"},[i("div",[i("div",{},[t._v(t._s(t.$t("价格")))]),i("div",{staticClass:"mt-4"},[t._v("(USDT)")])]),i("div",{staticClass:"text-right items-end justify-end"},[i("div",{},[t._v(t._s(t.$t("数量")))]),i("div",{staticClass:"mt-4"},[t._v("("+t._s(t.symbol.toUpperCase()||"--")+")")])])]),t._l(t.greenData,(function(e,s){return 0==t.showType||1==t.showType?i("div",{key:s,staticClass:"w-290 flex justify-between pt-12 font-26",style:{background:"linear-gradient(to right,"+("dark"==t.theme?"#121212":"#ffffff")+" 0%"+100*(1-e.amount/t.greenData[t.greenData.length-1].amount)+"%,rgba(94,186,137,.1) "+100*(1-e.amount/t.greenData[t.greenData.length-1].amount)+"%,rgba(94,186,137,.1) 100%)"},on:{click:function(s){return t.onQuickPrice(e.price)}}},[i("div",{staticClass:"text-green"},[t._v(t._s(e.price))]),"shib"==t.symbol?i("div",{staticClass:"text-right textColor"},[t._v(" "+t._s(t.fixDate(e.amount,t.$i18n)||"--")+" ")]):i("div",{staticClass:"text-right textColor"},[t._v(" "+t._s(e.amount||"--")+" ")])]):t._e()})),0==t.showType||1==t.showType||2==t.showType?i("div",{staticClass:"w-290 mt-38 mb-38 text-red pt-12 font-34 font-700"},[t._v(" "+t._s(t.approximately||"--")+" ")]):t._e(),t._l(t.redData,(function(e,s){return 0==t.showType||2==t.showType?i("div",{key:e+s,staticClass:"w-290 flex justify-between pt-12 font-26",style:{background:"linear-gradient(to right,"+("dark"==t.theme?"#121212":"#ffffff")+" 0%"+100*(1-e.amount/t.greenData[t.greenData.length-1].amount)+"%,rgba(246,70,93,.1) "+100*(1-e.amount/t.greenData[t.greenData.length-1].amount)+"%,rgba(246,70,93,.1) 100%)"},on:{click:function(s){return t.onQuickPrice(e.price)}}},[i("div",{staticClass:"text-red"},[t._v(t._s(e.price))]),"shib"==t.symbol?i("div",{staticClass:"text-right textColor"},[t._v(" "+t._s(t.fixDate(e.amount,t.$i18n)||"--")+" ")]):i("div",{staticClass:"text-right textColor"},[t._v(" "+t._s(e.amount||"--")+" ")])]):t._e()}))],2),i("div",{staticClass:"w-440 flex flex-col"},[1==t.selectIndex?[i("div",{staticClass:"flex items-center h-66 rounded-lg text-grey"},[i("p",{staticClass:"font-28 flex-1 flex items-center justify-center h-66 long",class:"long"==t.currentType?"long":"",on:{click:function(e){return t.changeTab("long")}}},[t._v(" "+t._s(t.$t("开多"))+" ")]),i("p",{staticClass:"font-28 flex-1 ml-20 flex items-center justify-center h-66 short",class:"short"==t.currentType?"short":"",on:{click:function(e){return t.changeTab("short")}}},[t._v(" "+t._s(t.$t("开空"))+" ")])]),i("div",{staticClass:"mt-30 mb-30",staticStyle:{position:"relative"}},[i("div",{staticClass:"box-show flex justify-between items-center w-full h-76 rounded-lg textColor",on:{click:t.selectBtn}},[i("img",{staticClass:"w-25 h-25 pl-20",attrs:{src:s(92050),alt:"warn-icon"}}),i("div",{staticClass:"text-center",staticStyle:{width:"80%"}},[t._v(t._s(t.title))]),i("img",{staticClass:"w-22 h-11 pr-20",attrs:{src:s(5650),alt:"select-icon"}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.isShow,expression:"isShow"}],staticClass:"option-box"},t._l(t.selectData,(function(e){return i("div",{key:e.type,staticClass:"font-30",on:{click:function(s){return t.selectItem(e)}}},[t._v(" "+t._s(e.title)+" ")])})),0)])]:t._e(),2==t.selectIndex?i("contract-futrue",{staticClass:"mb-20",attrs:{initFutrue:t.initFutrue},on:{paraId:t.onParaId}}):t._e(),1==t.selectIndex?i("div",{staticClass:"h-76 lh-76 mb-30 flex pr-20 justify-center rounded-lg newcolor1 box-show"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.form.price,expression:"form.price"}],staticClass:"w-full pl-20 h-76 border-none text-left rounded-lg",attrs:{placeholder:"",disabled:t.type/1===1},domProps:{value:t.form.price},on:{focus:function(e){t.focus=!0},input:function(e){e.target.composing||t.$set(t.form,"price",e.target.value)}}}),i("span",{staticClass:"ml-20"},[t._v("USDT")])]):t._e(),i("div",{staticClass:"w-440 flex items-center box-show h-76 lh-76 rounded-lg"},[1==t.selectIndex?i("div",{staticClass:"w-80 flex items-center justify-center",staticStyle:{height:"100%"},on:{click:t.onReduce}},[i("img",{staticClass:"w-30 h-6",attrs:{src:s(64940),alt:"add"}})]):t._e(),i("input",{directives:[{name:"model",rawName:"v-model",value:t.form.amount,expression:"form.amount"}],staticClass:"border-none text-center newcolor1",staticStyle:{width:"156px"},attrs:{placeholder:1==t.selectIndex?t.$t("张数"):t.$t("最少")+t.initFutrue&&t.initFutrue.para?t.$t("最小金额")+t.initFutrue.para[t.paraIndex].buy_min:"",type:"number"},domProps:{value:t.form.amount},on:{input:[function(e){e.target.composing||t.$set(t.form,"amount",e.target.value)},t.onInput]}}),i("div",{staticClass:"w-80 flex items-center justify-center",staticStyle:{height:"100%"}},[1==t.selectIndex?[i("img",{staticClass:"w-30 h-30",attrs:{src:s(84929),alt:"reduce"},on:{click:t.onAdd}})]:[i("span",{staticClass:"textColor"},[t._v("USDT")])]],2)]),1==t.selectIndex?[i("div",{staticClass:"mt-50 w-full flex justify-between items-center"},[i("span",{staticClass:"font-22 font-400 newcolor1"},[t._v(t._s(t.$t("可开张数")))]),i("span",{staticClass:"font-22 font-400 newcolor1"},[t._v(" "+t._s(t.initData.volume)+" "+t._s(t.$t("张"))+" ")])]),i("amount-slider",{ref:"sliderRef",attrs:{maxAmount:t.getVolumnByLever()},on:{getAmount:t.getAmount}})]:t._e(),1==t.selectIndex&&t.userInfo.token?[i("div",{staticClass:"flex justify-between mt-30"},[i("div",{staticClass:"newcolor1"},[t._v(t._s(t.$t("合约金额")))]),i("div",{staticClass:"textColor"},[t._v(" "+t._s(t.initData.amount*(t.form.amount/1)*t.form.lever_rate)+" USDT ")])]),i("div",{staticClass:"flex justify-between mt-30"},[i("div",{staticClass:"newcolor1"},[t._v(t._s(t.$t("保证金")))]),i("div",{staticClass:"textColor"},[t._v(" "+t._s(t._f("nan")(t.initData.amount*(t.form.amount/1)))+" USDT ")])]),i("div",{staticClass:"flex justify-between mt-30"},[i("div",{staticClass:"newcolor1"},[t._v(t._s(t.$t("建仓手续费")))]),i("div",{staticClass:"textColor"},[t._v(" "+t._s(t._f("nan")("1"===t.userInfo.perpetual_contracts_status?t.initData.fee*(t.form.amount/1):t.initData.fee*(t.form.amount/1)*t.form.lever_rate))+" USDT ")])])]:t._e(),2==t.selectIndex?i("div",{staticClass:"flex font-24 text-grey justify-between mt-32"},[i("div",[t._v(t._s(t.$t("可用USDT")))]),i("div",{staticClass:"textColor"},[t._v(t._s(t._f("nan")(t.initFutrue.amount))+" USDT")])]):t._e(),2==t.selectIndex?i("div",{staticClass:"flex font-24 text-grey justify-between mt-20"},[i("div",[t._v(t._s(t.$t("手续费")))]),i("div",{staticClass:"textColor"},[t._v(" "+t._s(t._f("nan")((t.form.amount*(t.initFutrue&&t.initFutrue.para?t.initData.para[t.paraIndex].unit_fee:"")).toFixed(2)))+" USDT ")])]):t._e(),t.userInfo.token?[1==t.selectIndex?["long"==t.currentType?i("div",{staticClass:"w-full h-80 lh-80 bg-green flex text-white rounded-md mt-50",on:{click:function(e){return t.order("long")}}},[1==t.selectIndex?i("div",{staticClass:"font-34 relative text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("开多"))+" ")]):i("div",{staticClass:"font-34 relative text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("做多买入"))+" ")])]):t._e(),"short"==t.currentType?i("div",{staticClass:"w-full h-80 lh-80 bg-red flex text-white rounded-md mt-50",on:{click:function(e){return t.order("short")}}},[1==t.selectIndex?i("div",{staticClass:"relative font-34 text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("开空"))+" ")]):i("div",{staticClass:"relative font-34 text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("做空买入"))+" ")])]):t._e()]:t._e(),2==t.selectIndex?[t.userInfo.token?i("div",{staticClass:"w-full h-80 lh-80 bg-green flex text-white rounded-md mt-30",on:{click:function(e){return t.order("open")}}},[i("div",{staticClass:"font-34 relative text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("开多"))+" "),i("span",{staticClass:"right-word font-22 text-center"},[t._v(t._s(t.$t("看涨")))])])]):t._e(),t.userInfo.token?i("div",{staticClass:"w-full h-80 lh-80 bg-red flex text-white rounded-md mt-20 mb-10",class:{"mt-22":2==t.selectIndex},staticStyle:{position:"relative"},on:{click:function(e){return t.order("close")}}},[i("div",{staticClass:"relative font-34 text-center",staticStyle:{"flex-grow":"1"}},[t._v(" "+t._s(t.$t("开空"))+" "),i("span",{staticClass:"right-word font-22 text-center"},[t._v(t._s(t.$t("看跌")))])])]):t._e()]:t._e()]:i("div",{staticClass:"w-full mt-120"},[i("div",{staticClass:"textColor"},[i("p",[t._v(t._s(t.$t("套期保值,风险对冲")))]),i("p",{staticClass:"pt-8"},[t._v(t._s(t.$t("登陆后继续")))])]),i("div",{staticClass:"h-80 lh-80 btnBackground flex text-white rounded-md justify-center mt-50",on:{click:function(e){return t.$router.push("/login")}}},[t._v(" "+t._s(t.$t("登录后进行交易"))+" ")])])],2)])]),i("van-popup",{staticClass:"rounded-2xl",model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("popup-delivery",{key:t.detailData.order_no,attrs:{showBtns:"",detailData:t.detailData,price:t.price},on:{close:t.onClose,continueToBuy:t.continueTobuy,timeEnd:t.handleTimeEnd}})],1),i("van-action-sheet",{attrs:{actions:t.actions,"cancel-text":t.$t("取消"),"close-on-click-action":""},on:{select:t.onSelect,cancel:t.onCancel},model:{value:t.isSelectShow,callback:function(e){t.isSelectShow=e},expression:"isSelectShow"}})],1)},u=[],d=(s(47283),s(36647)),h=s(34642),p=s(93518),m=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"slider-index"},[s("div",{staticClass:"amount-slider"},[s("div",{staticClass:"amount-slider-clickable"},[s("vue-slider",{staticClass:"mainBox",attrs:{marks:t.marks,"hide-label":!0,width:"92%",tooltip:"hover","tooltip-formatter":"{value}%",railStyle:{background:"#404040",height:"2px"},processStyle:{background:"#266BFF",height:"2px"}},on:{change:t.sliderAmountChange},scopedSlots:t._u([{key:"step",fn:function(t){var e=t.active;return[s("div",{class:["custom-step",{active:e}]})]}}]),model:{value:t.sliderAmount,callback:function(e){t.sliderAmount=e},expression:"sliderAmount"}})],1),t._m(0)])])},f=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"poecs"},[s("span",[t._v("0%")]),s("span",{staticClass:"lins"},[t._v("25%")]),s("span",{staticClass:"lins"},[t._v("50%")]),s("span",{staticClass:"lins"},[t._v("75%")]),s("span",{staticClass:"lins"},[t._v("100%")])])}],v=s(43281),y=s.n(v),x=s(94348),C={name:"amountSlider",components:{VueSlider:y()},props:{maxAmount:{type:Number,default:0}},data(){return{amount:void 0,sliderAmount:"",marks:t=>t%25===0}},computed:{...(0,p.L8)(["existToken"])},methods:{inputChange(t){this.$emit("getAmount",t)},cleanAmount(){this.amount=void 0},sliderAmountChange(t){let e;if(x.log("滑块的值",t,this.maxAmount),this.maxAmount){if(0==t)this.amount=void 0;else{const s=t/100;e=this.maxAmount*s,this.amount=parseInt(e)}this.$emit("getAmount",this.amount)}},amountChange(t){this.sliderAmount=(t/this.maxAmount*100).toFixed(2)},emptyValue(){this.sliderAmount=""}}},b=C,_=s(81656),g=(0,_.A)(b,m,f,!1,null,"8f83cc02",null),A=g.exports,w=s(93068),k=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"contact-futrue box-show"},[s("div",{staticClass:"font-24 text-grey mb-24"},[t._v(t._s(t.$t("交割时间")))]),s("ul",{staticClass:"flex flex-wrap w-full"},t._l(t.initFutrue.para,(function(e,i){return s("li",{key:e.para_id,staticClass:"h-92 flex items-center mb-22",on:{click:function(s){return t.onSelect(e,i)}}},[s("p",{staticClass:"w-95 h-full flex justify-center items-center font-22 flex-1",class:t.active===e.para_id?"bg-light-blue text-white":"bgDark textColor"},[t._v(" "+t._s(e.time_num+e.time_unit.substr(0,1))+" ")]),s("p",{staticClass:"w-125 h-full flex justify-center items-center font-22 flex-1",class:t.active===e.para_id?"bg-dark-blue text-white":"contBackground textColor"},[t._v(" "+t._s(e.profit_ratio)+"% ")])])})),0)])},I=[],T={name:"ContractFutrue",props:{initFutrue:{type:Object,default(){return{}}}},data(){return{active:"",initParam:[]}},created(){this.active=this.initFutrue&&this.initFutrue.para?this.initFutrue.para[0].para_id:"",this.$emit("paraId",{id:this.active,index:0})},methods:{onSelect(t,e){this.active=t.para_id,this.$emit("paraId",{id:this.active,index:e})}}},S=T,$=(0,_.A)(S,k,I,!1,null,"13c07110",null),D=$.exports,O=s(31022),B=s(23808),H=s(45313),E=s(94348),U={name:"perpetualPosition",components:{AmountSlider:A,ContractFutrue:D,[r.A.name]:r.A,PopupDelivery:O.A,[d.A.name]:d.A},props:{greenData:{type:Array,default(){return[]}},redData:{type:Array,default(){return[]}},symbol:{type:String,default:""},price:{type:[Number,String],default:"0.00"},initOpen:{type:Object,default(){return{}}},initClose:{type:Object,default(){return{}}},initFutrue:{type:Object,default(){return{}}},selectIndex:{type:[String,Number],default:1},currentType:{type:String,default:"long"}},watch:{price(t){"1"===this.type&&(this.form.price=t),this.form.para_id=this.initFutrue.para&&this.initFutrue.para[this.paraIndex].para_id},initOpen:{deep:!0,handler(t){this.handleInitSliderOption()}},initClose:{deep:!0,handler(t,e){t.amount/1>0&&this.handleInitSliderOption(!0)}},symbol(t){this.getHomeList(t)},greenData(t){this.dataArrValue>=1?(this.greenData.map((t=>{t.price=parseFloat(t.price).toFixed(this.dataArrValue)})),this.redData.map((t=>{t.price=parseFloat(t.price).toFixed(this.dataArrValue)}))):(-1==this.dataArrValue&&(this.greenData.map((t=>{t.price=t.price.substring(0,t.price.indexOf("."))})),this.redData.map((t=>{t.price=t.price.substring(0,t.price.indexOf("."))}))),-2==this.dataArrValue&&(this.greenData.map((t=>{t.price=t.price.substring(0,t.price.indexOf(".")-1)+"0"})),this.redData.map((t=>{t.price=t.price.substring(0,t.price.indexOf(".")-1)+"0"}))),-3==this.dataArrValue&&(this.greenData.map((t=>{t.price=t.price.substring(0,t.price.indexOf(".")-2)+"00"})),this.redData.map((t=>{t.price=t.price.substring(0,t.price.indexOf(".")-2)+"00"})))),this.approximately=this.redData[0].price}},mounted(){this.getHomeList(this.$route.params.symbol),setInterval((()=>{-1==location.href.indexOf("#reloaded")&&location.href.indexOf("perpetualContract")>0&&(location.href=location.href+"#reloaded",location.reload())}),1e3)},computed:{...(0,p.L8)({userInfo:"user/userInfo",theme:"home/theme"}),initData(){let t=null;return this.selectIndex/1===1?(t=this.initOpen,t.lever&&t.lever.length||(t.lever=[{id:1,lever_rate:1}]),t):this.initFutrue},coudBuyVolume(){return Math.floor(this.initOpen.volume/1/this.form.lever_rate)}},filters:{nan(t){return isNaN(t)?"--":t}},data(){return{fixDate:B._G,currentBuyType:"",timeout2:null,timeout:null,detailData:{},show:!1,popType:"confirm",showOptions:!1,options:h.Ay.sliderOptions,value:0,isShow:!1,title:this.$t("市价"),paraIndex:0,selectData:[{title:this.$t("市价"),type:"1"},{title:this.$t("限价"),type:"2"}],form:{symbol:"",session_token:"",direction:"buy",price_type:"opponent",lever_rate:1,stop_price_profit:"",stop_price_loss:"",price:"",amount:"",para_id:""},focus:!1,type:"1",isShow:!1,selectDataArry:[],isSelectShow:!1,actions:[{name:this.$t("默认"),value:0,className:"actions-active"},{name:this.$t("展示买单"),value:1,className:""},{name:this.$t("展示卖单"),value:2,className:""}],showType:0,dataArrTitle:0,dataArrValue:0,arryIsShow:!1,marks:t=>t%50===0,approximately:""}},beforeDestroy(){this.clearTimeout()},activated(){this.selectData=[{title:this.$t("市价"),type:"1"},{title:this.$t("限价"),type:"2"}],this.title=this.selectData[0].title,this.type=this.selectData[0].type},methods:{getAmount(t){this.form.amount=t},getVolumnByLever(){let t;return t=this.initOpen.volume/1,Math.floor(t)},getHomeList(t){(0,H.RK)(t).then((t=>{let e=t[0].close,s=e.substring(e.indexOf(".")+1,e.length).length,i=[],a="0.";for(let r=0;r<s-1;r++)a+="0",i.push(a);let n=[];if(i.map((t=>{let e={name:t+"1",value:t.substring(t.indexOf(".")+1,t.length).length+1};n.push(e)})),s<=2){let t=[{name:"0.1",value:1},{name:"1",value:-1},{name:"10",value:-2}],s={name:"100",value:-3};e.substring(0,e.indexOf(".")).length>2&&t.push(s),n=n.concat(t)}"shib"==this.symbol&&(n=n.slice(-4));let o={arry:n,numberLength:s};this.selectDataArry=o.arry,this.dataArrTitle=s>=2?this.selectDataArry[0].name:this.selectDataArry[this.selectDataArry.length-1].name}))},continueTobuy(t){this.show=!1,setTimeout((()=>{this.$router.push(`/trendDetails/${t.symbol}?direction=${t.direction}`)}),300)},onQuickPrice(t){"2"===this.type&&(this.form.price=t)},clearTimeout(){clearTimeout(this.timeout),this.timeout=null},handleTimeEnd(t){this.selectIndex/1===2&&(0,w.ob)(t).then((e=>{this.clearTimeout(),this.detailData=e,"created"!==e.state&&(this.timeout=setTimeout((()=>{this.handleTimeEnd(t)}),1e3))}))},handleInitSliderOption(t){let e;t||(this.form.amount=""),E.log(this.initOpen.volume,this.form.lever_rate),e=this.initOpen.volume/1,this.options.max=Math.floor(e),E.log("this.options.max",this.options.max),this.options.max>0?this.options.disabled=!1:this.options.disabled=!0},handleChoose(t){this.showOptions=!this.showOptions,this.form.lever_rate=t.lever_rate,E.log("handleChoose"),this.handleInitSliderOption()},onAdd(){0!==this.options.max&&this.form.amount!==this.options.max&&(E.log(this.options.max),this.form.amount++)},onReduce(){this.form.amount>1&&this.form.amount--},jump(){this.$router.push(`/trendDetails/${this.symbol}`)},onParaId({id:t,index:e}){this.form.para_id=t,this.form.amount="",this.paraIndex=e},onInput(){1==this.selectIndex&&0==this.options.max?this.form.amount=this.form.amount/1:1==this.selectIndex&&this.form.amount/1>this.options.max/1&&(this.form.amount=this.options.max/1),this.selectIndex/1===1&&this.$refs.sliderRef.amountChange(this.form.amount)},selectBtn(){this.isShow=!this.isShow},selectItem(t){1==t.type&&(this.form.price=this.price),this.form.price_type="1"===t.type?"opponent":"limit",this.title=t.title,this.type=t.type,this.isShow=!1},changeTab(t){E.log("changeTab",t),this.currentType!==t&&(this.$emit("changeCurrentType",t),this.$refs.sliderRef.emptyValue(),this.handleInitSliderOption())},onClose(){this.show=!1,setTimeout((()=>{this.popType="confirm"}),500)},order(t){if(!this.userInfo.token)return this.$router.push("/login"),!1;if(!this.form.amount)return void(1==this.selectIndex?this.$toast.fail(this.$t("请输入合约张数")):this.$toast.fail(this.$t("请输入金额")));this.form.symbol=this.$route.params.symbol,this.form.direction="long"==t||"open"==t?"buy":"sell";let e=null,s=null;this.selectIndex/1===1?(this.form.session_token=this.initOpen.session_token,e=w.Sr,s=this.currentType,this.openOrder(e,s)):(this.form.session_token=this.initFutrue.session_token,e=w.rH,s="futrue",void 0==this.initFutrue.session_token||""==this.initFutrue.session_token?(0,w.ZL)(this.symbol).then((t=>{this.form.session_token=t.session_token,this.openOrder(e,s)})).catch((t=>{"ECONNABORTED"==t.code?this.$toast(this.$t("网络超时!")):void 0!=t.msg&&this.$toast(this.$t(t.msg))})):(this.form.session_token=this.initFutrue.session_token,this.openOrder(e,s)))},openOrder(t,e){t(this.form).then((t=>{this.selectIndex/1===1&&this.$refs.sliderRef.emptyValue(),this.$toast(this.$t("操作成功")),(0,w.Ie)().then((t=>{this.$store.commit("user/SET_USERINFO",{balance:t.money})})),this.$emit("ordered",e),this.selectIndex/1===2&&(0,w.ob)(t.order_no).then((t=>{this.detailData=t,this.show=!0}))})).catch((()=>{this.$emit("ordered",e),this.selectIndex/1===1&&this.$refs.sliderRef.emptyValue()}))},selectBtn(){this.isShow=!this.isShow},selectArryBtn(){this.arryIsShow=!this.arryIsShow},onSelect(t){this.actions.map((t=>{t.className=""})),t.className="actions-active",this.showType=t.value,this.$emit("changeValueBack",this.showType)},onCancel(){this.isSelectShow=!1},selectItemArry(t){this.dataArrValue=t.value,this.arryIsShow=!1,this.dataArrTitle=t.name}}},L=U,F=(0,_.A)(L,c,u,!1,null,"eff08eda",null),R=F.exports,N=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"items-center mt-18 box-show"},[i("div",{staticClass:"flex justify-between pt-20"},[i("div",{staticClass:"flex pb-10 ml-30"},[t.topIndex/1===1?[i("div",{staticClass:"px-10 py-10 flex items-center",class:"1"==t.type?"active-line":"newcolor1",on:{click:function(e){return t.tabClick("1")}}},[t._v(" "+t._s(t.$t("持有仓位"))),"1"==t.type?i("span",[t._v("("+t._s(t.orderHold.length)+")")]):t._e()]),i("div",{staticClass:"px-10 ml-50 py-10 flex items-center",class:"2"==t.type?"active-line":"newcolor1",on:{click:function(e){return t.tabClick("2")}}},[t._v(" "+t._s(t.$t("当前委托"))+" ")])]:[i("div",{staticClass:"px-10 py-10 flex items-center text-grey",class:"3"==t.type?"active-line":"",on:{click:function(e){return t.tabClick("3")}}},[t._v(" "+t._s(t.$t("持有仓位"))),"2"==t.type?i("span",[t._v("("+t._s(t.orderCur.length)+")")]):t._e()]),i("div",{staticClass:"px-10 ml-50 py-10 flex items-center text-grey",class:"4"==t.type?"active-line":"",on:{click:function(e){return t.tabClick("4")}}},[t._v(" "+t._s(t.$t("历史仓位"))+" ")])]],2),i("img",{staticClass:"w-32 h-35 pr-30 py-15",attrs:{src:s(60221),alt:"record-img"},on:{click:t.goHistory}})]),t.topIndex/1===1?["1"==t.type?i("div",[i("PerpetualPositionList",{attrs:{"list-data":t.orderHold},on:{sell:function(e){return t.$emit("recall",e)}}})],1):t._e(),"2"==t.type?i("div",[i("PerpetualEntrustList",{attrs:{"list-data":t.orderCur},on:{recall:function(e){return t.$emit("recall",e)}}})],1):t._e()]:["3"==t.type?i("div",[i("futrue-hold-list",{attrs:{price:t.price,"list-data":t.futrueHold}})],1):t._e(),"4"==t.type?i("div",[i("futrue-histroy-position",{attrs:{"list-data":t.futrueHistroy}})],1):t._e()]],2)])},P=[],V=s(14104),Q=s(45484),j=s(18191),q=s(16244),W={name:"perpetualOrder",data(){return{type:"1"}},props:{topIndex:{type:[Number,String],default:1},symbol:{type:String,default:""},orderCur:{type:Array,default(){return[]}},orderHold:{type:Array,default(){return[]}},futrueHold:{type:Array,default(){return[]}},futrueHistroy:{type:Array,default(){return[]}},price:{type:[Number,String],default:"0.00"}},watch:{topIndex(t){t/1===1?(this.type="1",this.tabClick("1")):(this.type="3",this.tabClick("3"))}},mounted(){1==this.topIndex?(this.type="1",this.tabClick("1")):(this.type="3",this.tabClick("3"))},activated(){1==this.topIndex?(this.type="1",this.tabClick("1")):(this.type="3",this.tabClick("3"))},methods:{tabClick(t){this.type=t,"1"==t&&this.$emit("tab","fetchOrderListHold"),"2"===t&&this.$emit("tab","fetchOrderListCur"),"3"===t&&this.$emit("tab","fetchFutrueHoldList"),"4"===t&&this.$emit("tab","fetchFutrueHistory")},goHistory(){const t=this.topIndex/1===1?"perpetualHistory":"deliveryContractHistory";this.$router.push({path:`/${t}?symbol=${this.symbol}`})}},components:{PerpetualEntrustList:V.A,PerpetualPositionList:Q.A,futrueHistroyPosition:q.A,futrueHoldList:j.A}},X=W,K=(0,_.A)(X,N,P,!1,null,"26dcb9ee",null),M=K.exports,Y=s(54401),Z=s(19246),G=s(94348),J=7,z={name:"perpetualContract",components:{ContractHeader:l.A,PerpetualOpen:R,PerpetualOrder:M,[r.A.name]:r.A,[o.A.name]:o.A,[n.A.name]:n.A,KLineCharts:Z.A},computed:{...(0,p.L8)("user",["userInfo"]),...(0,p.L8)({coinList:"home/coinList"})},watch:{selectIndex(t){J=7}},data(){const t=[];for(let e=0;e<J;e++)t.push({amount:"--",price:"--"});return{quote:{},initTimer:null,keyIndex:0,timeout:null,timer:null,timer1:null,timer2:null,balance:0,symbol:"",price:"",range:"",stop_price_profit:"",stop_price_loss:"",initOpen:{},initClose:{},asks:t,bids:t,orderCur:[],orderHold:[],futrueHold:[],futrueHistroy:[],sockets:{quotes:null,deep:null},curTab:"",selectIndex:1,initFutrue:{},show:!1,animated1:!1,animated2:!1,currentType:"",showCharts:!1}},async created(){this.coinList.length||await this.SET_COIN_LIST(),(0,w.Ie)().then((t=>{this.$store.commit("user/SET_USERINFO",{balance:t.money})}))},methods:{...(0,p.i0)("home",[Y.ON]),onUpdate(t){this.symbol=t,this.closeSocket(),this.init(t)},onRecall(){this.clearTimer(),(0,w.RX)(this.symbol).then((t=>{this.orderHold=t})),this[this.curTab](this.symbol),(0,w.u0)(this.symbol).then((t=>{this.initOpen=t}))},onTopTab(t){this.keyIndex+=1,this.selectIndex=t,this.clearTimer(),this.selectIndex/1===1?(this.curTab="fetchOrderListHold",this.animated2=!0,this.timer1=setTimeout((()=>{this.animated2=!1,clearTimeout(this.timer1)}),200)):(this.animated1=!0,this.timer1=setTimeout((()=>{this.animated1=!1,clearTimeout(this.timer1)}),200)),G.log(this.curTab),this[this.curTab](this.symbol)},onOrdered(t){this.clearTimer(),this.initParam(this.symbol,t),this.selectIndex/1===1?(this[this.curTab](this.symbol),G.log("this.curTab",this.curTab)):(this[this.curTab](this.symbol),G.log("curTab",t,this.curTab))},onTab(t){G.log("evt",t),this.clearTimer(),this.curTab=t,this[t](this.symbol)},fetchQoutes(t){(0,H.RK)(t).then((t=>{this.handleQoutes(t),this.startQuoteSocket()}))},handleQoutes(t){if(t&&t.length){const e=t[0];this.price=e.close,this.range=e.change_ratio+"",this.quote=e,this.updateKey++}},fetchDeepData(t){G.log("sd"),(0,w.YT)(t).then((t=>{G.log(t),this.handleDeep(t),this.startDeepSocket()}))},handleDeep(t){this.deepData=t;const{asks:e,bids:s}=t;this.asks=e.sort(((t,e)=>t.price-e.price)).slice(0,J),this.bids=s.sort(((t,e)=>t.price-e.price)).slice(-J)},startQuoteSocket(){this.sockets.quotes=new WebSocket(`${h.ZW}/1/${this.symbol}`),this.sockets.quotes.onmessage=t=>{const{data:e}=t,{code:s,data:i}=JSON.parse(e);s/1===0&&this.handleQoutes(i)}},startDeepSocket(){this.sockets.deep=new WebSocket(`${h.ZW}/3/${this.symbol}`),this.sockets.deep.onmessage=t=>{const{data:e}=t,{code:s,data:i}=JSON.parse(e);s/1===0&&this.handleDeep(i)}},initParam(t,e){if("open"===e||"long"===e||"short"===e||!e){let e=null,s=()=>{(0,w.u0)(t).then((t=>{this.initOpen=t,clearTimeout(e),e=null})).catch((t=>{e=setTimeout((()=>{s()}),3e3)}))};s()}if("close"===e||!e){let e=null,s=()=>{(0,w.Oq)(t).then((t=>{this.initClose=t,G.log(this.initClose),clearTimeout(e),e=null})).catch((t=>{e=setTimeout((()=>{s()}),3e3)}))};e=setTimeout((()=>{s()}),600)}"futrue"!==e&&e||(0,w.ZL)(t).then((t=>{this.initFutrue=t}))},fetchOrderListCur(t){this.userInfo.token?((0,w.g3)(t).then((t=>{this.orderCur=t})),this.clearTimer(),this.timer=setInterval((()=>{(0,w.g3)(t).then((t=>{this.orderCur=t}))}),1e3)):this.orderCur=[]},fetchOrderListHold(t){this.userInfo.token?((0,w.RX)(t).then((t=>{this.orderHold=t.sort(this.sortData)})),this.timer=setInterval((()=>{(0,w.RX)(t).then((t=>{this.orderHold=t.sort(this.sortData)}))}),1e3)):this.orderHold=[]},fetchFutrueHoldList(t){if(this.userInfo.token){let e=0;(0,w.n1)(t).then((t=>{this.futrueHold=t.sort(this.sortData),e=t.length})),this.timer=setInterval((()=>{(0,w.n1)(t).then((s=>{this.futrueHold=s.sort(this.sortData),e!=s.length&&(e=s.length,(0,w.ZL)(t).then((t=>{this.initFutrue=t})))}))}),1e3)}else this.futrueHold=[]},fetchFutrueHistory(t){(0,w.n1)(t,"hisorders").then((t=>{this.futrueHistroy=t}))},init(t){this.symbol=t.toLowerCase(),this.fetchQoutes(t),this.fetchDeepData(t),this.initParam(t),this.clearTimer(),"fetchOrderListHold"===this.curTab?this.fetchOrderListHold(t):this.fetchFutrueHoldList(t)},closeSocket(){this.sockets.quotes&&this.sockets.quotes.close(),this.sockets.deep&&this.sockets.deep.close(),this.sockets.quotes=null,this.sockets.deep=null},clearTimer(){clearInterval(this.timer),this.timer=null},changeCurrentType(t){this.currentType=t},changeValueBack(t){J=0==t?7:13},sortData(t,e){return new Date(e.open_time).getTime()-new Date(t.open_time).getTime()}},mounted(){let t=this.$route.params.symbol,e=(0,B.c7)("symbol");!t&&e&&(t=e),this.selectIndex/1===2?this.curTab="fetchFutrueHoldList":this.curTab="fetchOrderListHold",this.symbol=t,this.init(t)},activated(){let t=this.$route.params.symbol,e=(0,B.c7)("symbol");!t&&e&&(t=e),this.selectIndex/1===2?this.curTab="fetchFutrueHoldList":this.curTab="fetchOrderListHold",this.symbol=t,this.init(t)},deactivated(){this.closeSocket(),this.clearTimer()},activated(){this.currentType=this.$route.query.currentType?this.$route.query.currentType:"long"},beforeDestroy(){this.closeSocket(),this.clearTimer()}},tt=z,et=(0,_.A)(tt,i,a,!1,null,"dbb84556",null),st=et.exports},98477:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA/CAYAAAB3s08iAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAARQSURBVHgB7ZzNbttGEIBnl46KXhq9QXVsi6aVfwHfxKpN0ZPtJ7DzCD42tiEJqdBj4yeo+gR2TgXSGmauNmyzVtD2yLyBnUsQktrJLB0ZtkJyV15DSIL5LoK0q9mdj/8LDAVcob7fqiqorAoFdf0dpQpO/a0/YEzqfz1qKCmWBIgqAp5JmWyHfieCMan//WgZhVwazkVC+mzcOCcnJ9XBYLCqw739KZibmxs7p8PDw4aUcgkRq0KIsziOtxcXFyNxOdn9bl2h2AHE2rV/CgiliH2a+JnNQN/sddv00cpp6pw2N9pggd6QiJUdRGiMzCVKU1j59/5GaBPn4OCg7nkexRnJCSCk3/3p6WmrnEhem6S9kxPF7cjhl1x5WS+oD1Tld7Dg3l53DfLlaVpf054JFqCq/PaOvIu51KY82NeCLcJAgTxNnfZKq5yOjo7W8uRp9O+ZwCzx/IEuOgIs20xaClgtaxeebIGBbO8DWCvpUlWDSuk4Gp04luRELOvDGwxQjNKxMoEC8HMwMMBPvjX1QRS1snaBl+ehYtIpYx8hlDkOgDEnkmPMifayWlm7hMlidejdEjWYAJMW+NHBAh1hgY6wQEdYoCMs0BEW6AgLdIQFOsICHWGBjrBAR1igIyzQERboCAt0hAU6wgIdYYGOsEBHWKAjLNARFugIC3SEBTrCAh1hgY6wQEdYoCMs0BEW6AgLdIQFOsICHWGBjrBAR1igIyzQkUkLtCqt+pDGuhCIwjjYIMVzUx8UGJV3gPJ2zdSUsQ+iDM19DHMh0jQ152SIkwmUXqyrF4slIoRWBX4pGKog1WMwEPo/RyggKOsTJ/ETMOB5XnlONNTCwoIxJyFEaU6ZwKwSU2GnoE9EE14BC/r3N3qI+QPSlgxOv7crnU1eywc09SivTQG2///JXPKqKzF1NWVBc5QkiVVOs7OzPfoomncgrn776mm37kloCfG2XhhwN4mTbZsJX+Xe0+4aSFzVdWb6ENB71PPmZmecGF/8+WvtTkW1svo6AdXsUJKy3f/u4bNx4uiSVykl5SSG9XW7w1rfMcIMixcvc6LPgOSOlRPDMMzHxrWLyPv90gkIJcRP+KUTFvBLJ/Lhl06AAX7pRAn80ol8rBcTboXbWkwoeMy71gdxcqsxCtU/hn6R3SOU6pW10iOd8eSvFxPAIIiuzAEYIIHGnGZmZmweC3tljZnA5z9sBbRVC1dKMFXrYIG+XSlJPkri2OrZUanBg6I2ui16bLMx5+fnAzr8ylZ/LHOS2xQnKmiOLq/C/ebDdb3ScU0AYohCNPo/bu2CBfpWJ46FjyNbTa/E0H2Tb7sooTeoUsof2Rhnen795qZV4hp62F+n5NsjAkKS0qB7Qauc9K0O9fcpRm+kKaAVHV/k/enLvV+yE/B/zc0XcENqO63qp5/dufvqZXIerXRufD4axnGZi+b4+DjLiQ7bG8fRV23aGe6SzPPhPeQb70ddwJOcZxgAAAAASUVORK5CYII="},84929:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACASURBVHgB7ZahEYVAEEOT+xT2O+EwNIBEI9HMYKAVCuOWA4FAsRgEeSpm583EZIkHdP0Qab9pz0ZUbVPPcBLwEhJLLLHEEt+GXT9GOGGyP8jyyIY5BSxwUuTDCV7IM+Z1ykuFCB/2WtWFca3ghClcql7dVRMP0CMgscQSS/wN8QYdniQIJU1kwAAAAABJRU5ErkJggg=="},64940:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAECAYAAACZfY9fAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAArSURBVHgBxcAxEQAgDAPABCoUlCGDiQVfvdRF87zvLxgENQ/6acAkxNwwKEKVB6HicS8dAAAAAElFTkSuQmCC"},92050:function(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIYSURBVHgBtZVLSxtRFMfPOZlJCqUlbrpoKZi6ENxU2l0XGpIv0E9QLPRBKbRGaBdm0ekiCooGFyLiwscn0C+gUXCpZicuNAEfoAsVHwuNmeOZm8wYHzMZxfnBJPfeyfz/c3IffwQPjOx4VDdLH6XZjshxYIxK27qkCXliyDNSrrvry6SXDrqJh/niNzB32qJ1KALiRHfX1/++THqzI41s0pzcaoT7UzincsJI/Si6mmSyw61o6mLg6+3dOOAyJNJ/v+VvmVQqCK24GbR9eA9NsddOf724CQuLS65GUtE7uyKyRyt/kXsFkYgOz589da5IWAcPGsJmaNaaW8ekZ3Ds3wPnwIuYfnHe6ZhIGR0QAEj4y6pGywyMdPipYnWtANs7e07/6PgEfKD2mYZM8bt3y3W2dnbhAVjKbZp8v/Xz65bmN/Dq5Ysa0z2pbqPuc+IS1+SzFXxgGbQ0N10b82MiRAmCR5kcQsAQIAdrIic1gQnzECCoIgHNHAQHW3lDJXoyDcHNS1ECbYqM1OdDNnkIHh8WXZWYagmn/3w3ZKwAj0tBdFVSavYIkpmQPFmWZsNdT5ydleS8Oq2+Iqu+B/uSJ0lHu/ZOpk+SMaTPuhn5ZJ+plEynft5ORptqxosRxuB+MFQyPumZ8bVk+kcNJPhUjQGsI64Wjz0HN6l7yFt5I3HQrk7rq8NUljyLMOaAyvOyDWasVeqmcQkj/siI2HVcNgAAAABJRU5ErkJggg=="}}]);
|