Browse Source

优化

master
ltlzx 4 years ago
parent
commit
48dbbde133
  1. 17
      src/components/CommonHeader.vue
  2. 56
      src/components/KLine.vue
  3. 14
      src/i18n/en.json
  4. 39
      src/views/contract/account.vue
  5. 75
      src/views/contract/exchange-store.vue
  6. 2
      src/views/contract/hold-position.vue
  7. 6
      src/views/contract/index.vue
  8. 6
      src/views/contract/page-bottom.vue
  9. 2
      src/views/option/kline.vue
  10. 10
      src/views/wallet/exchange-assets.vue

17
src/components/CommonHeader.vue

@ -271,14 +271,11 @@ export default {
langList: [
{
value: "cn", // zh-CN
label: "简体中文"
},
{
value: "tw", // zh-TW
label: "繁体中文"
},
// {
// value: "cn", // zh-CN
// label: ""
// },
{
value: "en",
label: "English"
@ -331,6 +328,10 @@ export default {
value: 'tr',
label: 'Turkey'
},
{
value: "tw", // zh-TW
label: "繁体中文"
},
],
wallet: {

56
src/components/KLine.vue

@ -24,7 +24,7 @@ export default {
data() {
return {
model: null, //
interval: "5" // []TVresolution
interval: "1D" // []TVresolution
};
},
@ -119,44 +119,44 @@ export default {
// chartType: 3
// }, // 123
{
title: "1" + this.$t("exchange.min"),
resolution: "1",
chartType: 1
title: "1" + this.$t("exchange.min"),
resolution: "1",
chartType: 1
},
{
title: "5" + this.$t("exchange.min"),
resolution: "5",
chartType: 1
title: "5" + this.$t("exchange.min"),
resolution: "5",
chartType: 1
},
{
title: "15" + this.$t("exchange.min"),
resolution: "15",
chartType: 1
title: "15" + this.$t("exchange.min"),
resolution: "15",
chartType: 1
},
{
title: "30" + this.$t("exchange.min"),
resolution: "30",
chartType: 1
title: "30" + this.$t("exchange.min"),
resolution: "30",
chartType: 1
},
{
title: "1" + this.$t("exchange.hour"),
resolution: "60",
chartType: 1
title: "1" + this.$t("exchange.hour"),
resolution: "60",
chartType: 1
},
{
title: "1" + this.$t("exchange.day"),
resolution: "1D",
chartType: 1
title: "1" + this.$t("exchange.day"),
resolution: "D",
chartType: 1
},
{
title: "1" + this.$t("exchange.week"),
resolution: "1W",
chartType: 1
title: "1" + this.$t("exchange.week"),
resolution: "W",
chartType: 1
},
{
title: "1" + this.$t("exchange.month"),
resolution: "1M",
chartType: 1
title: "1" + this.$t("exchange.month"),
resolution: "M",
chartType: 1
}
];
@ -170,9 +170,9 @@ export default {
.addClass("my-date")
.css({
background: (index, value) => {
if (this.interval == item.resolution) {
return this.theme=='light'?'#ccc':'#091722';
}
if (this.interval == item.resolution) {
return this.theme=='light'?'#ccc':'#091722';
}
},
color: () => {
if (this.interval == item.resolution) {

14
src/i18n/en.json

@ -137,7 +137,7 @@
"myWallet": "Wallet",
"commissionOrder": "Orders",
"securitySetting": "Security",
"wallet": "Wallet",
"wallet": "Wallets",
"allAssets": "Assets",
"contractaccount": "Derivatives Account",
"transferFunds": "Transfer",
@ -800,7 +800,7 @@
"smsVer": "SMS Verification",
"enterCode": "Please enter the verification code",
"emailVer": "Email Verification",
"enterEmailVer": "Please enter the email verification code",
"enterEmailVer": "Enter the verification code",
"ver": "Verify",
"enterNameCode": "Please enter {name} verification code",
"openSuccess": "Opened successfully",
@ -835,9 +835,9 @@
"enterPhone": "Please enter your phone number",
"newPassword": "New Password",
"passwordIs": "The transaction password is {num} digits",
"enterNewPassword": "Please enter a new password",
"confirmPassword": "Confirm Password",
"pleaseConfirmPassword": "Please Confirm Password",
"enterNewPassword": "Enter a new password",
"confirmPassword": "Confirm your Password",
"pleaseConfirmPassword": "Confirm password",
"operationSuccess": "Operation Successful",
"combination": "The password requires a combination of letters and numbers",
"changeSuccess": "Modified successfully"
@ -942,7 +942,7 @@
"h6": "Change",
"h7": "High",
"h8": "Low",
"h9": "Turnover",
"h9": "Vol",
"i0": "Positions",
"i1": "Open Orders",
"i2": "Order History",
@ -974,7 +974,7 @@
"k8": "Please log in first to apply",
"k9":"Please enter the subscription code",
"l1":"Proportion of increase",
"l2":"Cost",
"l2":"Margin",
"l4":"Current valuation"
},
"otc": {

39
src/views/contract/account.vue

@ -18,7 +18,7 @@
</div>
<div class="d-flex p-3 justify-content-between">
<div>{{$t('contract.a3')}}USDT</div>
<div>{{accountInfo.usable_balance}}</div>
<div>{{(accountInfo.usable_balance).toFixed(2)}}</div>
</div>
<!-- <div class="d-flex p-3 justify-content-between">
<div>{{$t('contract.a4')}}USDT</div>
@ -48,22 +48,27 @@
</template>
<script>
export default {
name:'account',
props:{
accountInfo:{
default:()=>{},
type:Object,
required:false
}
},
data(){
return {}
},
mounted(){
console.log(this.accountInfo)
},
methods:{
name:'account',
props:{
accountInfo:{
default:()=>{},
type:Object,
required:false
}
},
data(){
return {}
},
watch:{
accountInfo(newv,oldv){
newv.account_equity=(parseFloat(newv.account_equity)).toFixed(2)
}
},
mounted(){
console.log(this.accountInfo)
},
methods:{
}
}
};
</script>

75
src/views/contract/exchange-store.vue

@ -103,7 +103,7 @@
<span class="input-group-text">{{ $t("contract.e2") }}</span>
</div> -->
</div>
<div class="px-2" v-if="this.tab == 1">
<div class="px-2 mb-4" v-if="this.tab == 1">
<el-slider
:value="activeStep"
@input="sliderChange"
@ -113,8 +113,8 @@
></el-slider>
</div>
<!-- 开仓 -->
<div v-if="tab == 1">
<div class="d-flex justify-content-between">
<div v-if="tab == 1" class="kaicang">
<div class="d-flex justify-content-between mb-3">
<!-- <div>{{ $t("contract.e3") }}</div> -->
<div>{{ $t("contract.e1") }}</div>
@ -145,11 +145,11 @@
</div>
</div>
<div class="exchange_button" v-if="tab == 1">
<div class="px-2 flex-fill mb-4">
<div class="px-1 flex-fill mb-4">
<button
@click="ifOpenPosition(1)"
type="button"
class="sub w-24/24 btn-success btn btn-sm"
class="sub w-24/24 btn-success btn btn-sm mb-3"
>
{{ $t("contract.d0") }}
<!-- <span class="fn-12"> {{ $t("contract.e6") }} </span> -->
@ -159,11 +159,11 @@
<!-- {{ $t("contract.e2") }} -->
</div>
</div>
<div class="px-2 flex-fill">
<div class="px-1 flex-fill">
<button
@click="ifOpenPosition(2)"
type="button"
class="sub w-24/24 btn-danger btn btn-sm"
class="sub w-24/24 btn-danger btn btn-sm mb-3"
>
{{ $t("contract.d2") }}
<!-- <span class="fn-12"> {{ $t("contract.e8") }} </span> -->
@ -401,33 +401,41 @@ export default {
},
//
ifOpenPosition(side) {
let typeStr =
this.form.type == 1
? `${this.form.entrust_price}${this.$t("contract.f0")}`
: this.$t("contract.d9");
let decStr =
this.tab == 1
? `${this.$t("contract.d5")}${this.form.amount}${this.$t(
"contract.e2"
)}${side == 1 ? this.$t("contract.f1") : this.$t("contract.f2")}`
: `${this.$t("contract.d6")}${this.form.amount}${this.$t(
"contract.e2"
)}`;
if (this.tab == 1) {
this.openPosition(side);
} else {
this.closePosition(side);
}
// let typeStr =
// this.form.type == 1
// ? `${this.form.entrust_price}${this.$t("contract.f0")}`
// : this.$t("contract.d9");
// let decStr =
// this.tab == 1
// ? `${this.$t("contract.d5")}${this.form.amount}${this.$t(
// "contract.e2"
// )}${side == 1 ? this.$t("contract.f1") : this.$t("contract.f2")}`
// : `${this.$t("contract.d6")}${this.form.amount}${this.$t(
// "contract.e2"
// )}`;
// `${this.$t("contract.f3")}${typeStr}${this.form.lever_rate}${this.$t(
// "contract.f4"
// )}${decStr}?`
this.$confirm(
`${this.$t("contract.f3")}${typeStr}${this.form.lever_rate}
${this.$t("contract.f4")}${this.$t("contract.d5")}?`
)
.then(res => {
if (this.tab == 1) {
this.openPosition(side);
} else {
this.closePosition(side);
}
})
.catch(res => {});
// this.$confirm(
// `${this.$t("contract.f3")}${typeStr}${this.form.lever_rate}
// ${this.$t("contract.f4")}${this.$t("contract.d5")}?`
// )
// .then(res => {
// if (this.tab == 1) {
// this.openPosition(side);
// } else {
// this.closePosition(side);
// }
// })
// .catch(res => {});
},
//
openPosition(side) {
@ -465,5 +473,10 @@ export default {
<style scoped="scoped">
.exchange_button{
display: flex;
font-size: 16px !important;
}
.btn,.kaicang{
font-size: 0.9rem;
}
</style>

2
src/views/contract/hold-position.vue

@ -51,7 +51,7 @@
<td>{{ item.avg_price * 1 }}</td>
<td>{{ item.realtimePrice }}</td>
<td>{{ item.flatPrice }}</td>
<td :class="item.unRealProfit>0?'increace':item.unRealProfit<0?'decreace':''">{{ item.unRealProfit }}</td>
<td :class="item.unRealProfit>0?'increace':item.unRealProfit<0?'decreace':''">{{ (parseFloat(item.unRealProfit)).toFixed(2) }}</td>
<td>{{ item.profitRate }}</td>
<td>{{ item.tpPrice || "--" }}/{{ item.slPrice || "--" }}</td>
<td>

6
src/views/contract/index.vue

@ -89,7 +89,7 @@
<div class="d-flex fn-12">
<div class="item px-2">
<div class="title mb-1 text-secondary">
24H {{ $t("contract.h7") }}
24h {{ $t("contract.h7") }}
</div>
<div>
{{ activeContract.high }}
@ -97,7 +97,7 @@
</div>
<div class="item px-2">
<div class="title mb-1 text-secondary">
24H {{ $t("contract.h8") }}
24h {{ $t("contract.h8") }}
</div>
<div>
{{ activeContract.low }}
@ -105,7 +105,7 @@
</div>
<div class="item px-2">
<div class="title mb-1 text-secondary">
24H {{ $t("contract.h9") }}
24h {{ $t("contract.h9") }}
<!-- {{ $t("contract.e2") }} -->
(USDT)
</div>

6
src/views/contract/page-bottom.vue

@ -100,3 +100,9 @@ export default {
}
};
</script>
<style scoped>
.bg-plain{
width: 367px !important;
font-size: 16px;
}
</style>

2
src/views/option/kline.vue

@ -118,7 +118,7 @@ data() {
onLoadedCallback: undefined,
onRealtimeCallback: undefined,
// timer: "15",
timer: "5",
timer: "1D",
sub: "",
isCreateSocket: false,
page: {},

10
src/views/wallet/exchange-assets.vue

@ -34,7 +34,7 @@
<div class="my-1">
<span class="num h2 light-purple">
<template v-if="showValue">{{userAssets.total_assets_usd|omitTo(4)}}</template>
<template v-if="showValue">{{userAssets.total_assets_usd|omitTo(2)}}</template>
<template v-else>********</template>
</span>
USD
@ -45,7 +45,7 @@
<div class="label">{{$t('wallet.capitalAccount')}}</div>
<div>
<span class="num h3 light-purple">
<template v-if="showValue">{{userAssets.funds_account_usd|omitTo(4)}}</template>
<template v-if="showValue">{{userAssets.funds_account_usd|omitTo(2)}}</template>
<template v-else>********</template>
</span>
USDT
@ -67,7 +67,7 @@
<div class="label">{{$t('common.contractaccount')}}</div>
<div>
<span class="num h3 light-purple">
<template v-if="showValue">{{userAssets.contract_account_usd|omitTo(4)}}</template>
<template v-if="showValue">{{userAssets.contract_account_usd|omitTo(2)}}</template>
<template v-else>********</template>
</span>
USDT
@ -135,9 +135,9 @@
{{ item.coin_name }}
</td>
<!-- <td>{{ item.freeze_balance|add(item.usable_balance) }}</td> -->
<td>{{item.usable_balance}}</td>
<td>{{item.usable_balance |omitTo(2)}}</td>
<td>{{item.freeze_balance}}</td>
<td>{{item.usd_estimate}}</td>
<td>{{item.usd_estimate |omitTo(2)}}</td>
<td>
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
<!-- data-target="#deposite" -->

Loading…
Cancel
Save