Skip to content

Commit 1e5cdb1

Browse files
authored
Merge pull request #106 from Polygant/release/1.3.0
Release/1.3.0
2 parents 1f7802f + 4b1cc53 commit 1e5cdb1

File tree

16 files changed

+149
-81
lines changed

16 files changed

+149
-81
lines changed

src/components/layout/Header.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
<img
2727
style="height: 46px"
2828
:src="
29-
'/public/img/common/svgcrypto/' +
30-
accountData?.currentBaseCurrency?.toLowerCase() +
31-
'.svg'
29+
coins[accountData?.currentBaseCurrency].logo.length > 0
30+
? coins[accountData?.currentBaseCurrency].logo
31+
: `/public/img/common/svgcrypto/${accountData?.currentBaseCurrency?.toLowerCase()}.svg`
3232
"
3333
:alt="accountData.currentBaseCurrency"
3434
/>

src/components/ui/BaseList.vue

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,36 @@
3030
class="tab-pane__search"
3131
/>
3232
</div>
33-
<table class="table-striped table-list__table" :class="tableClass">
34-
<thead>
35-
<th v-for="col in colsList" :key="col">
36-
<div class="table-list__table-th">
37-
{{ $te(`common.${col}`) ? $t(`common.${col}`) : null }}
38-
</div>
39-
</th>
40-
</thead>
41-
<tbody>
42-
<tr v-for="(row, idx) in filteredList" :key="idx" :data-num="idx">
43-
<td v-for="column in colsList" :key="column" :class="`${column}-td`">
44-
<div class="table-list__table-td">
45-
<img
46-
v-if="isImgField({ [column]: row[column] })"
47-
:src="row[column]"
48-
/>
49-
<span v-else-if="row.hasOwnProperty(column)">
50-
{{ row[column] }}
51-
</span>
33+
<perfect-scrollbar>
34+
<table class="table-striped table-list__table" :class="tableClass">
35+
<thead>
36+
<th v-for="col in colsList" :key="col">
37+
<div class="table-list__table-th">
38+
{{ $te(`common.${col}`) ? $t(`common.${col}`) : null }}
5239
</div>
53-
</td>
54-
</tr>
55-
</tbody>
56-
</table>
40+
</th>
41+
</thead>
42+
<tbody>
43+
<tr v-for="(row, idx) in filteredList" :key="idx" :data-num="idx">
44+
<td
45+
v-for="column in colsList"
46+
:key="column"
47+
:class="`${column}-td`"
48+
>
49+
<div class="table-list__table-td">
50+
<img
51+
v-if="isImgField({ [column]: row[column] })"
52+
:src="row[column]"
53+
/>
54+
<span v-else-if="row.hasOwnProperty(column)">
55+
{{ row[column] }}
56+
</span>
57+
</div>
58+
</td>
59+
</tr>
60+
</tbody>
61+
</table>
62+
</perfect-scrollbar>
5763
</div>
5864
</template>
5965

@@ -232,4 +238,7 @@ export default {
232238
top: 50px;
233239
left: 7px;
234240
}
241+
.ps {
242+
height: 250px;
243+
}
235244
</style>

