|
@@ -39,7 +39,7 @@
|
|
|
<!-- {{ pagesInfo }} -->
|
|
|
<view class="shortcut">
|
|
|
<swiper class="swiper-content" :current="lableIndex"
|
|
|
- :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }">
|
|
|
+ :style="{'height': scrollHeight ? `${scrollHeight}px` : '' }" disable-touch>
|
|
|
<swiper-item class="swiper-item-box">
|
|
|
<u-list>
|
|
|
<view class="shortcut-open">
|
|
@@ -64,13 +64,65 @@
|
|
|
</view>
|
|
|
<view class="price-box">
|
|
|
<text class="price-lable">保证金</text>
|
|
|
- <input class="price-inp" type="number" v-model="caution_money">
|
|
|
+ <text @click.stop="switchShare" class="price-inp price-inp-text"
|
|
|
+ v-show="percent">{{ percent }}%</text>
|
|
|
+ <input v-show="!percent" :focus="isShareFocus" class="price-inp" type="number"
|
|
|
+ v-model="caution_money">
|
|
|
<view class="price-info">
|
|
|
USDT
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="step-content">
|
|
|
+ <step :percent.sync="percent" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="set-node">
|
|
|
+ <view class="set-node-box">
|
|
|
+ <view @click.stop="setNodePrice = !setNodePrice"
|
|
|
+ :class="['set-node-status' , setNodePrice ? 'active-set' : '']">
|
|
|
+ <text class="iconfont" v-show="setNodePrice"></text>
|
|
|
+ </view>
|
|
|
+ <text class="set-node-text">设置止盈止损</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
+ <view class="set-profit-loss" v-show="setNodePrice">
|
|
|
+ <!-- 止盈 -->
|
|
|
+ <view class="set-profit-loss-title">
|
|
|
+ <text class="title-name">止盈</text>
|
|
|
+ <view class="title-btn" @click.stop="() => {
|
|
|
+ restrictProfitVal = ''
|
|
|
+ restrictProfitStatus === 1 ? restrictProfitStatus = 2 : restrictProfitStatus = 1;
|
|
|
+ }">
|
|
|
+ <text class="iconfont"></text>
|
|
|
+ <text>按{{ restrictProfitStatus === 1 ? '价格' : '比例' }}设置</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="profit-loss-input">
|
|
|
+ <text>请输入止盈价格</text>
|
|
|
+ <input class="input-item" v-model="restrictProfitVal" type="number">
|
|
|
+ <text>{{ restrictProfitStatus === 1 ? 'USDT' : '%' }}</text>
|
|
|
+ </view>
|
|
|
+ <!-- 止损 -->
|
|
|
+ <view class="set-profit-loss-title">
|
|
|
+ <text class="title-name">止盈</text>
|
|
|
+ <view class="title-btn" @click.stop="() => {
|
|
|
+ restrictLossVal = ''
|
|
|
+ restrictLossStatus === 1 ? restrictLossStatus = 2 : restrictLossStatus = 1;
|
|
|
+ }">
|
|
|
+ <text class=" iconfont"></text>
|
|
|
+ <text>按{{ restrictLossStatus === 1 ? '价格' : '比例' }}设置</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="profit-loss-input">
|
|
|
+ <text>请输入止损价格</text>
|
|
|
+ <input class="input-item" v-model="restrictLossVal" type="number">
|
|
|
+ <text>{{ restrictLossStatus === 1 ? 'USDT' : '%' }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
<view class="shortcut-usable">
|
|
|
<view class="usable-info">
|
|
|
可用:{{ pagesInfo.user_lever }} USDT
|
|
@@ -188,12 +240,13 @@
|
|
|
<view class="content-btn-item" @click.stop="setCloseLever(item)">
|
|
|
平仓
|
|
|
</view>
|
|
|
- <view class="content-btn-item" @click.stop="setInversion(item)">
|
|
|
+ <!-- @click.stop="setInversion(item)" -->
|
|
|
+ <view class="content-btn-item">
|
|
|
反向开仓
|
|
|
</view>
|
|
|
- <!-- <view class="content-btn-item">
|
|
|
+ <view class="content-btn-item">
|
|
|
加仓
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="set-stop">
|
|
|
<view class="stop-left" @click.stop="setRestrict(item)">
|
|
@@ -202,7 +255,7 @@
|
|
|
class="stop-num">{{ item.target_profit_price || '--' }}/{{ item.stop_loss_price || '--'}}</text>
|
|
|
<text class="iconfont"></text>
|
|
|
</view>
|
|
|
- <view class="stop-right">
|
|
|
+ <view class="stop-right" @click.stop="$emit('shareContent' , item)">
|
|
|
<text class="icon-size iconfont"></text>
|
|
|
<text class="icon-size">分享</text>
|
|
|
</view>
|
|
@@ -225,6 +278,7 @@
|
|
|
<unopen ref="placeOrderRef" @confirm="confirmPlaceOrder" title="下单确认" cancelBtn content="确定要下单吗?" />
|
|
|
<unopen ref="unopenRef" @confirm="confirm" textAlign="left" :title="unopenSolt.title" cancelBtn
|
|
|
:content="unopenSolt.closeLeverContent" />
|
|
|
+
|
|
|
<popupHint ref="hintRef" title="快捷合约">
|
|
|
<template #hintContent>
|
|
|
<view class="">
|
|
@@ -302,7 +356,20 @@
|
|
|
unopenSolt: {
|
|
|
title: '',
|
|
|
content: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ percent: 0,
|
|
|
+ isShareFocus: false,
|
|
|
+
|
|
|
+
|
|
|
+ // 止盈止损
|
|
|
+ setNodePrice: false,
|
|
|
+ // 止盈
|
|
|
+ restrictProfitVal: '',
|
|
|
+ restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
|
|
|
+ // 止损
|
|
|
+ restrictLossVal: '',
|
|
|
+ restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -368,6 +435,14 @@
|
|
|
// this.getLeverDeal()
|
|
|
// this.getRegister()
|
|
|
},
|
|
|
+ // 切换张数
|
|
|
+ switchShare() {
|
|
|
+ this.percent = 0
|
|
|
+ this.isShareFocus = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.isShareFocus = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
// getRegister() {
|
|
|
// Api_getRegister({
|
|
|
// status: 1,
|
|
@@ -398,12 +473,42 @@
|
|
|
legal_id: this.currencyVal.legal_id,
|
|
|
currency_id: this.currencyVal.currency_id,
|
|
|
multiple: this.multiple,
|
|
|
- caution_money: this.caution_money,
|
|
|
+ caution_money: this.percent ? `${this.percent}%` : this.caution_money,
|
|
|
status: this.status
|
|
|
}
|
|
|
+ if (this.setNodePrice) {
|
|
|
+ // 设置止盈止损
|
|
|
+ // // 止盈
|
|
|
+ // restrictProfitVal: '',
|
|
|
+ // restrictProfitStatus: 1, // 按价格止盈 , 2 : 比例止盈
|
|
|
+ // // 止损
|
|
|
+ // restrictLossVal: '',
|
|
|
+ // restrictLossStatus: 1, // 按价格止损 , 2 : 比例止损
|
|
|
+ obj.target_profit_price = this.restrictProfitStatus === 1 ? this.restrictProfitVal :
|
|
|
+ `${restrictProfitVal}%`;
|
|
|
+ obj.stop_loss_price = this.restrictLossStatus === 1 ? this.restrictLossVal : `${restrictLossVal}%`;
|
|
|
|
|
|
+
|
|
|
+ }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
Api_setSubmitLever(obj).then(res => {
|
|
|
- this.setSuccess()
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '下单成功',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideToast()
|
|
|
+ this.setSuccess()
|
|
|
+ }, 300)
|
|
|
+ }, 201)
|
|
|
+ }).finally(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }, 200)
|
|
|
})
|
|
|
},
|
|
|
// 设置止盈止损
|
|
@@ -439,13 +544,14 @@
|
|
|
closeLeverContent: '如果存在平仓挂单(限价止盈止损),将会在全平前被撤单,确定全部平仓吗?',
|
|
|
}
|
|
|
this.setDepot();
|
|
|
+ // this.setDepot();
|
|
|
// this.title = '全部平仓';
|
|
|
// this.closeLeverContent = '';
|
|
|
// this.closeLeverItem = null;
|
|
|
// this.$refs.unopenRef.open();
|
|
|
},
|
|
|
// 平仓 - 反向开仓
|
|
|
- setDepot(obj) {
|
|
|
+ setDepot() {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.unopenRef.open()
|
|
|
})
|
|
@@ -458,7 +564,20 @@
|
|
|
Api_setCloseLever({
|
|
|
id: this.closeLeverItem.id
|
|
|
}).then(res => {
|
|
|
- this.setSuccess()
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '平仓成功',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideToast();
|
|
|
+ this.setSuccess()
|
|
|
+ }, 300)
|
|
|
+ }, 201)
|
|
|
+ }).finally(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }, 200)
|
|
|
})
|
|
|
} else if (this.closeLeverItem == -1) {
|
|
|
// 反向开仓
|
|
@@ -469,7 +588,20 @@
|
|
|
type: 0,
|
|
|
currency_id: this.currencyVal.currency_id
|
|
|
}).then(res => {
|
|
|
- this.setSuccess()
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '平仓成功',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideToast();
|
|
|
+ this.setSuccess()
|
|
|
+ }, 300)
|
|
|
+ }, 201)
|
|
|
+ }).finally(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }, 200)
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -650,7 +782,7 @@
|
|
|
|
|
|
.iconfont {
|
|
|
font-size: 30rpx;
|
|
|
- color: $SizeColor1;
|
|
|
+ color: #878592;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -754,13 +886,12 @@
|
|
|
text-align: right;
|
|
|
}
|
|
|
|
|
|
- // <view class="price-box">
|
|
|
- // <text class="price-lable">价格</text>
|
|
|
- // <input class="price-inp" type="number">
|
|
|
- // <view class="price-info">
|
|
|
- // USDT
|
|
|
- // </view>
|
|
|
- // </view>
|
|
|
+ .price-inp-text {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.price-box+.price-box {
|
|
@@ -770,6 +901,10 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .step-content {
|
|
|
+ padding: 26rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
// <view class="shortcut-usable">
|
|
|
// <view class="usable-info">
|
|
|
// 可用:2927.81 USDT
|
|
@@ -868,27 +1003,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // <view class="account-box">
|
|
|
- // <view class="account-item">
|
|
|
- // <view class="account-title">
|
|
|
- // <text class="text">持仓保证金USDT)</text>
|
|
|
- // </view>
|
|
|
- // <text class="account-num">{{ contractAccount.usdt_totle }}</text>
|
|
|
- // </view>
|
|
|
- // <view class="account-item">
|
|
|
- // <view class="account-title">
|
|
|
- // <text class="text">可用保证金(USDT)</text>
|
|
|
- // </view>
|
|
|
- // <text class="account-num">{{ contractAccount.totle }}</text>
|
|
|
- // </view>
|
|
|
- // <view class="account-item">
|
|
|
- // <view class="account-title">
|
|
|
- // <text class="text">未实现亏盈(USDT)</text>
|
|
|
- // </view>
|
|
|
- // <text class="account-num">{{ rateProfitsTotal.hazard_rate }}</text>
|
|
|
- // </view>
|
|
|
- // </view>
|
|
|
-
|
|
|
.account-box {
|
|
|
width: 100%;
|
|
|
min-height: 120rpx;
|
|
@@ -910,19 +1024,6 @@
|
|
|
text-align: right;
|
|
|
}
|
|
|
|
|
|
- // &:nth-child(3n - 1) {
|
|
|
- // width: 35%;
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- // &:nth-child(3n - 2) {
|
|
|
- // width: 30%;
|
|
|
- // }
|
|
|
-
|
|
|
- // &:nth-child(n + 4) {
|
|
|
- // margin-top: 20rpx;
|
|
|
- // }
|
|
|
-
|
|
|
.account-title {
|
|
|
|
|
|
font-size: 24rpx;
|
|
@@ -942,4 +1043,112 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .set-node {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .set-node-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .set-node-high {
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-family: PingFang SC, PingFang SC-Regular;
|
|
|
+ font-weight: 400;
|
|
|
+ color: $Theme-Color;
|
|
|
+ line-height: 1.1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .set-node-status {
|
|
|
+ width: 27rpx;
|
|
|
+ height: 27rpx;
|
|
|
+ background: #e6e6e8;
|
|
|
+ border-radius: 2rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .active-set {
|
|
|
+ background-color: $Theme-Color;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .iconfont {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .set-node-text {
|
|
|
+
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-family: PingFang SC, PingFang SC-Regular;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #808080;
|
|
|
+ line-height: 1.1;
|
|
|
+ margin-left: 14rpx;
|
|
|
+
|
|
|
+ border-bottom: 2rpx dashed #707070;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ .set-profit-loss {
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ // <view class="set-profit-loss-title">
|
|
|
+ // <text class="title-name">止盈</text>
|
|
|
+ // <view class="title-btn">
|
|
|
+ // <text class="iconfont"></text>
|
|
|
+ // <text>按价格设置</text>
|
|
|
+ // </view>
|
|
|
+ // </view>
|
|
|
+ .set-profit-loss-title {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 26rpx;
|
|
|
+ padding: 30rpx 0;
|
|
|
+
|
|
|
+ .title-btn {
|
|
|
+ .iconfont {
|
|
|
+ font-size: 20rpx;
|
|
|
+ color: $Theme-Color;
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .profit-loss-input {
|
|
|
+ width: 100%;
|
|
|
+ height: 76rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ border: 1rpx solid $border-color6;
|
|
|
+
|
|
|
+ padding: 0 20rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+
|
|
|
+ text {
|
|
|
+ flex-shrink: 0;
|
|
|
+ color: $SizeColor3;
|
|
|
+ }
|
|
|
+
|
|
|
+ .input-item {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ font-size: 24rpx;
|
|
|
+ text-align: right;
|
|
|
+ padding: 0 16rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
</style>
|