交易所前端蓝色ui 4.5 jiem
lxf
2025-04-18 02a3d94d359b34e915f34abec024cbc1504a6a7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!--  语言汇率弹窗-->
<template>
  <div v-if="isShow">
    <div class="css-xplkkx">
      <div class="css-14doc9z">
        <div class="css-xhj0x8" @click="isShowClick">
          <svg
            xmlns="http://www.w3.org/2000/svg"
            viewBox="0 0 24 24"
            fill="none"
            class="css-1iztezc"
          >
            <path
              d="M6.697 4.575L4.575 6.697 9.88 12l-5.304 5.303 2.122 2.122L12 14.12l5.303 5.304 2.122-2.122L14.12 12l5.304-5.303-2.122-2.122L12 9.88 6.697 4.575z"
              fill="currentColor"
            ></path>
          </svg>
        </div>
        <div class="css-1r3gvce">
          <div
            v-for="(val, index) in titleList"
            :key="index"
            :class="[active == index ? 'css-t94xhh' : 'css-ibfrnl']"
            @click="tabIndex(index)"
          >
            {{ val }}
          </div>
        </div>
        <div class="css-1tzfn88">
          <div class="css-cbzd9" v-if="active == 0">
            <div class="css-1p8zxym">
              {{ $t("message.user.qingxuanzeyuyanhediqu") }}
            </div>
            <div class="css-q2wk8b">
              <button
                data-active="true"
                id="fiatlngdialog_ba-languageRegion-zh-CN"
                :class="[
                  langActive == index ? 'rest_css-1szzq31' : '',
                  'css-1szzq3l',
                ]"
                style="width: 125px"
                v-for="(lang, index) in langArr"
                :key="index"
                @click="changeBtn(index, lang)"
              >
                <div class="css-1hv3jiv">
                  {{ lang.label }}
                </div>
                <svg
                  xmlns="http://www.w3.org/2000/svg"
                  fill="currentColor"
                  class="css-j1zueq"
                >
                  <use xlink:href="#checkmark-f"></use>
                </svg>
              </button>
            </div>
          </div>
          <!-- 汇率 -->
          <!-- <div class="css-fyzeir" v-else-if="active == 1">
            <div  class="css-1p8zxym">
              {{ $t("message.user.qingxuanzehuilv") }}
            </div>
            <div class="css-q2wk8b">
              <button
                data-active="true"
                id="fiatlngdialog_ba-Currency-CNY"
                class="css-1szzq3l"
                v-for="(val, index) in exchangeRateData"
                :class="[
                  moneyIndex == index ? 'rest_css-1szzq31' : '',
                  'css-1szzq3l',
                ]"
                @click="chooseRate(index, val)"
                :key="index"
              >
                <div  class="css-1hv3jiv">
                  {{ val.currency }}-{{ val.currency_symbol }}
                </div>
              </button>
            </div>
          </div> -->
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { strFirstBit } from "@/utils";
import { mapState, mapActions } from "pinia";
import { useUserStore } from "@/store/user";
import { useLanguageStore } from "@/store/lang";
export default {
  name: "langMoney",
  data() {
    return {
      isShow: false,
      titleList: [this.$t("message.user.yuyanhediqu")],
      langArr: [
        {
          label: "English",
          key: "en",
        },
        {
          label: "繁体中文",
          key: "cht",
        },
        // {
        //   label: "简体中文",
        //   key: "zh-CN",
        // },
        // {
        //   label: "やまと", //日语
        //   key: "jp",
        // },
        {
          label: "Français",  //法语
          key: "fra",
        },
        {
          label: "Deutsch",  //德语
          key: "de",
        },
        {
          label: "한국인",  //韩语
          key: "kor",
        },
        // {
        //   label: "ไทย",  //泰语
        //   key: "th",
        // },
        // {
        //   label: "Tiếng Việt",  //越南
        //   key: "vie",
        // },
        // {
        //   label: "Italiano",  //意大利语
        //   key: "it",
        // },
      ],
      active: 0, //选中汇率还是多语言
      langActive: 0,
      moneyIndex: 0,
      exchangeRateData: [], //TODO
    };
  },
  computed: {
    ...mapState(useUserStore, ["existToken"]),
    ...mapState(useLanguageStore, ["language"]),
 
    // ...mapState({
    //   exchangeRateData: (state) => state.exchangeRateData,
    // }),
  },
  methods: {
    ...mapActions(useLanguageStore, ["updateLang"]),
    isShowClick(type) {
      if (type == "lang") {
        this.active = 0;
        const langKeyList = this.langArr.map((it) => it.key);
        this.langActive = langKeyList.indexOf(this.language);
      } else if (type == "exchange") {
        this.active = 1;
        this.moneyIndex = strFirstBit(this.exchangeRateData).indexOf(
          this.$store.state.rate
        );
      }
      this.isShow = !this.isShow;
    },
    tabIndex(index) {
      this.active = index;
    },
    changeBtn(index, lang) {
      console.log(index, lang);
      // const langKeyMap = {
      //   简体中文: "zh", //"zh-CN"
      //   English: "en",
      //   繁体中文: "cht",
      //   Français: "fr",
      //   Deutsch: "de",
      //   Italia: "it",
      //   "한국 사람": "ko",
      // };
      this.langActive = index;
      this.updateLang(lang.key);
      this.isShowClick();
      location.reload();
    },
    // chooseRate(index, rate) {
    //   this.$GloExchangeRate = rate;
    //   this.moneyIndex = index;
    //   this.$store.commit("SETRATE", rate.currency);
    //   this.isShowClick("exchange");
    // },
  },
};
</script>
<style scoped>
@import url("@/assets/css/login/langMoney.css");
</style>