zzzz
2024-04-18 b46c7394ad29a9ac937b56b2605b347020f68695
src/page/newUser/setting.vue
@@ -65,25 +65,8 @@
        <div style="margin-right: 10px">{{ language }}</div>
      </div>
    </div>
    <van-popup
      v-model="settingDialog"
      position="bottom"
      :style="{ height: '35%' }"
      @close="popClose"
    >
      <div
        class="lang_box"
        v-for="(item, index) in actions"
        :key="index"
        @click="qkclick(item)"
      >
        <div
          :class="$i18n.locale == item.lang ? 'lang_box_txt' : 'lang_box_txta'"
        >
          {{ item.text }}
        </div>
      </div>
    </van-popup>
    <Language ref="language" @onChange="onChange" />
    <van-popup v-model="pswDialog" position="bottom" :style="{ height: '40%' }">
      <div class="setting_content">
        <div class="old_password">
@@ -129,6 +112,7 @@
import { isNull, pwdReg } from "@/utils/utils";
import { mapMutations } from "vuex";
import { Notify } from "vant";
import Language from "@/components/Language/index.vue";
export default {
  name: "newUser",
@@ -144,53 +128,19 @@
      userInfo: [],
      onlineService: "",
      language: "",
      actions: [
        {
          text: "English",
          icon: require("@/assets/ico/english.png"),
          lang: "en",
        },
        {
          text: "繁体中文",
          icon: require("@/assets/ico/tw.png"),
          lang: "zh-TW",
        },
        { text: "हिंदी", icon: require("@/assets/ico/india.png"), lang: "hi" },
        { text: "한국인", icon: require("@/assets/ico/india.png"), lang: "ko" },
        {
          text: "ภาษาไทย",
          icon: require("@/assets/ico/india.png"),
          lang: "th",
        },
        {
          text: "日本語にほんご",
          icon: require("@/assets/ico/india.png"),
          lang: "ja",
        },
      ],
    };
  },
  components: {},
  components: { Language },
  created() {
    this.getUserInfo();
    this.language = window.localStorage.getItem("language") || "zh-CN";
    let arr = this.actions.filter((item) => item.lang === this.language);
    this.language = arr[0].text;
  },
  methods: {
    ...mapMutations(["undataToken"]),
    popClose() {
      this.settingDialog = false;
    },
    qkclick(e) {
      this.settingDialog = false;
      window.localStorage.setItem("language", e.lang);
      this.$i18n.locale = e.lang;
      this.language = e.text;
    onChange(e) {
      this.language = e;
    },
    clicklang() {
      this.settingDialog = true;
      this.$refs.language.settingDialog = true;
    },
    yebclick() {
      this.$router.push("/yeb");