From f8e9af35a267b7b9a2bf605187a11536889a6e38 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 20 May 2024 11:00:10 +0800
Subject: [PATCH] 修改:绑定银行卡 多语言

---
 src/page/newUser/setting.vue |  129 ++++++++++--------------------------------
 1 files changed, 31 insertions(+), 98 deletions(-)

diff --git a/src/page/newUser/setting.vue b/src/page/newUser/setting.vue
index 52bee7e..66ca2eb 100644
--- a/src/page/newUser/setting.vue
+++ b/src/page/newUser/setting.vue
@@ -37,18 +37,6 @@
       </div>
     </div>
 
-    <!-- 		<div class="jy" @click="handleGoToTransfer()">
-			<div class="left_gn">
-				<div class="l_icon">
-				</div>
-				<div class="r_title">
-					<span>{{ $t('hj145') }}</span>
-				</div>
-			</div>
-			<div class="right_gos">
-				<img src="../../assets/img/youjiantou.png" alt />
-			</div>
-		</div> -->
     <div class="jy" @click="handleGoToAuthentication()">
       <div class="left_gn">
         <div class="l_icon">
@@ -65,32 +53,7 @@
         <img v-else src="../../assets/img/youjiantou.png" alt />
       </div>
     </div>
-    <!-- 
-		<div class="jy" @click="subclick()">
-			<div class="left_gn">
-				<div class="l_icon">
-				</div>
-				<div class="r_title">
-					<span>{{ $t('subdk') }}</span>
-				</div>
-			</div>
-			<div class="right_gos">
-				<img src="../../assets/img/youjiantou.png" alt />
-			</div>
-		</div>
 
-		<div class="jy" @click="yebclick()">
-			<div class="left_gn">
-				<div class="l_icon">
-				</div>
-				<div class="r_title">
-					<span>{{ $t('yeb') }}</span>
-				</div>
-			</div>
-			<div class="right_gos">
-				<img src="../../assets/img/youjiantou.png" alt />
-			</div>
-		</div> -->
     <div class="jy" @click="clicklang()">
       <div class="left_gn">
         <div class="l_icon"></div>
@@ -102,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">
@@ -164,6 +110,9 @@
 import * as api from "@/axios/api";
 import { Toast, MessageBox } from "mint-ui";
 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",
@@ -179,52 +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: {
-    popClose() {
-      this.settingDialog = false;
-    },
-    qkclick(e) {
-      this.settingDialog = false;
-      window.localStorage.setItem("language", e.lang);
-      this.$i18n.locale = e.lang;
-      this.language = e.text;
+    ...mapMutations(["undataToken"]),
+    onChange(e) {
+      this.language = e;
     },
     clicklang() {
-      this.settingDialog = true;
+      this.$refs.language.settingDialog = true;
     },
     yebclick() {
       this.$router.push("/yeb");
@@ -305,6 +221,7 @@
         // 判断是否登录
         this.$store.commit("dialogVisible", false);
         this.$store.state.userInfo = data.data;
+        document.title = 'Setting'
         this.userInfo = data.data;
       } else {
         this.$store.commit("dialogVisible", true);
@@ -323,8 +240,8 @@
     },
     handleOutLoginClick() {
       // 退出登录
-      MessageBox.confirm(this.$t("hj149") + "?", this.$t("hj165"), {
-        confirmButtonText: this.$t("hj161"),
+      MessageBox.confirm(this.$t("hj149"), this.$t(""), {
+        confirmButtonText: this.$t("qr"),
         cancelButtonText: this.$t("hj106"),
       })
         .then(() => {
@@ -360,6 +277,7 @@
       let data = await api.logout();
       if (data.status === 0) {
         // Toast(data.msg)
+        this.undataToken(null);
         this.$router.push("/login");
       } else {
         Toast(data.msg);
@@ -388,8 +306,14 @@
           let data = await api.changePassword(opts);
           if (data.status === 0) {
             this.changeLoginPsdBox = false;
-            Toast(data.msg);
+
+            this.pswDialog = false;
             this.settingDialog = false;
+            Notify({
+              type: "success",
+              message: this.$t("密码修改成功"),
+            });
+            this.toRegister();
           } else {
             Toast(data.msg);
             this.settingDialog = false;
@@ -412,6 +336,7 @@
 .right_gos_txt {
   margin-right: 15px;
 }
+
 .setting_content {
   width: 100%;
   height: 5rem;
@@ -469,6 +394,7 @@
     }
   }
 }
+
 .lang_box_txta {
   width: 100%;
   height: 100px;
@@ -476,6 +402,7 @@
   line-height: 100px;
   border-bottom: 1px solid #ecf5ff;
 }
+
 .lang_box_txt {
   width: 100%;
   height: 100px;
@@ -484,6 +411,7 @@
   border-bottom: 1px solid #ecf5ff;
   color: #2196f3;
 }
+
 .lang_box {
   width: 100%;
   display: flex;
@@ -491,6 +419,7 @@
   align-items: center;
   flex-direction: column;
 }
+
 .btn_s_box {
   border: none;
   background: #409eff;
@@ -504,12 +433,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;
@@ -568,6 +499,7 @@
     }
   }
 }
+
 body {
   background-color: #f8f8f8;
 }
@@ -633,6 +565,7 @@
     height: 2rem;
     display: flex;
     background-color: #fff;
+
     > div {
       width: 10%;
       height: 100%;
@@ -662,4 +595,4 @@
     }
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3