1
PC-20250623MANY\Administrator
2025-08-10 335dfbdf38b9e37c1383da28232ee725bb92185e
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;
          }
        });
    },