From 44db498cedee7573d090797b1fe5c331c413b00a Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Mon, 22 Apr 2024 19:03:57 +0800
Subject: [PATCH] first

---
 src/page/newUser/setting.vue |   82 +++++++++++------------------------------
 1 files changed, 22 insertions(+), 60 deletions(-)

diff --git a/src/page/newUser/setting.vue b/src/page/newUser/setting.vue
index f7e6db1..4dbbb3e 100644
--- a/src/page/newUser/setting.vue
+++ b/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,54 +128,19 @@
       userInfo: [],
       onlineService: "",
       language: "",
-      actions: [
-        {
-          text: "English",
-          icon: require("@/assets/ico/english.png"),
-          lang: "zh-CN",
-        },
-        { text: "हिंदी", icon: require("@/assets/ico/india.png"), lang: "en" },
-        { text: "한국인", icon: require("@/assets/ico/india.png"), lang: "hy" },
-        {
-          text: "ภาษาไทย",
-          icon: require("@/assets/ico/india.png"),
-          lang: "ty",
-        },
-        {
-          text: "日本語にほんご",
-          icon: require("@/assets/ico/india.png"),
-          lang: "ry",
-        },
-
-        { text: "繁体中文", icon: require("@/assets/ico/tw.png"), lang: "tw" },
-      ],
     };
   },
-  components: {},
+  components: { Language },
   created() {
     this.getUserInfo();
-    this.language = window.localStorage.getItem("language");
-    console.log(window.localStorage.getItem("language"));
-    if (this.language == "zh-CN") {
-      this.language = "English";
-    } else {
-      this.language = "हिंदी";
-    }
   },
   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");
@@ -359,7 +308,11 @@
 
             this.pswDialog = false;
             this.settingDialog = false;
-            Notify({ type: "success", message: this.$t("密码修改成功") });
+            Notify({
+              type: "success",
+              message: this.$t("密码修改成功"),
+            });
+            this.toRegister();
           } else {
             Toast(data.msg);
             this.settingDialog = false;
@@ -382,6 +335,7 @@
 .right_gos_txt {
   margin-right: 15px;
 }
+
 .setting_content {
   width: 100%;
   height: 5rem;
@@ -439,6 +393,7 @@
     }
   }
 }
+
 .lang_box_txta {
   width: 100%;
   height: 100px;
@@ -446,6 +401,7 @@
   line-height: 100px;
   border-bottom: 1px solid #ecf5ff;
 }
+
 .lang_box_txt {
   width: 100%;
   height: 100px;
@@ -454,6 +410,7 @@
   border-bottom: 1px solid #ecf5ff;
   color: #2196f3;
 }
+
 .lang_box {
   width: 100%;
   display: flex;
@@ -461,6 +418,7 @@
   align-items: center;
   flex-direction: column;
 }
+
 .btn_s_box {
   border: none;
   background: #409eff;
@@ -474,12 +432,14 @@
   font-weight: 600;
   margin: 40px 20px 0 20px;
 }
+
 .btn_s {
   width: 100%;
   display: flex;
   justify-content: center;
   align-items: center;
 }
+
 .jy {
   width: 100%;
   height: 1.5rem;
@@ -538,6 +498,7 @@
     }
   }
 }
+
 body {
   background-color: #f8f8f8;
 }
@@ -603,6 +564,7 @@
     height: 2rem;
     display: flex;
     background-color: #fff;
+
     > div {
       width: 10%;
       height: 100%;
@@ -632,4 +594,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3