Browse Source

修改订单列表的数据

master
j1ack 3 years ago
parent
commit
fc30384c61
  1. 118
      components/entrustOrderList/entrustOrderList.vue
  2. 9
      components/transaction/transaction.vue
  3. 2
      pages/login/forget.vue
  4. 4
      pages/markets/trade.vue
  5. 13
      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

118
components/entrustOrderList/entrustOrderList.vue

@ -19,9 +19,16 @@
<text class="time">{{item.timestr}}</text> <text class="time">{{item.timestr}}</text>
<text class="closeTimeTitle" v-show="type === 2">{{ i18n.CloseTime }}</text> <text class="closeTimeTitle" v-show="type === 2">{{ i18n.CloseTime }}</text>
<text class="closeTime" v-show="type === 2">{{item.timestr2}}</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 i18n.close
}}</view> }}</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>
<view class="infoBody"> <view class="infoBody">
@ -34,6 +41,9 @@
<view class="value">{{item.bondAmount}}</view> <view class="value">{{item.bondAmount}}</view>
<view class="title" v-show="type == 1||type == 2">{{ i18n.StyPrice }}</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="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>
<!-- 公共的 --> <!-- 公共的 -->
<view class="center"> <view class="center">
@ -43,6 +53,12 @@
<view class="value">{{item.fee}}</view> <view class="value">{{item.fee}}</view>
<view class="title" v-show="type == 1||type == 2">{{ i18n.StsPrice }}</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="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> </view>
<!-- Current Entrust Position--> <!-- Current Entrust Position-->
<view class="right" v-show="type === 0 || type === 1"> <view class="right" v-show="type === 0 || type === 1">
@ -52,16 +68,23 @@
<view class="value" v-show="type === 0"> <view class="value" v-show="type === 0">
{{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> --> </view> -->
<view class="title" v-show="type === 1">{{ i18n.do }}</view> <view class="title" v-show="type === 1">{{ i18n.ROE }}</view>
<view class="value" style="color:#00E8A2;" v-show="type === 1" @click="getStopLimit(item)"> <view class="value" style="color:#00E8A2;" v-show="type === 1">
{{ i18n.StopLimit }} {{getValue(item.profitAmount/item.bondAmount)}}%
</view> </view>
<view class="title" v-show="type === 1||type === 2">{{ i18n.ExpectProfit }}</view> <view class="title" v-show="type === 1||type === 2">{{ i18n.ExpectProfit }}</view>
<view class="value" v-show="type === 1" <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'"> :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)}} {{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}}
</view> </view>
<view class="value" style="color:#00E8A2;" v-show="type === 2">0</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> </view>
<!-- Closed --> <!-- Closed -->
<view class="right" v-show="type === 2"> <view class="right" v-show="type === 2">
@ -83,16 +106,16 @@
</view> </view>
</view> </view>
<!-- Revoked --> <!-- Revoked -->
<view class="right" v-show="type === 3"> <!-- <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;"> <view class="value" style="color:#F4506A;">
{{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> --> </view>
<view class="title">{{ i18n.PL }}</view> <view class="title">{{ i18n.PL }}</view>
<view class="value" style="color:#00E8A2;"> <view class="value" style="color:#00E8A2;">
<!-- {{item.currentPl}} --> 0 0
</view>
</view> </view>
</view> -->
</view> </view>
</view> </view>
@ -133,10 +156,29 @@
<button class="btn add" @click="stsValueChange('add')"></button> <button class="btn add" @click="stsValueChange('add')"></button>
</view> </view>
</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-modal>
<u-empty :text="i18n.Dataisempty" mode="data" v-if="!list.length"></u-empty> <u-empty :text="i18n.Dataisempty" mode="data" v-if="!list.length"></u-empty>
</view> </view>
</template> </template>
@ -196,6 +238,7 @@
status: 'undone', status: 'undone',
closeModalShow: false, closeModalShow: false,
stopModalShow: false, stopModalShow: false,
stopModalShowZui:false,
type: 0, type: 0,
test: 0, test: 0,
dealList: [{ dealList: [{
@ -266,6 +309,7 @@
i = String(i) i = String(i)
return i.substring(0, i.indexOf(".") + 5); return i.substring(0, i.indexOf(".") + 5);
}, },
stopModalChange() { stopModalChange() {
if (this.stopLimitData.direction === 'buy') { if (this.stopLimitData.direction === 'buy') {
if (this.styValue) if (this.styValue)
@ -298,7 +342,15 @@
this.profit = 0 this.profit = 0
this.loss = 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) { closeItem(item, i) {
this.itemData = item this.itemData = item
@ -378,6 +430,7 @@
* stop确认弹窗 * stop确认弹窗
*/ */
stopConfirm() { stopConfirm() {
if(this.stopModalShow){
if (this.styValue < 0 || this.stsValue < 0) { if (this.styValue < 0 || this.stsValue < 0) {
uni.showToast({ uni.showToast({
title: this.i18n.lessThan, title: this.i18n.lessThan,
@ -396,8 +449,33 @@
this.stopModalShow = false this.stopModalShow = false
setTimeout(() => { setTimeout(() => {
this.getContractOrderList() this.getContractOrderList()
}, 600) }, 800)
});
}
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值变化 * styValue值变化
@ -453,6 +531,23 @@
</script> </script>
<style scoped lang="scss"> <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 { /deep/ .u-empty {
top: 500% !important; top: 500% !important;
} }
@ -528,6 +623,7 @@
font-size: 24rpx; font-size: 24rpx;
text-align: center; text-align: center;
color: #F4506A; color: #F4506A;
margin-top: 0;
} }
} }

9
components/transaction/transaction.vue

@ -144,6 +144,12 @@
handler: function (n,i) { handler: function (n,i) {
this.leverageValue = n.leverage[0]; this.leverageValue = n.leverage[0];
} }
},
marketDetail: {
deep: true,
handler: function (n,i) {
this.coinPrice = n.close
}
} }
}, },
mounted() { mounted() {
@ -158,7 +164,8 @@
selectChange(index) { selectChange(index) {
this.priceTypeValue = index; this.priceTypeValue = index;
this.priceSelectListShow = false; this.priceSelectListShow = false;
this.coinPrice = this.marketDetail.low // this.coinPrice = this.marketDetail.low
this.coinPrice = this.marketDetail.close
}, },
leverageSelectChange(item) { leverageSelectChange(item) {
this.leverageValue = 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" <u-input class="input" v-model="userInfo.code" color="#fff" fontSize="32rpx" border="none"
:placeholder="i18n.registerWelcomeText" maxlength="6"> :placeholder="i18n.registerWelcomeText" maxlength="6">
</u-input> </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"> @change="codeChange">
</u-code> </u-code>
<u-button class="getVCodeBtn" color="#323045" @tap="getCode">{{tips}}</u-button> <u-button class="getVCodeBtn" color="#323045" @tap="getCode">{{tips}}</u-button>

4
pages/markets/trade.vue

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

13
pages/withdrawal/addAddress.vue

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

2
pages/withdrawal/chooseAddress.vue

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

1
utils/api.js

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

3
utils/language/en_US.js

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

2
utils/language/vi_VN.js

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

7
utils/language/zh_TW.js

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

Loading…
Cancel
Save