src/components/ui/Select3.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
<div v-click-outside="closeSelect">
33
<div v-if="currentOption" class="coinSelector">
44
<div class="selector__current" @click="open">
5+
{{ allCoins[currentOption.id].logo }}
56
<img
67
width="50"
78
:src="
8-
'/public/img/common/svgcrypto/' +
9-
currentOption.id.toLowerCase() +
10-
'.svg'
9+
allCoins[currentOption.id].logo.length > 0
10+
? allCoins[currentOption.id].logo
11+
: `/public/img/common/svgcrypto/${currentOption.id.toLowerCase()}.svg`
1112
"
1213
:alt="currentOption.id.toUpperCase()"
1314
class="mCS_img_loaded walletTable__item_img coinSelector__img"
@@ -24,7 +25,9 @@
2425
<img
2526
width="50"
2627
:src="
27-
'/public/img/common/svgcrypto/' + coin.id.toLowerCase() + '.svg'
28+
allCoins[coin.id].logo.length > 0
29+
? allCoins[coin.id].logo
30+
: `/public/img/common/svgcrypto/${coin.id.toLowerCase()}.svg`
2831
"
2932
:alt="coin.id.toUpperCase()"
3033
class="mCS_img_loaded walletTable__item_img coinSelector__img"
@@ -53,6 +56,10 @@ export default {
5356
type: String,
5457
default: "",
5558
},
59+
allCoins: {
60+
type: Array,
61+
default: () => [],
62+
},
5663
},
5764
emits: ["input"],
5865
data() {
@@ -69,12 +76,14 @@ export default {
6976
},
7077
optionsList() {
7178
let list = [];
79+
console.log("this.options", this.options);
7280
// eslint-disable-next-line no-unused-vars
7381
for (const [key, value] of Object.entries(this.options)) {
7482
list.push({
7583
id: key,
7684
selected: this.value === key || this.selected === key,
7785
title: key,
86+
icon: value.icon,
7887
});
7988
}
8089
return list;

src/components/ui/SelectAdvanced.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
v-if="image"
77
width="50"
88
:src="
9-
'/public/img/common/svgcrypto/' +
10-
currentOption.id.toLowerCase() +
11-
'.svg'
9+
allCoins[currentOption.id].logo.length > 0
10+
? allCoins[currentOption.id].logo
11+
: `/public/img/common/svgcrypto/${currentOption.id.toLowerCase()}.svg`
1212
"
1313
:alt="currentOption.id.toUpperCase()"
1414
class="mCS_img_loaded walletTable__item_img walletTable__item_img_small coinSelector__img"
@@ -42,7 +42,9 @@
4242
v-if="image"
4343
width="50"
4444
:src="
45-
'/public/img/common/svgcrypto/' + coin.id.toLowerCase() + '.svg'
45+
allCoins[coin.id].logo.length > 0
46+
? allCoins[coin.id].logo
47+
: `/public/img/common/svgcrypto/${coin.id.toLowerCase()}.svg`
4648
"
4749
:alt="coin.id.toUpperCase()"
4850
class="mCS_img_loaded walletTable__item_img walletTable__item_img_small coinSelector__img"
@@ -91,6 +93,10 @@ export default {
9193
required: false,
9294
default: "",
9395
},
96+
allCoins: {
97+
type: Array,
98+
default: () => [],
99+
},
94100
},
95101
emits: ["select"],
96102
data() {

src/mixins/getCoolTrade.js

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,55 @@ export default {
1616
getCutted(val) {
1717
return Math.round((val + Number.EPSILON) * 100) / 100;
1818
},
19+
countZerosAfterDecimal(number) {
20+
const decimalPart = number.toString().split(".")[1];
21+
let zeroCount = 0;
22+
if (decimalPart > 0) {
23+
for (let i = 0; i < decimalPart.length; i++) {
24+
if (decimalPart[i] === "0") {
25+
zeroCount++;
26+
} else {
27+
break;
28+
}
29+
}
30+
}
31+
return zeroCount;
32+
},
1933
getCoolTrade(sum, cur) {
20-
sum = typeof sum !== "undefined" ? parseFloat(sum) : 0;
21-
let result = sum;
34+
if (sum < 1 && this.countZerosAfterDecimal(sum) > 3) {
35+
return floor10(sum, -8).toFixed(8);
36+
} else {
37+
sum = typeof sum !== "undefined" ? parseFloat(sum) : 0;
38+
let result = sum;
2239

23-
if (
24-
cur &&
25-
this.isFiat(cur) &&
26-
["BTC", "ETH", "BCH"].includes(this.currentBaseCurrency)
27-
) {
28-
if (sum >= 100) {
29-
result = floor10(sum, -2).toFixed(2);
40+
if (
41+
cur &&
42+
this.isFiat(cur) &&
43+
["BTC", "ETH", "BCH"].includes(this.currentBaseCurrency)
44+
) {
45+
if (sum >= 100) {
46+
result = floor10(sum, -2).toFixed(2);
47+
} else {
48+
result = floor10(sum, -4).toFixed(4);
49+
}
50+
} else if (cur && this.isFiat(cur)) {
51+
if (sum >= 10000) {
52+
result = floor10(sum, 0).toFixed(0);
53+
} else if (sum >= 1000) {
54+
result = floor10(sum, -1).toFixed(1);
55+
} else if (sum >= 100) {
56+
result = floor10(sum, -2).toFixed(2);
57+
} else if (sum >= 10) {
58+
result = floor10(sum, -3).toFixed(3);
59+
} else {
60+
result = floor10(sum, -4).toFixed(4);
61+
}
3062
} else {
31-
result = floor10(sum, -4).toFixed(4);
63+
result = floor10(sum, -8).toFixed(8);
3264
}
33-
} else if (cur && this.isFiat(cur)) {
34-
if (sum >= 10000) {
35-
result = floor10(sum, 0).toFixed(0);
36-
} else if (sum >= 1000) {
37-
result = floor10(sum, -1).toFixed(1);
38-
} else if (sum >= 100) {
39-
result = floor10(sum, -2).toFixed(2);
40-
} else if (sum >= 10) {
41-
result = floor10(sum, -3).toFixed(3);
42-
} else {
43-
result = floor10(sum, -4).toFixed(4);
44-
}
45-
} else {
46-
result = floor10(sum, -8).toFixed(8);
47-
}
4865

49-
return result;
66+
return result;
67+
}
5068
},
5169
},
5270
};

src/modules/exchange/components/FastBuySellWalletList.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
<div class="wallet-table__td">
4949
<img
5050
:src="
51-
'/public/img/common/svgcrypto/' +
52-
ticker.toLowerCase().trim() +
53-
'.svg'
51+
coins[ticker].logo.length > 0
52+
? coins[ticker].logo
53+
: `/public/img/common/svgcrypto/${ticker
54+
.toLowerCase()
55+
.trim()}.svg`
5456
"
5557
:alt="ticker"
5658
/>

src/modules/exchange/pages/FastBuySell.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
:value="cur1"
4545
:options="activeCoinsSelect3"
4646
class="qExchangeSelect"
47+
:all-coins="coins"
4748
@input="cur1 = $event"
4849
/>
4950
</div>
@@ -54,7 +55,11 @@
5455
class="relative ml-2 inline-block"
5556
style="top: -2px"
5657
width="13"
57-
:src="`/public/img/coin/${cur1.toLowerCase()}.svg`"
58+
:src="
59+
coins[cur1].logo.length > 0
60+
? coins[cur1].logo
61+
: `/public/img/coin/${cur1.toLowerCase()}.svg`
62+
"
5863
alt=""
5964
/>
6065
{{ cur1 }}
@@ -65,7 +70,11 @@
6570
class="relative ml-2 inline-block"
6671
style="top: -2px"
6772
width="13"
68-
:src="`/public/img/coin/${cur1.toLowerCase()}.svg`"
73+
:src="
74+
coins[cur1].logo.length > 0
75+
? coins[cur1].logo
76+
: `/public/img/coin/${cur1.toLowerCase()}.svg`
77+
"
6978
alt=""
7079
/>
7180
{{ cur1 }}
@@ -120,6 +129,7 @@
120129
:value="cur2"
121130
:options="relatedCoinsSelect3"
122131
class="qExchangeSelect"
132+
:all-coins="coins"
123133
@input="cur2 = $event"
124134
/>
125135
</div>
@@ -130,7 +140,11 @@
130140
class="relative ml-2 inline-block"
131141
style="top: -2px"
132142
width="13"
133-
:src="`/public/img/coin/${cur2?.toLowerCase()}.svg`"
143+
:src="
144+
coins[cur2].logo.length > 0
145+
? coins[curw].logo
146+
: `/public/img/coin/${cur2.toLowerCase()}.svg`
147+
"
134148
alt=""
135149
/>
136150
{{ cur2 }}

src/modules/fees/pages/Fees.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@
106106
>
107107
<img
108108
:src="
109-
'/public/img/common/svgcrypto/' +
110-
ticker.toLowerCase() +
111-
'.svg'
109+
coins[ticker].logo.length > 0
110+
? coins[ticker].logo
111+
: `/public/img/common/svgcrypto/${ticker.toLowerCase()}.svg`
112112
"
113113
width="30"
114114
class="inline-block mr-2"
@@ -193,9 +193,9 @@
193193
>
194194
<img
195195
:src="
196-
'/public/img/common/svgcrypto/' +
197-
ticker.toLowerCase() +
198-
'.svg'
196+
coins[ticker].logo.length > 0
197+
? coins[ticker].logo
198+
: `/public/img/common/svgcrypto/${ticker.toLowerCase()}.svg`
199199
"
200200
width="30"
201201
class="inline-block mr-2"

src/modules/trade/components/CurrencyList.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,4 +472,7 @@ tr.disabled {
472472
top: 8px;
473473
left: 7px;
474474
}
475+
.ps {
476+
height: 378px;
477+
}
475478
</style>

src/modules/wallet/components/WalletList.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export default {
6363
});
6464
result.currency = ticker;
6565
result.icon =
66-
"/public/img/common/svgcrypto/" + ticker.toLowerCase() + ".svg";
66+
coin.logo.length > 0
67+
? coin.logo
68+
: "/public/img/common/svgcrypto/" + ticker.toLowerCase() + ".svg";
6769
finalResult.push(result);
6870
}
6971
});

0 commit comments

Comments
 (0)