From 335dfbdf38b9e37c1383da28232ee725bb92185e Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Sun, 10 Aug 2025 18:12:24 +0800
Subject: [PATCH] 1
---
src/mixins/myMixins.js | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/src/mixins/myMixins.js b/src/mixins/myMixins.js
index c919dc5..2b561bb 100644
--- a/src/mixins/myMixins.js
+++ b/src/mixins/myMixins.js
@@ -33,8 +33,9 @@
},
},
- utm: 1, // US转MX汇率
- mtu: 1, // MX转US汇率
+ htu: 1, // HK转US汇率
+ itu: 1, // IN转US汇率
+ ttu: 1, // TW转US汇率
};
},
watch: {
@@ -52,6 +53,14 @@
},
},
methods: {
+ // 计算当前汇率
+ rate(type) {
+ let rate = 1;
+ if (type == "HK") rate = this.htu;
+ else if (type == "IN") rate = this.itu;
+ else if (type == "TW") rate = this.ttu;
+ return rate;
+ },
// 初始化
init() {
this.pageNum = 1;
@@ -83,10 +92,18 @@
let data = await api.getRateInfo();
data.data &&
data.data.forEach((item) => {
- if (item.currency === "USD") {
- this.utm = item.rata;
- } else if (item.currency === "MXN") {
- this.mtu = item.rata;
+ if (item.currency === "HKD" && item.conversionCurrency == "USD") {
+ this.htu = item.rata;
+ } else if (
+ item.currency === "INR" &&
+ item.conversionCurrency == "USD"
+ ) {
+ this.itu = item.rata;
+ } else if (
+ item.currency === "TWD" &&
+ item.conversionCurrency == "USD"
+ ) {
+ this.ttu = item.rata;
}
});
},
--
Gitblit v1.9.3