diff --git a/components/entrustOrderList/entrustOrderList.vue b/components/entrustOrderList/entrustOrderList.vue index bd2aa37..9a699cb 100644 --- a/components/entrustOrderList/entrustOrderList.vue +++ b/components/entrustOrderList/entrustOrderList.vue @@ -19,9 +19,16 @@ {{item.timestr}} {{ i18n.CloseTime }} {{item.timestr2}} - {{ + {{ i18n.close }} + + {{ i18n.PL }}:{{" "}} + + 0 + + + @@ -34,6 +41,9 @@ {{item.bondAmount}} {{ i18n.StyPrice }} {{item.winStopPrice}} + + {{ i18n.Margincall }} + @@ -43,6 +53,12 @@ {{item.fee}} {{ i18n.StsPrice }} {{item.lossStopPrice}} + + + + {{ i18n.StopLimit }} + + @@ -52,16 +68,23 @@ {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} --> - {{ i18n.do }} - - {{ i18n.StopLimit }} + {{ i18n.ROE }} + + {{getValue(item.profitAmount/item.bondAmount)}}% + {{ i18n.ExpectProfit }} {{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}} 0 + + + {{ + i18n.close + }} + @@ -83,16 +106,16 @@ - - + {{ i18n.PL }} - 0 + 0 - + --> @@ -133,9 +156,28 @@ - - + + + + + + + + {{ i18n.AmountTrue }} + + + + + + + + + + @@ -196,6 +238,7 @@ status: 'undone', closeModalShow: false, stopModalShow: false, + stopModalShowZui:false, type: 0, test: 0, dealList: [{ @@ -266,6 +309,7 @@ i = String(i) return i.substring(0, i.indexOf(".") + 5); }, + stopModalChange() { if (this.stopLimitData.direction === 'buy') { if (this.styValue) @@ -298,7 +342,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 @@ -378,26 +430,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值变化 @@ -453,6 +531,23 @@