|
|
@ -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; |
|
|
|