交易所前端蓝色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
<template>
  <div>
    <el-dialog
      :title="$t('message.user.shoujihaobangding')"
      v-model="visible"
      :close-on-click-modal="false"
      @close="handClose"
      width="40%"
      center
    >
      <div>
        <div class="css-13xytqh" style="margin-bottom: 15px">
          <el-input
            :placeholder="$t('message.user.qsr_shoujihaoliru')"
            clearable
            type="text"
            class="rest3"
            v-model="phone"
          >
          </el-input>
          <div class="bn-input-suffix css-vurnku">
            <div class="css-1gkkq18"></div>
          </div>
        </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.user.qsr_yanzhengma')"
                  clearable
                  type="text"
                  class="rest3"
                  value=""
                  v-model.trim="verifcodeNum"
                >
                  <template #append>
                    <el-button
                      :style="'color:#1D91FF'"
                      @click="getVerifcode"
                      :disabled="isDisabaled"
                      >{{ VeriCode }}</el-button
                    >
                  </template>
                </el-input>
                <div class="bn-input-suffix css-vurnku">
                  <div class="css-1gkkq18"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmBtn">{{
          $t("message.user.bangding")
        }}</el-button>
      </span>
    </el-dialog>
  </div>
</template>
 
<script>
import Axios from "@/api/login.js";
import Axios2 from "@/api/my.js";
import { ElMessage } from "element-plus";
export default {
  props: {
    isShowPhone: {
      // 弹窗是否展示
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      timer: null,
      phone: "",
      verifcodeNum: "",
      VeriCode: this.$t("message.user.huoquyanzhengma"),
      isDisabaled: false,
    };
  },
  computed: {
    visible: {
      get() {
        return this.isShowPhone;
      },
      set(val) {
        this.$emit("update:isShowPhone", false);
      },
    },
  },
  mounted() {},
  methods: {
    //获取验证码
    getVerifcode() {
      if (this.phone != "") {
        this.isDisabaled = true;
        this.VeriCode = 60;
        clearInterval(this.timer);
        this.timer = setInterval(() => {
          this.VeriCode--;
          if (this.VeriCode == 0) {
            this.isDisabaled = false;
            clearInterval(this.timer);
            this.VeriCode = this.$t("message.user.fasongyanzhengma");
          }
        }, 1000);
 
        Axios.getVeriCode({
          target: this.phone,
          areacode: "",
        }).then((res) => {
          if (res.code == "0") {
            ElMessage.success(
              this.$t("message.user.yanzhengmafasongchenggong")
            );
          }
        });
      } else {
        ElMessage.error(this.$t("message.home.shoujihaobunengweikong"));
      }
    },
    confirmBtn() {
      let numReg = /^([0-9]\d*)$/;
      if (!numReg.test(this.verifcodeNum)) {
        ElMessage.error(this.$t("message.user.yanzhengmazhinengshurushuzi"));
        return;
      }
 
      if (this.phone && this.verifcodeNum) {
        Axios2.savePhone({
          phone: this.phone,
          verifcode: this.verifcodeNum,
        }).then((res) => {
          if (res.code == "0") {
            ElMessage.success(this.$t("message.user.bangdingchenggong"));
            this.$parent.getUserInfo();
            this.phone = "";
            this.verifcodeNum = "";
          }
        });
      } else {
        ElMessage.warning(this.$t("qsr_wanzhengdexinxi"));
      }
    },
    handClose() {
      this.phone = "";
      this.verifcodeNum = "";
    },
  },
};
</script>
 
<style scoped>
@import url("@/assets/css/login/register.css");
@import url("@/assets/css/commonTrade/global.css");
.el-input--suffix >>> .el-input__inner {
  padding-right: 30px;
  outline: none;
  border: none;
}
</style>