webpackJsonp([72],{"6y0P":function(e,t){},J8Wy:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("woOf"),a=i.n(s),r=i("wQWh"),n={name:"diagram",components:{},data:function(){return{show:!0,headername:{from_coin:"BTC",to_coin:"USDT"},header:{price:0,change_percentage:0,high_price:0,volume_24h_base:0,low_price:0,volume_24h_settle:0},curTime:"1小时",interval:"1",limit:200,time:["1","2","4","5","6","8","9","10"],TimeList:[{name:"1分"},{name:"5分"},{name:"30分"},{name:"1小时"},{name:"2小时"},{name:"1天"},{name:"1周"},{name:"1月"}],inter:null,rawDate:[],chart:null,candlestickSeries:null,volumeSeries:null,lineSeries:null,asks:[],bids:[],widith:375,collect:!1}},mounted:function(){window.scrollTo(0,0),this.headername=JSON.parse(this.$route.query.itemDetails),r.e.room=this.headername.from_coin+this.headername.to_coin,null==this.socketApi.wsConnectionOrder.$wsOrder?this.socketApi.wsConnectionOrder.initWebSocket():this.socketApi.wsConnectionOrder.wsSend();var e=0;e=window.innerWidth>750?750:window.innerWidth,this.widith=e,this.installadd()},computed:{getWsMsg:function(){return this.$store.state.orderWebSocketMsg}},watch:{getWsMsg:function(e){if("PONG"!=e.data){var t=e.data,i=JSON.parse(t);if(i.room===this.headername.from_coin+this.headername.to_coin){this.header=i.data;var s=i.data.depth.bids,a=i.data.depth.asks;this.dovkrtjson(s,a)}}}},destroyed:function(){this.inter&&clearInterval(this.inter)},methods:{blod:function(e){var t=e.split("."),i=t[1].length;return i<=2?'
'+t[0]+'.'+t[1]+"
":''+t[0]+"."+t[1].substring(0,i-3)+''+t[1].substring(i-3,i-1)+""+t[1].charAt(i-1)+"
"},dovkrtjson:function(e,t){var i=[],s=[];e.map(function(e){i.push(e.s)}),t.map(function(e){s.push(e.s)});var r=Math.max.apply(null,i),n=Math.max.apply(null,s),o=[],l=[];e.forEach(function(e){var t=e.s/r*100;o.push(a()({},e,{percentage:t}))}),t.forEach(function(e){var t=e.s/n*100;l.push(a()({},e,{percentage:t}))}),this.asks=o,this.bids=l},futurepublic:function(){var e=this,t={from_coin:this.headername.from_coin};this.$api.quotation.futuresglobal(t).then(function(t){e.collect=t.data.is_like})},setIntervalInstall:function(){var e=this;e.install(),this.inter&&clearInterval(this.inter),this.inter=setInterval(function(){e.install()},2e3)},install:function(){var e=this;this.rawDate=[];var t={symbol:this.headername.from_coin+this.headername.to_coin,interval:this.interval,limit:this.limit};this.$api.quotation.forex(t).then(function(t){var i=[],s=[];t.data.kline_list.forEach(function(e){var t=[],a={},r={},n=1e3*Number(e.timestamp);n+=288e5,t.time=n/1e3,t.open=Number(e.open_price),t.high=Number(e.high_price),t.low=Number(e.low_price),t.close=Number(e.close_price),a.time=n/1e3,a.value=Number(e.volume),r.time=n/1e3,r.value=Number(e.volume),a.color="rgba(0, 150, 136, 0.8)",s.push(a),i.push(t)}),e.add(i,s)})},clTime:function(e,t){var i=this;this.time.forEach(function(e,s){s==t&&(i.interval=e)}),this.curTime=e.name,this.setIntervalInstall()},installadd:function(){var e=this,t=LightweightCharts.createChart(this.$refs.echartContainer,{width:this.widith,height:300,upColor:"#6495ED",downColor:"#FF6347",borderVisible:!1,wickVisible:!0,borderColor:"#121520",wickColor:"#121520",borderUpColor:"#4682B4",borderDownColor:"#A52A2A",wickUpColor:"#4682B4",wickDownColor:"#A52A2A",localization:{locale:"en-US",dateFormat:"yyyy/MM/dd"},layout:{backgroundColor:"#121520",textColor:"#6e86a8",vertLine:{color:"#121520"},horzLine:{color:"#131f30"},scaleMargins:{top:.3,bottom:.25}},grid:{vertLines:{color:"#131f30",style:1,visible:!0},horzLines:{color:"#131f30",style:1,visible:!0}},crosshair:{mode:LightweightCharts.CrosshairMode.Normal}});t.applyOptions({timeScale:{borderVisible:!1,timeVisible:!0}}),this.chart=t,this.candlestickSeries=t.addCandlestickSeries(),this.volumeSeries=t.addHistogramSeries({color:"#26a69a",priceFormat:{type:"volume"},priceScaleId:"",scaleMargins:{top:.8,bottom:0}}),this.lineSeries=t.addLineSeries({color:"#f48fb1",lineStyle:0,lineWidth:1,crosshairMarkerVisible:!0,crosshairMarkerRadius:6,lineType:1}),this.lineSeries.applyOptions({color:"rgba(255, 44, 128, 1)",lineWidth:3}),setTimeout(function(){e.setIntervalInstall()},100)},add:function(e,t){var i=e;this.candlestickSeries.setData(i);var s=t;this.volumeSeries.setData(s)},news:function(e){console.log(e)},abolish:function(){var e=this,t={coin:this.headername.from_coin};this.$api.home.coindislike(t).then(function(t){e.collect=!e.collect})},subbottom:function(){this.$router.go(-1)}}},o={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"bg"},[i("app-nav",{attrs:{back:!0,dark:!0}},[i("span",[e._v(e._s(e.headername.from_coin)+"/"+e._s(e.headername.to_coin))])]),e._v(" "),i("div",{staticClass:"header"},[i("div",{staticClass:"headerTop"},[i("div",{staticClass:"headerTopLeft"},[i("div",{staticClass:"price",class:{red:Number(e.header.price)<0,green:Number(e.header.price)>=0}},[e._v("\n "+e._s(e.header.price)+"\n ")]),e._v(" "),i("div",{staticClass:"text"},[e._v("\n ≈$"+e._s(e.header.price)+"\n "),i("span",{staticClass:"rate",class:{red:Number(e.header.change_percentage)<0,green:Number(e.header.change_percentage)>=0},staticStyle:{"padding-left":"0.1rem"}},[e._v(e._s(e.header.change_percentage)+"\n ")])])]),e._v(" "),i("div",{staticClass:"headerTopRight"},[i("div",{staticClass:"item_text"},[i("div",{staticClass:"name"},[e._v(e._s(e.$t("24H高")))]),e._v(" "),i("div",{staticClass:"number"},[e._v(e._s(e.header.high_price))])]),e._v(" "),i("div",{staticClass:"item_text"},[i("div",{staticClass:"name"},[e._v(e._s(e.$t("24H低")))]),e._v(" "),i("div",{staticClass:"number"},[e._v(e._s(e.header.low_price))])])])]),e._v(" "),i("div",{staticClass:"headerTime"},[i("div",{staticClass:"leftTime"},[i("div",{staticClass:"itemTime"},[e._v(e._s(e.$t("分时")))])]),e._v(" "),i("div",{staticClass:"rightTime"},e._l(e.TimeList,function(t,s){return i("div",{key:s,staticClass:"itemTime",class:{active:e.curTime==t.name},on:{click:function(i){e.clTime(t,s)}}},[e._v("\n "+e._s(e.$t(t.name))+"\n ")])}))])]),e._v(" "),i("div",{staticClass:"idName"},[i("div",{ref:"echartContainer"})]),e._v(" "),i("div",{staticClass:"list"},[i("div",{staticClass:"list_title"},[i("span",[e._v(e._s(e.$t("委托挂单")))])]),e._v(" "),i("div",{staticClass:"list_inner"},[e.header.depth?i("div",{staticClass:"list_left",domProps:{innerHTML:e._s(e.blod(e.header.depth.bids[0].price))}}):e._e(),e._v(" "),e.header.depth?i("div",{staticClass:"list_right",domProps:{innerHTML:e._s(e.blod(e.header.depth.asks[0].price))}}):e._e()])]),e._v(" "),i("div",{staticClass:"boxSubmit"},[i("div",{staticClass:"buy",on:{click:e.subbottom}},[e._v(e._s(e.$t("买涨")))]),e._v(" "),i("div",{staticClass:"sell",on:{click:e.subbottom}},[e._v(e._s(e.$t("买跌")))])])],1)},staticRenderFns:[]};var l=i("VU/8")(n,o,!1,function(e){i("6y0P")},"data-v-acb9b44e",null);t.default=l.exports}});
//# sourceMappingURL=72.4a0566f8490c68c8f94e.js.map