|
|
@ -20,9 +20,10 @@ |
|
|
|
<text class="time">{{item.timestr}}</text> |
|
|
|
<text class="closeTimeTitle" v-show="type === 2">{{ i18n.CloseTime }}</text> |
|
|
|
<text class="closeTime" v-show="type === 2">{{item.timestr2}}</text> |
|
|
|
<view class="closeBtn" v-show="type === 0 || type === 1" @click="closeItem(item,index)">{{ |
|
|
|
<view class="closeBtn" v-show="type === 0" @click="closeItem(item,index)">{{ |
|
|
|
i18n.close |
|
|
|
}}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="infoBody"> |
|
|
@ -33,8 +34,11 @@ |
|
|
|
<view class="value">{{item.openedPrice}}</view> |
|
|
|
<view class="title">{{ i18n.Bond }}</view> |
|
|
|
<view class="value">{{item.bondAmount}}</view> |
|
|
|
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StyPrice }}</view> |
|
|
|
<view class="value" v-show="type !== 3||type !== 0">{{item.winStopPrice}}</view> |
|
|
|
<view class="title" v-show="type == 1||type == 2">{{ i18n.StyPrice }}</view> |
|
|
|
<view class="value" v-show="type ==1||type == 2">{{item.winStopPrice}}</view> |
|
|
|
<view class="closeBtn" v-show="type === 1" @click="Margincall(item)"> |
|
|
|
{{ i18n.Margincall }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 公共的 --> |
|
|
|
<view class="center"> |
|
|
@ -42,35 +46,54 @@ |
|
|
|
<view class="value">{{item.hand}} * {{item.leverage}}</view> |
|
|
|
<view class="title">{{ i18n.Fee }}</view> |
|
|
|
<view class="value">{{item.fee}}</view> |
|
|
|
<view class="title" v-show="type !== 3||type !== 0">{{ i18n.StsPrice }}</view> |
|
|
|
<view class="value" v-show="type !== 3||type !== 0">{{item.lossStopPrice}}</view> |
|
|
|
<view class="title" v-show="type == 1||type == 2">{{ i18n.StsPrice }}</view> |
|
|
|
<view class="value" v-show="type == 1||type == 2">{{item.lossStopPrice}}</view> |
|
|
|
|
|
|
|
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> --> |
|
|
|
<view class="closeBtn" v-show="type === 1" @click="getStopLimit(item)"> |
|
|
|
{{ i18n.StopLimit }} |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- Current Entrust 和 Position--> |
|
|
|
<view class="right" v-show="type === 0 || type === 1"> |
|
|
|
<view class="title">{{ i18n.CurrentPrice }}</view> |
|
|
|
<view class="value" style="color:#F4506A;">{{marketDetail.close}}</view> |
|
|
|
<view class="title" v-show="type === 0">{{ i18n.status }}</view> |
|
|
|
<!-- <view class="title" v-show="type === 0">{{ i18n.status }}</view> |
|
|
|
<view class="value" v-show="type === 0"> |
|
|
|
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} |
|
|
|
</view> --> |
|
|
|
<view class="title" v-show="type === 1">{{ i18n.ROE }}</view> |
|
|
|
<view class="value" v-show="type === 1" :style=" |
|
|
|
getValue(item.direction=='buy' |
|
|
|
?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)>=0?'color:#00E8A2;':'color:#F4506A'"> |
|
|
|
<!-- {{getValue(item.profitAmount/item.bondAmount)}}% --> |
|
|
|
{{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}% |
|
|
|
</view> |
|
|
|
<view class="title" v-show="type === 1">{{ i18n.do }}</view> |
|
|
|
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)"> |
|
|
|
{{ i18n.StopLimit }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="title" v-show="type === 1||type === 2">{{ i18n.ExpectProfit }}</view> |
|
|
|
<view class="value" v-show="type === 1" |
|
|
|
:style="parseFloat(getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand))>=0?'color:#00E8A2':'color:#F4506A'"> |
|
|
|
{{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}} |
|
|
|
</view> |
|
|
|
<view class="value" style="color:#00E8A2;" v-show="type === 2">0</view> |
|
|
|
|
|
|
|
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> --> |
|
|
|
<view class="closeBtn" v-show="type === 1" @click="closeItem(item,index)">{{ |
|
|
|
i18n.close |
|
|
|
}}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- Closed --> |
|
|
|
<view class="right" v-show="type === 2"> |
|
|
|
<view class="title">{{ i18n.ClosePrice }}</view> |
|
|
|
<view class="value" style="color:#00E8A2;">{{item.closedPrice}}</view> |
|
|
|
<view class="title">{{ i18n.status }}</view> |
|
|
|
<view class="title">{{ i18n.ROE }}</view> |
|
|
|
<view class="value"> |
|
|
|
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} |
|
|
|
<!-- {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} --> |
|
|
|
<view class="value" :style="(item.profitAmount/item.bondAmount)*100>=0?'color:#00E8A2;':'color:#F4506A'"> |
|
|
|
{{getValue(item.profitAmount/item.bondAmount)}}% |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="title">{{ i18n.PL }}</view> |
|
|
@ -82,13 +105,13 @@ |
|
|
|
</view> |
|
|
|
<!-- Revoked --> |
|
|
|
<view class="right" v-show="type === 3"> |
|
|
|
<view class="title">{{ i18n.status }}</view> |
|
|
|
<!-- <view class="title">{{ i18n.status }}</view> |
|
|
|
<view class="value" style="color:#F4506A;"> |
|
|
|
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="title">{{ i18n.PL }}</view> |
|
|
|
<view class="value" style="color:#00E8A2;"> |
|
|
|
<!-- {{item.currentPl}} --> 0 |
|
|
|
0 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -131,10 +154,29 @@ |
|
|
|
<button class="btn add" @click="stsValueChange('add')"></button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-modal> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 追加保证金 --> |
|
|
|
<u-modal :show="stopModalShowZui" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel" :showCancelButton="true" |
|
|
|
:title="i18n.Margincall" :content='i18n.WarmTipsText' @confirm="stopConfirm" @cancel="stopModalShowZui = false" |
|
|
|
confirmColor="#00E8A2" cancelColor="#96959E"> |
|
|
|
<view class="stopModel"> |
|
|
|
<view class="title"> |
|
|
|
<text class="left">{{ i18n.AmountTrue }}</text> |
|
|
|
<!-- <text class="right">{{ i18n.ExpectProfit }} {{ profit }}</text> --> |
|
|
|
</view> |
|
|
|
<view class="numberInput"> |
|
|
|
<button class="btn sub" :class="{ disabled: stySubBtnDisabled || styValue <= 0 }" |
|
|
|
:disabled="stySubBtnDisabled" @click="styValueChange('sub')"></button> |
|
|
|
<input class="number" type="number" v-model="styValue" @input="stopModalChange" /> |
|
|
|
<button class="btn add" @click="styValueChange('add')"></button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-modal> |
|
|
|
|
|
|
|
|
|
|
|
<u-empty :text="i18n.Dataisempty" mode="data" v-if="!list.length"></u-empty> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -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 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
.righttype3{ |
|
|
|
position: absolute; |
|
|
|
right: 115rpx; |
|
|
|
} |
|
|
|
.closeBtn { |
|
|
|
display: inline-block; |
|
|
|
// width: 98rpx; |
|
|
|
padding: 0 12rpx; |
|
|
|
height: 48rpx; |
|
|
|
border-radius: 8rpx; |
|
|
|
line-height: 48rpx; |
|
|
|
background-color: rgba($color: rgb(0, 232, 162), $alpha: 0.1); |
|
|
|
font-size: 24rpx; |
|
|
|
text-align: center; |
|
|
|
color: rgb(0, 232, 162); |
|
|
|
margin-top: 22rpx; |
|
|
|
} |
|
|
|
/deep/ .u-empty { |
|
|
|
top: 500% !important; |
|
|
|
} |
|
|
@ -519,6 +625,7 @@ |
|
|
|
font-size: 24rpx; |
|
|
|
text-align: center; |
|
|
|
color: #F4506A; |
|
|
|
margin-top: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|