1
PC-20250623MANY\Administrator
2025-07-22 beff59e6065d3283cc9fb10fe7151f2b757cd154
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
<!-- 设置邮箱 -->
<template>
  <div>
    <div style="margin-top: 50px">
      <main class="main css-6q12pm">
        <div class="css-108ucgm">
          <div class="binance-row css-16kn2us">
            <div class="binance-col css-1wz0uwi" style="margin-left: -12px">
              <div class="css-cz4mv2">
                <div class="css-6x3lo1">
                  <div class="css-vurnku">
                    <div class="css-ojbpe7">
                      {{ $t("message.user.youxiangyanzheng") }}
                    </div>
 
                    <div class="css-vurnku">
                      <!-- 验证码 -->
                      <div class="css-15651n7">
                        <div
                          class="css-xjlny9"
                          style="color: #868d9a; padding: 20px 0"
                        >
                          {{ $t("message.login.input9") }}&nbsp;{{ username }}
                          {{ $t("message.login.input2") }}
                        </div>
                        <div class="css-hiy16i">
                          <div class="css-vpcnym">
                            <div class="css-1fymml5">
                              <div
                                class="bn-tooltip-box css-1yof1af"
                                data-popper-reference-hidden="false"
                                data-popper-escaped="false"
                                data-popper-placement="right-start"
                                style="
                                  position: absolute;
                                  left: 392px;
                                  top: -22px;
                                  transition: opacity 120ms ease-in-out 0s,
                                    transform 120ms ease-in-out 0s;
                                  opacity: 0;
                                  transform: translate3d(6px, 0px, 0px);
                                  visibility: hidden;
                                "
                              >
                                <i class="gap-fill"></i>
                              </div>
                              <div class="css-13xytqh">
                                <el-input
                                  :placeholder="
                                    $t('message.login.qsr_yanzhengma')
                                  "
                                  clearable
                                  class="rest3"
                                  v-model="verifcodeNum"
                                >
                                  <el-button slot="append">{{
                                    VeriCode
                                  }}</el-button>
                                </el-input>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
 
                      <button
                        data-bn-type="button"
                        @click="confirmBtn"
                        class="css-1bsmpdm"
                      >
                        {{ $t("message.login.bangding") }}
                      </button>
                      <div
                        @click="jumpOver"
                        style="
                          text-align: center;
                          padding: 20px 0;
                          color: #868d9a;
                          cursor: pointer;
                        "
                      >
                        {{ $t("message.login.tiaoguo") }}
                      </div>
                    </div>
                    <div class="css-vurnku"></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </main>
    </div>
  </div>
</template>
<script>
import Axios from "@/api/login/login";
export default {
  name: "emailSet",
  data() {
    return {
      VeriCode: this.$t("message.user.huoquyanzhengma"),
      isDisabaled: false,
      verifcodeNum: "",
    };
  },
  created() {
    this.getVerifcode();
  },
  computed: {
    username() {
      return this.$store.state.username || "";
    },
  },
  methods: {
    jumpOver() {
      this.$router.push("/idSet");
    },
    // 获取验证码
    getVerifcode() {
      if (this.username != "") {
        this.isDisabaled = true;
        this.VeriCode = 60;
        let timer = setInterval(() => {
          this.VeriCode--;
          if (this.VeriCode == 0) {
            this.isDisabaled = false;
            clearInterval(timer);
            this.VeriCode = this.$t("message.login.fasongyanzhengma");
          }
        }, 1000);
 
        Axios.getVeriCode({
          target: this.username,
          areacode: "",
        }).then((res) => {
          if (res.code == "0") {
            this.$message.success(
              this.$t("message.login.yanzhengmafasongchenggong")
            );
          }
        });
      } else {
        this.$message.error(this.$t("message.login.youxiangbunengweikong"));
      }
    },
    confirmBtn() {
      let numReg = /^([0-9]\d*)$/;
      if (!numReg.test(this.verifcodeNum)) {
        this.$message.error(
          this.$t("message.user.yanzhengmazhinengshurushuzi")
        );
        return;
      }
 
      if (this.verifcodeNum) {
        this.$fetch("api/localuser!save_email.action", {
          email: this.username,
          verifcode: this.verifcodeNum,
        }).then((res) => {
          if (res.code == "0") {
            this.$message.success(this.$t("message.user.bangdingchenggong"));
            this.$router.push("/idSet");
          }
        });
      } else {
        this.$message.warning(this.$t("message.login.qsr_wanzhengdexinxi"));
      }
    },
  },
};
</script>
<style scoped>
@import url("@/assets/css/login/register.css");
 
.el-input--suffix >>> .el-input__inner {
  padding-right: 30px;
  outline: none;
  border: none;
}
</style>