Browse Source

修改订单列表的数据

master
j1ack 3 years ago
parent
commit
fc30384c61
  1. 158
      components/entrustOrderList/entrustOrderList.vue
  2. 13
      components/transaction/transaction.vue
  3. 2
      pages/login/forget.vue
  4. 4
      pages/markets/trade.vue
  5. 15
      pages/withdrawal/addAddress.vue
  6. 2
      pages/withdrawal/chooseAddress.vue
  7. 1
      utils/api.js
  8. 3
      utils/language/en_US.js
  9. 2
      utils/language/vi_VN.js
  10. 7
      utils/language/zh_TW.js

158
components/entrustOrderList/entrustOrderList.vue

@ -19,9 +19,16 @@
<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>
<text class="righttype3" v-show="type === 3">
<text class="title">{{ i18n.PL }}:{{" "}}</text>
<text class="value" style="color:#00E8A2;">
<!-- {{item.currentPl}} --> 0
</text>
</text>
</view>
<view class="infoBody">
@ -34,6 +41,9 @@
<view class="value">{{item.bondAmount}}</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">
@ -43,6 +53,12 @@
<view class="value">{{item.fee}}</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">
@ -52,16 +68,23 @@
<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.do }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)">
{{ i18n.StopLimit }}
<view class="title" v-show="type === 1">{{ i18n.ROE }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1">
{{getValue(item.profitAmount/item.bondAmount)}}%
</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">
@ -83,16 +106,16 @@
</view>
</view>
<!-- Revoked -->
<view class="right" v-show="type === 3">
<!-- <view class="title">{{ i18n.status }}</view>
<!-- <view class="right" v-show="type === 3">
<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> -->
</view>
</view>
@ -133,9 +156,28 @@
<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>
@ -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 @@
</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;
}
@ -528,6 +623,7 @@
font-size: 24rpx;
text-align: center;
color: #F4506A;
margin-top: 0;
}
}

13
components/transaction/transaction.vue

@ -144,7 +144,13 @@
handler: function (n,i) {
this.leverageValue = n.leverage[0];
}
}
},
marketDetail: {
deep: true,
handler: function (n,i) {
this.coinPrice = n.close
}
}
},
mounted() {
this.leverageValue = this.contractConfig.leverage[0];
@ -157,8 +163,9 @@
},
selectChange(index) {
this.priceTypeValue = index;
this.priceSelectListShow = false;
this.coinPrice = this.marketDetail.low
this.priceSelectListShow = false;
// this.coinPrice = this.marketDetail.low
this.coinPrice = this.marketDetail.close
},
leverageSelectChange(item) {
this.leverageValue = item;

2
pages/login/forget.vue

@ -25,7 +25,7 @@
<u-input class="input" v-model="userInfo.code" color="#fff" fontSize="32rpx" border="none"
:placeholder="i18n.registerWelcomeText" maxlength="6">
</u-input>
<u-code startText="Get code" :seconds="seconds" ref="uCode" keep-running unique-key="login"
<u-code :startText="i18n.Getcode" :seconds="seconds" ref="uCode" keep-running unique-key="login"
@change="codeChange">
</u-code>
<u-button class="getVCodeBtn" color="#323045" @tap="getCode">{{tips}}</u-button>

4
pages/markets/trade.vue

@ -239,11 +239,11 @@
*/
switchTo(item) {
this.popupShow = false;
this.getContractConfig();
this.websock.unSubBbo(this.symbol.symbol)
this.websock.unSubTrade(this.symbol.symbol)
this.symbol = item;
uni.setStorageSync('symbol', this.symbol);
this.getContractConfig();
this.getMarketDetail()
this.getBboList();
this.websock.subBbo(this.symbol.symbol)
@ -340,7 +340,7 @@
color: #818197;
margin-left: 16rpx;
display: flex;
justify-content: space-evenly;
.center {
width: 190rpx;
padding-left: 30rpx;

15
pages/withdrawal/addAddress.vue

@ -2,7 +2,15 @@
<view class="main">
<!-- nav -->
<navigation>{{ i18n.AddAddress }} </navigation>
<view class="body">
<!-- #ifdef H5 -->
<view class="body">
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="body-APP">
<!-- #endif -->
<!-- coin选择框 -->
<view class="choose-item">
<u-input class="input inputbg" v-model="coinInfo.coinCode" color="#fff" fontSize="32rpx" border="none"
@ -241,6 +249,11 @@ export default {
margin-top: 200rpx;
padding: 32rpx;
}
.body-APP{
margin-top: 200rpx !important;
padding: 32rpx;
}
.choose-item {
overflow: hidden;

2
pages/withdrawal/chooseAddress.vue

@ -225,6 +225,8 @@
line-height: 56rpx;
position: absolute;
right: 32rpx;
top: 50%;
transform: translateY(-50%);
font-size: 24rpx;
background: rgba(246, 166, 9, 0.1);
border-radius: 8px;

1
utils/api.js

@ -39,6 +39,7 @@ const api = {
contractClosed: (params) => Vue.prototype.$axios.post('/api/contract/closed',params),//合约订单平仓
contractConfig: (params) => Vue.prototype.$axios.post('/api/contract/contractConfig',params),//合约配置
contractOrderList: (params) => Vue.prototype.$axios.post('/api/contract/orderList',params),//合约订单列表
addBond: (params) => Vue.prototype.$axios.post('/api/contract/addBond',params),//追加保证金
//--------------------------------- transfer ---------------------------------
getTransferConfig: (params) => Vue.prototype.$axios.post('/api/transfer/getTransferConfig',params),//获取转账配置配置

3
utils/language/en_US.js

@ -95,6 +95,8 @@ export default {
// 合约页面相关
markets: {
Margincall:'Margin call',
ROE:'ROE',
// 漏掉的国际化
@ -156,6 +158,7 @@ export default {
BuyingPrice:'Buying Price',
SellPrice:'Sell Price',
open:'Open',
AmountTrue:'Amount',
},
// 捐赠页面相关

2
utils/language/vi_VN.js

@ -93,6 +93,7 @@ export default {
// 合约页面相关
markets: {
Margincall:'Gọi Lề',
ROE:'Thua',
// 漏掉的国际化
@ -154,6 +155,7 @@ export default {
BuyingPrice: 'giá mua',
SellPrice: 'gia ban',
open: 'mở một vị trí',
AmountTrue:'lượng',
},
// 捐赠页面相关

7
utils/language/zh_TW.js

@ -95,6 +95,9 @@ export default {
// 合约页面相关
markets: {
ROE:'收益率',
Margincall:'追加保證金',
// 漏掉的国际化
undone:'未成交',
opened:'已開倉',
@ -155,6 +158,8 @@ export default {
BuyingPrice:'買價',
SellPrice:'賣價',
open:'開倉',
AmountTrue:'數量',
},
// 捐赠页面相关
@ -357,7 +362,7 @@ export default {
ConfirmAmount: '確認金額',
USDT: 'USDT',
Time: '時間',
CheckTheNumberoOfUSDT: '查看USDT數量',
CheckTheNumberoOfUSDT: '確認USDT數量',
// Subscription
Subscription: '申購',
Days: '天',

Loading…
Cancel
Save