新增汇率计算

This commit is contained in:
dragon
2024-12-30 15:53:15 +08:00
parent d2de1aeec5
commit 1889382b6f
6 changed files with 36 additions and 8 deletions

View File

@@ -509,12 +509,23 @@ function operateValue(than) {
$('.pubWithdrawal .pubWithdrawal_in .ok').attr('type', type);
$('.pubWithdrawal .pubWithdrawal_in .ok').attr('accountType', accountObj.type);
if (accountObj.type == 'VODAFONE') {
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p').show();
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p strong').text(localLang.salary.textnew8);
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p span').text(accountObj.usdRatio);
$('.pubWithdrawal .pubWithdrawal_in .box4 .right').text(`${((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate)) * 50} ${accountObj.currency}`);
var num = numberFun(((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate)) * accountObj.usdRatio)
$('.pubWithdrawal .pubWithdrawal_in .box4 .right').text(`${num} ${accountObj.currency}`);
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p').show();
} else if (accountObj.type == 'BANK_TRANSFER_LIRA') {
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p strong').text(localLang.salary.textnew8_TRY);
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p span').text(accountObj.usdRatio);
var num = numberFun(((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate)) * accountObj.usdRatio)
$('.pubWithdrawal .pubWithdrawal_in .box4 .right').text(`${num} ${accountObj.currency}`);
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p').show();
// Math.floor(((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate)) * accountObj.usdRatio * 100) / 100
} else {
$('.pubWithdrawal .pubWithdrawal_in .box3 .left p').hide();
$('.pubWithdrawal .pubWithdrawal_in .box4 .right').text(`${((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate))} ${accountObj.currency}`);
console.log(accountObj.usdRatio);
var num = numberFun(((than.attr('guildUsdNum')) - (than.attr('guildUsdNum') * withdrawRate)) * accountObj.usdRatio)
$('.pubWithdrawal .pubWithdrawal_in .box4 .right').text(`${num} ${accountObj.currency}`);
}
$('.pubWithdrawal .pubWithdrawal_in .box1 .right').text(`${than.attr('guildUsdNum')} USD`);
$('.pubWithdrawal .pubWithdrawal_in .box2 .right').text(withdrawRate * 100 + '%');
@@ -532,6 +543,19 @@ function operateValue(than) {
operate(obj)
}
}
// 保留两位小数函数
function numberFun(num) {
// 將數字轉為字符串
var numStr = num.toString();
// 分割整數部分和小數部分
var parts = numStr.split('.');
// 如果有小數部分,截取前兩位,否則直接返回整數部分
var result = parts[0]; // 整數部分
if (parts[1]) { // 存在小數部分時
result += '.' + parts[1].substring(0, 2);
}
return parseFloat(result); // 返回數字
}
// 确认提现按钮
$('.pubWithdrawal .pubWithdrawal_in .ok').click(function () {
var guildUsdNum = $(this).attr('guildUsdNum');

View File

@@ -270,6 +270,7 @@ langAr = {
textnew6: `معدل رسوم المعالجة`,
textnew7: `رسوم المعالجة`,
textnew8: `سعر الصرف من الدولار الأمريكي إلى الجنيه المصري: 1:`,
textnew8_TRY: 'سعر صرف الدولار الأمريكي إلى الليرة التركية: 1:',
textnew9: `المبلغ المقدر`,
textnew10: `ملاحظة: قد يتأثر المبلغ المتوقع الوصول بسعر صرف البنك وما إلى ذلك.`,
textnew11: `سحب`,

View File

@@ -270,6 +270,7 @@ langEn = {
textnew6: `Handling Fee rate`,
textnew7: `Handling Fee`,
textnew8: `USD to EGP exchange rate: 1:`,
textnew8_TRY: `USD to TRY exchange rate: 1:`,
textnew9: `Estimated amount`,
textnew10: `Note: Estimated arrival amount may be affected by bank exchange rate, etc.`,
textnew11: `Withdraw`,

View File

@@ -270,6 +270,7 @@ langTr = {
textnew6: `İşlem Ücreti Oranı`,
textnew7: `İşlem Ücreti`,
textnew8: `USD to EGP döviz kuru: 1:`,
textnew8_TRY: `USD ile TRY döviz kuru: 1:`,
textnew9: `Tahmini Miktar`,
textnew10: `Not: Tahmini varış miktarı banka döviz kuru gibi faktörlerden etkilenebilir.`,
textnew11: `Çekim`,

View File

@@ -272,6 +272,7 @@ langZh = {
textnew6: `手續費率`,
textnew7: `手續費`,
textnew8: `美元兌埃及鎊匯率1`,
textnew8_TRY: `美元兌土耳其里拉匯率1`,
textnew9: `預估金額`,
textnew10: `注意:預估到賬金額可能會受銀行匯率等影響。`,
textnew11: `提款`,

View File

@@ -220,11 +220,11 @@
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/common2.js"></script>
<script src="../../common/js/layer.js"></script>
<script src="./local/en.js?v=1.0"></script>
<script src="./local/zh.js?v=1.0"></script>
<script src="./local/ar.js?v=1.0"></script>
<script src="./local/tr.js?v=1.0"></script>
<script src="./js/salary.js?v=1.0"></script>
<script src="./local/en.js?v=2.0"></script>
<script src="./local/zh.js?v=2.0"></script>
<script src="./local/ar.js?v=2.0"></script>
<script src="./local/tr.js?v=2.0"></script>
<script src="./js/salary.js?v=2.0"></script>
<script src="../../common/local/langHandler.js"></script>
</body>