Browse Source

修改止盈止损逻辑

master
liaoxinyu 4 weeks ago
parent
commit
c2859ba688
  1. 17
      src/views/contract/exchange-store.vue

17
src/views/contract/exchange-store.vue

@ -540,7 +540,7 @@ export default {
methods: { methods: {
inputEnter(boll) { inputEnter(boll) {
if(boll){ if(boll){
this.marginSell = this.marginSell this.marginSell = String(this.marginSell)
.replace(/[^\d.]/g, "") // .replace(/[^\d.]/g, "") //
.replace(/^(\d*\.?\d{0,2}).*$/, "$1"); // .replace(/^(\d*\.?\d{0,2}).*$/, "$1"); //
}else{ }else{
@ -666,7 +666,22 @@ export default {
data.amount = this.sellform.amount; data.amount = this.sellform.amount;
data.checkbox = this.checkboxSell; data.checkbox = this.checkboxSell;
} }
if(side==1&&this.checkboxBuy){
data.tp_trigger_price = this.buyform.pri1;
data.sl_trigger_price = this.buyform.pri2;
}else{
data.tp_trigger_price = this.sellform.pri1;
data.sl_trigger_price = this.sellform.pri2;
}
Contract.openPosition(data).then(() => { Contract.openPosition(data).then(() => {
if(side==1&&this.checkboxBuy){
this.buyform.pri1 = "";
this.buyform.pri2 = "";
}else{
this.sellform.pri1 = "";
this.sellform.pri2 = "";
}
this.contractAccount(); this.contractAccount();
this.buyform.amount = 0; this.buyform.amount = 0;
this.sellform.amount = 0; this.sellform.amount = 0;

Loading…
Cancel
Save