75.2206abb10489abcabcf1.js 5.4 KB

12
  1. webpackJsonp([75],{"1SD9":function(i,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=s("wQWh"),r={data:function(){return{orderInfo:{},dataList:{},winPrice:0,losePrice:0,maxPrice:"",minPrice:"",orderType:"",addNum:0,addLen:0}},computed:{getWsMsg:function(){return this.$store.state.orderWebSocketMsg}},watch:{getWsMsg:function(i){if("PONG"!=i.data){var t=i.data,s=JSON.parse(t);s.room==this.orderInfo.symbol&&(this.dataList=s.data,console.log(this.dataList))}}},mounted:function(){window.scrollTo(0,0),this.orderInfo=this.$route.query,this.orderType=this.orderInfo.type,this.winPrice="0"==this.orderInfo.stop?this.orderInfo.buyPrice:this.orderInfo.stop,this.losePrice="0"==this.orderInfo.take?this.orderInfo.buyPrice:this.orderInfo.take,this.addLen=this.orderInfo.buyPrice.split(".")[1].length,this.addNum=1/Math.pow(10,this.orderInfo.buyPrice.split(".")[1].length),e.e.room=this.orderInfo.symbol,null==this.socketApi.wsConnectionOrder.$wsOrder?this.socketApi.wsConnectionOrder.initWebSocket():this.socketApi.wsConnectionOrder.wsSend()},methods:{blod:function(i){var t=i.split("."),s=t[1].length;return s<=2?'<div style="vertical-align: bottom;"><span>'+t[0]+'.</span><span style="font-size:36px;">'+t[1]+"</span></div>":'<div style="vertical-align: bottom;"><span>'+t[0]+".</span><span>"+t[1].substring(0,s-3)+'</span><span style="font-size:36px;">'+t[1].substring(s-3,s-1)+"</span><span>"+t[1].charAt(s-1)+"</span></div>"},priceminus:function(){""!=this.winPrice&&(this.winPrice<=this.addNum||(this.winPrice=((this.winPrice*Math.pow(10,this.addLen)-1)/Math.pow(10,this.addLen)).toFixed(this.addLen)))},priceadd:function(){""!=this.winPrice?this.winPrice=((this.winPrice*Math.pow(10,this.addLen)+1)/Math.pow(10,this.addLen)).toFixed(this.addLen):this.winPrice=this.addNum},losepriceminus:function(){""!=this.losePrice&&(this.losePrice<=.01||(this.losePrice=((this.losePrice*Math.pow(10,this.addLen)-1)/Math.pow(10,this.addLen)).toFixed(this.addLen)))},losepriceadd:function(){""!=this.losePrice?this.losePrice=((this.losePrice*Math.pow(10,this.addLen)+1)/Math.pow(10,this.addLen)).toFixed(this.addLen):this.losePrice=.01},edit:function(){var i=this;if("1"==this.orderType){if(this.losePrice<=this.orderInfo.buyPrice&""!=this.losePrice)return void this.$toast(this.$t("止盈超出最小可设数值"));if(this.winPrice>=this.orderInfo.buyPrice&""!=this.winPrice)return void this.$toast(this.$t("止损超出最大可设数值"))}else{if(this.losePrice>=this.orderInfo.buyPrice&""!=this.losePrice)return void this.$toast(this.$t("止盈超出最大可设数值"));if(this.winPrice<=this.orderInfo.buyPrice&""!=this.winPrice)return void this.$toast(this.$t("止损超出最小可设数值"))}var t={take_profit_price:this.losePrice.toString(),stop_loss_price:this.winPrice.toString()},s=this.orderInfo.id;this.$api.quotation.editPrice(t,s).then(function(t){i.$router.go(-1)})}}},n={render:function(){var i=this,t=i.$createElement,s=i._self._c||t;return s("div",[s("app-nav",{attrs:{back:!0}},[s("template",{attrs:{slot:"center"},slot:"center"},[s("div",{staticClass:"title"},[i._v(i._s(i.$t("修改价位")))])])],2),i._v(" "),s("div",{staticClass:"content1"},[s("div",{staticClass:"v-content1"},[s("div",{staticClass:"header1"},[i._v("\n #"+i._s(i.orderInfo.orderId)+"\n "+i._s(i.$t("1"==i.orderInfo.type?"做多":"做空"))+"\n "+i._s(i.orderInfo.margin)+"USDT "+i._s(i.orderInfo.symbol)+"\n ")]),i._v(" "),s("div",{staticClass:"set-price"},[s("div",{staticClass:"price-left"},[i._v(i._s(i.$t("止损")))]),i._v(" "),s("div",{staticClass:"price-right"},[s("div",[s("van-icon",{staticClass:"icon3",attrs:{color:"#fff",name:"minus"},on:{click:i.priceminus}})],1),i._v(" "),s("div",{staticClass:"price-num"},[s("input",{directives:[{name:"model",rawName:"v-model",value:i.winPrice,expression:"winPrice"}],staticClass:"price-input",attrs:{type:"number",placeholder:i.$t("未设置")},domProps:{value:i.winPrice},on:{input:function(t){t.target.composing||(i.winPrice=t.target.value)}}})]),i._v(" "),s("div",[s("van-icon",{staticClass:"icon3",attrs:{name:"plus"},on:{click:i.priceadd}})],1)])]),i._v(" "),s("div",{staticClass:"set-price"},[s("div",{staticClass:"price-left"},[i._v(i._s(i.$t("止盈")))]),i._v(" "),s("div",{staticClass:"price-right"},[s("div",[s("van-icon",{staticClass:"icon3",attrs:{color:"#fff",name:"minus"},on:{click:i.losepriceminus}})],1),i._v(" "),s("div",{staticClass:"price-num"},[s("input",{directives:[{name:"model",rawName:"v-model",value:i.losePrice,expression:"losePrice"}],staticClass:"price-input",attrs:{type:"number",placeholder:i.$t("未设置")},domProps:{value:i.losePrice},on:{input:function(t){t.target.composing||(i.losePrice=t.target.value)}}})]),i._v(" "),s("div",[s("van-icon",{staticClass:"icon3",attrs:{name:"plus"},on:{click:i.losepriceadd}})],1)])])]),i._v(" "),s("div",{staticClass:"view-bottom"},[s("div",{staticClass:"time-price"},[Object.keys(i.dataList).length>0?s("div",{staticClass:"bids-price",domProps:{innerHTML:i._s(i.blod(i.dataList.depth.bids[0].price))}}):i._e(),i._v(" "),Object.keys(i.dataList).length>0?s("div",{staticClass:"asks-price",domProps:{innerHTML:i._s(i.blod(i.dataList.depth.asks[0].price))}}):i._e()]),i._v(" "),s("div",{staticClass:"edit-btn",on:{click:i.edit}},[i._v(i._s(i.$t("修改")))])])])],1)},staticRenderFns:[]};var o=s("VU/8")(r,n,!1,function(i){s("OdpB")},null,null);t.default=o.exports},OdpB:function(i,t){}});
  2. //# sourceMappingURL=75.2206abb10489abcabcf1.js.map