Browse Source

优化

master
ltlzx 4 years ago
parent
commit
6b6af59461
  1. 52
      i18n/lang/en.json
  2. 23
      pages/base/mine.vue
  3. 8
      pages/exchange/index.vue
  4. 64
      pages/exchange/open-position.vue
  5. 4
      pages/exchange/symbol-list.vue
  6. 2
      pages/safe/forget-password.vue
  7. 8
      pages/safe/index.vue
  8. 19
      store/index.js

52
i18n/lang/en.json

@ -91,7 +91,7 @@
"b8": "Deduct the handling fee", "b8": "Deduct the handling fee",
"b9": "Available", "b9": "Available",
"c0": "Buy", "c0": "Buy",
"c1": "My Commission", "c1": "My wallets",
"c2": "Identity Authentication", "c2": "Identity Authentication",
"c3": "Security Center", "c3": "Security Center",
"c4": "Message Notification", "c4": "Message Notification",
@ -102,7 +102,7 @@
"c9": "Cancelled successfully", "c9": "Cancelled successfully",
"d0": "Home", "d0": "Home",
"d1": "Transaction", "d1": "Transaction",
"d2": "Wallet", "d2": "Wallets",
"d3": "Please enter search keywords", "d3": "Please enter search keywords",
"d4": "All", "d4": "All",
"d5": "Motherboard", "d5": "Motherboard",
@ -129,7 +129,7 @@
"a6": "Binding", "a6": "Binding",
"a7": "Mailbox binding", "a7": "Mailbox binding",
"a8": "Switch account", "a8": "Switch account",
"a9": "Logout", "a9": "Log Out",
"b0": "Modify Nickname", "b0": "Modify Nickname",
"b1": "Please enter a nickname", "b1": "Please enter a nickname",
"b2": "Language" "b2": "Language"
@ -262,8 +262,8 @@
"e0": "Please enter the total price", "e0": "Please enter the total price",
"e1": "Order successfully placed", "e1": "Order successfully placed",
"e2": "Average Price", "e2": "Average Price",
"e3": "Highest", "e3": "High",
"e4": "Lowest", "e4": "Low",
"e5": "amount", "e5": "amount",
"e6": "Order", "e6": "Order",
"e7": "Currency Information", "e7": "Currency Information",
@ -358,21 +358,21 @@
}, },
"reg": { "reg": {
"a0": "Mobile registration", "a0": "Mobile registration",
"a1": "Mailbox Registration", "a1": "Regiser Account",
"a2": "Mobile", "a2": "Email",
"a3": "Please enter your phone number", "a3": "Enter your email address",
"a4": "Mailbox", "a4": "Mailbox",
"a5": "Please enter the mailbox number", "a5": "Please enter the mailbox number",
"a6": "Verification Code", "a6": "Email verification Code",
"a7": "Please enter the verification code", "a7": "Enter the email verification code",
"a8": "Password", "a8": "Password",
"a9": "Please enter a password", "a9": "Enter a password",
"b0": "Confirm Password", "b0": "Confirm Password",
"b1": "Please confirm your password", "b1": "Confirm your password",
"b2": "Recommended person", "b2": "Recommended person",
"b3": "Please enter the recommender", "b3": "Please enter the recommender",
"b4": "Optional", "b4": "Optional",
"b5": "You have agreed", "b5": "I have agreed",
"b6": "User Agreement", "b6": "User Agreement",
"b7": "and understand ours", "b7": "and understand ours",
"b8": "Privacy Agreement", "b8": "Privacy Agreement",
@ -383,8 +383,8 @@
"c3": "Please fill in the phone number", "c3": "Please fill in the phone number",
"c4": "Please fill in the mailbox number", "c4": "Please fill in the mailbox number",
"c5": "Registered successfully", "c5": "Registered successfully",
"c6":"Invitation code (required)", "c6":"Referral ID(required)",
"c7":"Please fill in the invitation code" "c7":"Fill in the referral ID"
}, },
"safe": { "safe": {
"a0": "Untie", "a0": "Untie",
@ -393,17 +393,17 @@
"a3": "Mailbox Number", "a3": "Mailbox Number",
"a4": "Please enter the mailbox number", "a4": "Please enter the mailbox number",
"a5": "Email Verification Code", "a5": "Email Verification Code",
"a6": "Please enter the verification code", "a6": "Enter the verification code",
"a7": "Verification Code", "a7": "Verification Code",
"a8": "Unbind successfully", "a8": "Unbind successfully",
"a9": "Binding successful", "a9": "Binding successful",
"b0": "Forgot login password", "b0": "Forgot login password",
"b1": "Account", "b1": "Account",
"b2": "Please enter your phone", "b2": "Enter your email",
"b3": "New Password", "b3": "New Password",
"b4": "Please enter a new password", "b4": "Enter a new password",
"b5": "Confirm Password", "b5": "Confirm Password",
"b6": "Please confirm your password", "b6": "Confirm your password",
"b7": "Confirm Modification", "b7": "Confirm Modification",
"b8": "Please enter the correct phone or email number", "b8": "Please enter the correct phone or email number",
"b9": "Google Authenticator", "b9": "Google Authenticator",
@ -415,7 +415,7 @@
"c5": "Google Verification Code", "c5": "Google Verification Code",
"c6": "Confirm binding", "c6": "Confirm binding",
"c7": "Security Center", "c7": "Security Center",
"c8": "login password", "c8": "Login Password",
"c9": "Modify", "c9": "Modify",
"d0": "Settings", "d0": "Settings",
"d1": "Transaction Password", "d1": "Transaction Password",
@ -495,11 +495,11 @@
"a2": "Classification" "a2": "Classification"
}, },
"login": { "login": {
"a0": "Mobile phone or mailbox number", "a0": "Email",
"a1": "Please enter your phone or email number", "a1": "Enter your email",
"a2": "Password", "a2": "Password",
"a3": "Please enter a password", "a3": "Enter your password",
"a4": "Login", "a4": "Log In ",
"a5": "Forgot Password", "a5": "Forgot Password",
"a6": "No account", "a6": "No account",
"a7": "Register Now", "a7": "Register Now",
@ -552,7 +552,7 @@
"e1": "Can open more", "e1": "Can open more",
"e2": "sell", "e2": "sell",
"e3": "Can open empty", "e3": "Can open empty",
"e4": "Available Max", "e4": "Available Founds",
"e5": "Transfer", "e5": "Transfer",
"e6": "Fund Rate", "e6": "Fund Rate",
"e7": "Distance settlement", "e7": "Distance settlement",
@ -739,7 +739,7 @@
"a9":"multiple", "a9":"multiple",
"b0":"Are you sure you want to log out?", "b0":"Are you sure you want to log out?",
"b1":"Sign in or register", "b1":"Sign in or register",
"b2":"Hi, welcome to AMATAK", "b2":"Hi, welcome to NHACOIN",
"b3":"amount", "b3":"amount",
"b4":"spot index ", "b4":"spot index ",
"b5":"Contract index", "b5":"Contract index",

23
pages/base/mine.vue

@ -15,11 +15,11 @@
</view> </view>
</view> </view>
<view class="m-t-md d-flex flex-wrap justify-center fn-center w-max"> <view class="m-t-md d-flex flex-wrap justify-center fn-center w-max">
<text class="fn-28 w-max">{{ filterMoney(account.total_assets_btc) }}</text> <text class="fn-28 w-max">{{ filterMoney(account.total_assets_btc,true) }}</text>
<text class="fn-sm m-l-md w-max" <text class="fn-sm m-l-md w-max"
> >
<!-- {{ filterMoney(account.total_assets_usd) }} USD --> <!-- {{ filterMoney(account.total_assets_usd) }} USD -->
{{ (account.total_assets_usd).toFixed(4) }} USD {{ filterMoney(account.total_assets_usd,false) }} USD
</text> </text>
</view> </view>
@ -121,7 +121,7 @@
<text class="fn-20 d-block color-light m-t-xs" <text class="fn-20 d-block color-light m-t-xs"
> >
<!-- {{ filterMoney(account.funds_account_usd) }} --> <!-- {{ filterMoney(account.funds_account_usd) }} -->
{{ (account.funds_account_usd).toFixed(4) }} {{ (account.funds_account_usd).toFixed(2) }}
</text> </text>
<text class="fn-sm d-block color-gray-6 m-t-xs" <text class="fn-sm d-block color-gray-6 m-t-xs"
>{{ $t("base.d6") }}(USDT)</text> >{{ $t("base.d6") }}(USDT)</text>
@ -195,7 +195,7 @@
<p class="color-gray-6" style="padding: 5px 0"> <p class="color-gray-6" style="padding: 5px 0">
{{ $t("base.b9") }} {{ $t("base.b9") }}
</p> </p>
<p class="fn-lg color-light overflow-scroll">{{ item.usable_balance }}</p> <p class="fn-lg color-light overflow-scroll">{{ (item.usable_balance).toFixed(2) }}</p>
</view> </view>
<view class="w-4/12 fn-center"> <view class="w-4/12 fn-center">
<p class="color-gray-6" style="padding: 5px 0"> <p class="color-gray-6" style="padding: 5px 0">
@ -208,7 +208,7 @@
{{ $t("base.e3") }}(USD) {{ $t("base.e3") }}(USD)
</p> </p>
<p class="fn-lg color-light overflow-scroll"> <p class="fn-lg color-light overflow-scroll">
{{ omitTo(item.usd_estimate, item.priceDecimals) }} {{ omitTo(item.usd_estimate, item.priceDecimals) | priceDecimals}}
</p> </p>
</view> </view>
</view> </view>
@ -351,6 +351,12 @@ export default {
this.upDateData(); this.upDateData();
} }
}, },
filters:{
priceDecimals(val){
console.info(val)
return (parseFloat(val)).toFixed(2)
}
},
methods: { methods: {
onRefresh(){ onRefresh(){
if (this.refreshing) return; if (this.refreshing) return;
@ -370,9 +376,14 @@ export default {
...mapActions({ ...mapActions({
setHide: "hideMoney", setHide: "hideMoney",
}), }),
filterMoney(val) { filterMoney(val,type) {
if (this.hideMoney) return "******"; if (this.hideMoney) return "******";
if(type){
return this.omitTo(val, 8); return this.omitTo(val, 8);
}else{
return this.omitTo(val, 2);
}
}, },
ifShow(item) { ifShow(item) {

8
pages/exchange/index.vue

@ -40,15 +40,15 @@
<view class="col fn-right justify-center d-flex flex-col"> <view class="col fn-right justify-center d-flex flex-col">
<table> <table>
<tr> <tr>
<td>24H{{ $t("exchange.e3") }}</td> <td>24h {{ $t("exchange.e3") }}</td>
<td class="color-light">{{ activeCoin.high }}</td> <td class="color-light">{{ activeCoin.high }}</td>
</tr> </tr>
<tr> <tr>
<td>24H{{ $t("exchange.e4") }}</td> <td>24h {{ $t("exchange.e4") }}</td>
<td class="color-light">{{ activeCoin.low }}</td> <td class="color-light">{{ activeCoin.low }}</td>
</tr> </tr>
<tr v-if="!query.contract"> <tr v-if="!query.contract">
<td>24H{{ $t("exchange.e5") }}</td> <td>24h {{ $t("exchange.e5") }}</td>
<!-- <td class="color-light">{{ (activeCoin.vol).toFixed(4)}}</td> --> <!-- <td class="color-light">{{ (activeCoin.vol).toFixed(4)}}</td> -->
<td class="color-light">{{activeCoin.vol}}</td> <td class="color-light">{{activeCoin.vol}}</td>
</tr> </tr>
@ -209,7 +209,7 @@ export default {
buyList: [], buyList: [],
sellList: [], sellList: [],
tradeList: [], tradeList: [],
activeTime: "5", activeTime: "1D",
index: "", index: "",
marketList: [], marketList: [],
collect: [], collect: [],

64
pages/exchange/open-position.vue

@ -28,7 +28,7 @@
<view class="item w-33 t-no positions"> <view class="item w-33 t-no positions">
<view class="label">{{ $t("contract.d4") }}(USDT)</view> <view class="label">{{ $t("contract.d4") }}(USDT)</view>
<view class="num color-light d-flex align-center" style="margin-top:8px;"> <view class="num color-light d-flex align-center" style="margin-top:8px;">
<text>{{accountInfo.account_equity || "--"}}</text> <text>{{ accountInfo.account_equity || "--"}}</text>
<van-icon name="exchange bg-form-panel-3" @click="_router.push('/pages/transfer/index')" class="p-l-xs color-theme-1 icon"/> <van-icon name="exchange bg-form-panel-3" @click="_router.push('/pages/transfer/index')" class="p-l-xs color-theme-1 icon"/>
</view> </view>
</view> </view>
@ -203,8 +203,8 @@
block block
class="w-max rounded" class="w-max rounded"
> >
{{ $t("contract.c0") }} <span class="but_text">{{ $t("contract.c0") }}</span>
<span class="fn-10">({{ $t("contract.e0") }})</span> <span class="fn-10 but_right">{{ $t("contract.e0") }}</span>
</v-button> </v-button>
</template> </template>
<template v-else> <template v-else>
@ -236,8 +236,8 @@
block block
class="w-max rounded" class="w-max rounded"
> >
{{ $t("contract.c2") }} <span class="but_text">{{ $t("contract.c2") }}</span>
<span class="fn-10">({{ $t("contract.e2") }})</span> <span class="fn-10 but_right">{{ $t("contract.e2") }}</span>
</v-button> </v-button>
</template> </template>
<template v-else> <template v-else>
@ -1166,6 +1166,9 @@ export default {
// }; // };
Contract.holdPosition(data, { loading: !boo }).then((res) => { Contract.holdPosition(data, { loading: !boo }).then((res) => {
this.list = res.data.filter((item) => item.hold_position); this.list = res.data.filter((item) => item.hold_position);
this.list.map(item=>{
item.unRealProfit=(parseFloat(item.unRealProfit)).toFixed(2)
})
if (!boo) { if (!boo) {
this.sendPrice(); this.sendPrice();
} }
@ -1237,6 +1240,9 @@ export default {
symbol: this.symbolLeft, symbol: this.symbolLeft,
}; };
Contract.contractAccount(data, { loading: !boo,toast:false }).then((res) => { Contract.contractAccount(data, { loading: !boo,toast:false }).then((res) => {
// console.info(res)
res.data.account_equity=(parseInt(res.data.account_equity)).toFixed(2)
res.data.usable_balance=(res.data.usable_balance).toFixed(2)
this.accountInfo = res.data; this.accountInfo = res.data;
if (!boo) { if (!boo) {
// this.form.lever_rate = res.data.lever_rate; // this.form.lever_rate = res.data.lever_rate;
@ -1291,25 +1297,26 @@ export default {
}, },
// //
ifOpenPosition(side) { ifOpenPosition(side) {
console.info(this.form.lever_rate)
this.$dialog
.confirm({
title: this.$t("contract.c4"),
message: `${this.$t("contract.f7")}${
this.form.type == 0
? this.form.entrust_price
: this.$t("contract.d7")
}${this.$t("contract.f8")}${this.form.lever_rate}${this.$t(
"contract.f9"
)}${this.form.amount}${this.$t("contract.d8")}${
side == 1 ? this.$t("contract.g0") : this.$t("contract.g1")
}?`,
confirmButtonText: this.$t("common.confirm"), //
cancelButtonText: this.$t("common.cancel")
})
.then(() => {
this.openPosition(side); this.openPosition(side);
}); // console.info(this.form.lever_rate)
// this.$dialog
// .confirm({
// title: this.$t("contract.c4"),
// message: `${this.$t("contract.f7")}${
// this.form.type == 0
// ? this.form.entrust_price
// : this.$t("contract.d7")
// }${this.$t("contract.f8")}${this.form.lever_rate}${this.$t(
// "contract.f9"
// )}${this.form.amount}${this.$t("contract.d8")}${
// side == 1 ? this.$t("contract.g0") : this.$t("contract.g1")
// }?`,
// confirmButtonText: this.$t("common.confirm"), //
// cancelButtonText: this.$t("common.cancel")
// })
// .then(() => {
// this.openPosition(side);
// });
}, },
// //
openPosition(side) { openPosition(side) {
@ -1801,4 +1808,15 @@ export default {
.decreace{ .decreace{
color: #ff231f; color: #ff231f;
} }
.rounded{
position: relative;
}
.but_right{
position: absolute;
right: 15px;
}
.but_text{
font-size: 14px;
}
</style> </style>

4
pages/exchange/symbol-list.vue

@ -118,13 +118,15 @@ export default {
}); });
}); });
let arr = [ let arr = [
...this.marketList,
{ {
coin_name: this.$t("exchange.g0"), coin_name: this.$t("exchange.g0"),
isCollect: true, isCollect: true,
marketInfoList: collects, marketInfoList: collects,
}, },
...this.marketList,
]; ];
// console.info(arr)
return arr; return arr;
}, },
}, },

2
pages/safe/forget-password.vue

@ -6,7 +6,7 @@
<view class="form-item border-b p-md"> <view class="form-item border-b p-md">
<view class="label m-b-xs">{{$t('safe.b1')}}</view> <view class="label m-b-xs">{{$t('safe.b1')}}</view>
<view class="input color-light"> <view class="input color-light">
<v-input v-model="form.account" :placeholder="`${$t('safe.b2')}/${$t('safe.a3')}`" @blur="checkAccount"></v-input> <v-input v-model="form.account" :placeholder="`${$t('safe.b2')}`" @blur="checkAccount"></v-input>
</view> </view>
</view> </view>
<view class="form-item border-b p-md"> <view class="form-item border-b p-md">

8
pages/safe/index.vue

@ -38,7 +38,7 @@
<van-icon name="arrow" /> <van-icon name="arrow" />
</v-link> --> </v-link> -->
<!-- -----------邮箱--------- --> <!-- -----------邮箱--------- -->
<v-link <!-- <v-link
tag="li" tag="li"
to="/pages/safe/email" to="/pages/safe/email"
class="item link-active d-flex p-x-md p-y-md align-center border-b" class="item link-active d-flex p-x-md p-y-md align-center border-b"
@ -48,9 +48,9 @@
<van-switch v-if="user.email" @click.native.stop @input="switchVer(2)" size="28rpx" :checked="user.email_status==1" /> <van-switch v-if="user.email" @click.native.stop @input="switchVer(2)" size="28rpx" :checked="user.email_status==1" />
</view> </view>
<van-icon name="arrow" /> <van-icon name="arrow" />
</v-link> </v-link> -->
<!-- ----------手机---------- --> <!-- ----------手机---------- -->
<v-link <!-- <v-link
tag="li" tag="li"
to="/pages/safe/phone" to="/pages/safe/phone"
class="item link-active d-flex p-x-md p-y-md align-center border-b" class="item link-active d-flex p-x-md p-y-md align-center border-b"
@ -60,7 +60,7 @@
<van-switch v-if="user.phone" @click.native.stop @input="switchVer(1)" size="28rpx" :checked="user.phone_status==1" /> <van-switch v-if="user.phone" @click.native.stop @input="switchVer(1)" size="28rpx" :checked="user.phone_status==1" />
</view> </view>
<van-icon name="arrow" /> <van-icon name="arrow" />
</v-link> </v-link> -->
</view> </view>
</main> </main>
<van-popup <van-popup

19
store/index.js

@ -77,14 +77,11 @@ let store = new Vuex.Store({
value: 'en', value: 'en',
label: 'English' label: 'English'
}, },
{ // {
value: 'zh-CN', // value: 'zh-CN',
label: '简体中文' // label: '简体中文'
}, // },
{
value: 'zh-TW',
label: '繁體中文'
},
{ {
value: 'tr', value: 'tr',
label: 'Türk' label: 'Türk'
@ -132,7 +129,11 @@ let store = new Vuex.Store({
{ {
value: 'pt', value: 'pt',
label: 'Português' label: 'Português'
} },
{
value: 'zh-TW',
label: '繁體中文'
},
], ],
// 主题 // 主题
theme:uni.getStorageSync('theme')||defaultTheme(), theme:uni.getStorageSync('theme')||defaultTheme(),

Loading…
Cancel
Save