diff --git a/components/entrustOrderList/entrustOrderList.vue b/components/entrustOrderList/entrustOrderList.vue
index 8c1a494..ad8ef6e 100644
--- a/components/entrustOrderList/entrustOrderList.vue
+++ b/components/entrustOrderList/entrustOrderList.vue
@@ -20,9 +20,10 @@
{{item.timestr}}
{{ i18n.CloseTime }}
{{item.timestr2}}
- {{
+ {{
i18n.close
}}
+
@@ -33,8 +34,11 @@
{{item.openedPrice}}
{{ i18n.Bond }}
{{item.bondAmount}}
- {{ i18n.StyPrice }}
- {{item.winStopPrice}}
+ {{ i18n.StyPrice }}
+ {{item.winStopPrice}}
+
+ {{ i18n.Margincall }}
+
@@ -42,35 +46,54 @@
{{item.hand}} * {{item.leverage}}
{{ i18n.Fee }}
{{item.fee}}
- {{ i18n.StsPrice }}
- {{item.lossStopPrice}}
+ {{ i18n.StsPrice }}
+ {{item.lossStopPrice}}
+
+
+
+ {{ i18n.StopLimit }}
+
+
{{ i18n.CurrentPrice }}
{{marketDetail.close}}
- {{ i18n.status }}
+
+ {{ i18n.ROE }}
+
+
+ {{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}%
- {{ i18n.do }}
-
- {{ i18n.StopLimit }}
-
+
{{ i18n.ExpectProfit }}
{{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}}
0
+
+
+ {{
+ i18n.close
+ }}
+
{{ i18n.ClosePrice }}
{{item.closedPrice}}
- {{ i18n.status }}
+ {{ i18n.ROE }}
- {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
+
+
+ {{getValue(item.profitAmount/item.bondAmount)}}%
+
{{ i18n.PL }}
@@ -82,13 +105,13 @@
- {{ i18n.status }}
+
{{ i18n.PL }}
- 0
+ 0
@@ -131,9 +154,28 @@
-
-
+
+
+
+
+
+
+
+ {{ i18n.AmountTrue }}
+
+
+
+
+
+
+
+
+
+
@@ -194,7 +236,12 @@
status: 'opened',
closeModalShow: false,
stopModalShow: false,
+<<<<<<< HEAD
type: 1,
+=======
+ stopModalShowZui:false,
+ type: 0,
+>>>>>>> 1e578ec94e2ad85c6c797e5669f396b7f88e1b91
test: 0,
dealList: [{
dealType: 'long'
@@ -247,6 +294,13 @@
timer2 = null;
},
methods: {
+ // 获取百分比位数
+ getValue(e){
+ let data = e*100
+ data = parseFloat(data.toPrecision(10))
+ data = String(data)
+ return data.substring(0, data.indexOf(".") + 3);
+ },
// 获取位数
getPrice(s) {
var i=s;
@@ -257,6 +311,7 @@
i = String(i)
return i.substring(0, i.indexOf(".") + 5);
},
+
stopModalChange() {
if (this.stopLimitData.direction === 'buy') {
if (this.styValue)
@@ -289,7 +344,15 @@
this.profit = 0
this.loss = 0
},
-
+ // 设置保证金
+ Margincall(i){
+ this.stopLimitData = i
+ this.stopModalShowZui=true
+ this.styValue = 0;
+ this.stsValue = 0;
+ this.profit = 0
+ this.loss = 0
+ },
// 获取撤销订单
closeItem(item, i) {
this.itemData = item
@@ -369,26 +432,52 @@
* stop确认弹窗
*/
stopConfirm() {
- if (this.styValue < 0 || this.stsValue < 0) {
- uni.showToast({
- title: this.i18n.lessThan,
- icon: 'none',
- duration: 2000 //持续时间为
- })
- return;
+ if(this.stopModalShow){
+ if (this.styValue < 0 || this.stsValue < 0) {
+ uni.showToast({
+ title: this.i18n.lessThan,
+ icon: 'none',
+ duration: 2000 //持续时间为
+ })
+ return;
+ }
+ const orderList = this.$api.setWinOrLossStopPrice({
+ "orderNo": this.stopLimitData.orderNo,
+ "winStopPrice": this.styValue,
+ "lossStopPrice": this.stsValue,
+ });
+ orderList.then(res => {
+ uni.$u.toast(this.$t("markets").Succeeded)
+ this.stopModalShow = false
+ setTimeout(() => {
+ this.getContractOrderList()
+ }, 800)
+ });
}
- const orderList = this.$api.setWinOrLossStopPrice({
- "orderNo": this.stopLimitData.orderNo,
- "winStopPrice": this.styValue,
- "lossStopPrice": this.stsValue,
- });
- orderList.then(res => {
- uni.$u.toast(this.$t("markets").Succeeded)
- this.stopModalShow = false
- setTimeout(() => {
- this.getContractOrderList()
- }, 600)
- });
+
+ if(this.stopModalShowZui){
+ if (this.styValue < 0) {
+ uni.showToast({
+ title: this.i18n.lessThan,
+ icon: 'none',
+ duration: 2000 //持续时间为
+ })
+ return;
+ }
+ const orderList = this.$api.addBond({
+ "orderNo": this.stopLimitData.orderNo,
+ "amount": this.styValue,
+ });
+ orderList.then(res => {
+ uni.$u.toast(this.$t("markets").Succeeded)
+ this.stopModalShowZui = false
+ setTimeout(() => {
+ this.getContractOrderList()
+ }, 800)
+ });
+
+ }
+
},
/**
* styValue值变化
@@ -444,6 +533,23 @@