1
PC-20250623MANY\Administrator
2025-09-17 34171d550c6284bcf657e9b51dde1ccc6769b919
src/page/login/register.vue
@@ -2,74 +2,55 @@
  <div class="login_page">
    <headers />
    <div class="login_title animated slideInDown">
      <span>{{ $t("hj18") }}</span>
      <span>{{ $t("hj15") }}</span>
    </div>
    <div class="logins_content">
      <div class="login_forms">
        <div class="top_forms">
          <el-input
            :placeholder="placeholder"
            size="medium"
            v-model="phone"
            maxlength="10"
            clearable
            @input="handleInput()"
          >
            <template slot="prepend">+91</template>
          <div class="forms_title">{{ placeholder }}</div>
          <el-input :placeholder="$t('请输入')" :size="medium" v-model="phone" clearable @input="handleInput()">
          </el-input>
          <el-input
            style="margin-top: 0.46rem"
            show-password
            :placeholder="$t('hj19')"
            size="medium"
            v-model="userPassword"
            @input="handleInput()"
          >
          <!-- <div class="forms_title">{{ $t("hj25") }}</div>
          <el-input :placeholder="$t('请输入')" :size="medium" v-model="yzmCode" clearable @input="handleInput()">
            <template slot="append">
              <van-button type="info" size="small" @click="getYzm" :loading="djs > 0" :loading-text="djs + ''">
                <span style="font-size: 14px;">{{ $t('获取验证码') }}</span>
              </van-button>
            </template>
          </el-input> -->
          <div class="forms_title">{{ $t("Password") }}</div>
          <el-input :placeholder="$t('hj19')" :size="medium" v-model="userPassword" clearable @input="handleInput()">
          </el-input>
          <el-input
            style="margin-top: 0.46rem"
            show-password
            :placeholder="$t('hj20')"
            size="medium"
            v-model="rePassword"
            @input="handleInput()"
          >
          <div class="forms_title">{{ $t("hj20") }}</div>
          <el-input :placeholder="$t('请输入')" :size="medium" v-model="rePassword" clearable @input="handleInput()">
          </el-input>
          <el-input
            style="margin-top: 0.46rem"
            :placeholder="$t('hj21')"
            size="medium"
            v-model="userName"
            clearable
            @input="handleInput()"
          >
          <div class="forms_title">{{ $t("hj21") }}</div>
          <el-input :placeholder="$t('请输入')" :size="medium" v-model="userName" clearable @input="handleInput()">
          </el-input>
        </div>
        <div
          class="radio-con"
          style="display: flex; align-items: center; font-size: 14px"
        >
          <van-checkbox v-model="checked">{{
            $t("我已閱讀並同意")
          }}</van-checkbox>
          <span @click="gotoxy" style="color: rgb(5, 106, 239)">{{
            $t("《用戶服務協議》")
          }}</span>
        <div class="radio-con" style="display: flex; align-items: center; font-size: 14px">
          <van-checkbox v-model="checked" @change="handleInput()">
            {{ $t("我已閱讀並同意") }}
          </van-checkbox>
          <span @click="gotoxy" style="color: #0e7ddd">
            {{ $t("《用戶服務協議》") }}
          </span>
        </div>
        <div class="bottom_btns" :class="btnClass ? 'on' : 'off'">
          <van-button
            type="info"
            :disabled="!btnClass"
            class="butn"
            @click="gook"
            >{{ $t("立即注册") }}</van-button
          >
          <van-button type="info" :disabled="!btnClass" class="butn" @click="gook">{{ $t("立即注册") }}</van-button>
          <div class="register" @click="$router.push('/login')">
            {{ $t("已有賬號?")
            }}<span style="color: rgb(5, 106, 239)">{{ $t("馬上登錄") }}</span>
          </div>
          <!-- <van-button
            type="info"
            class="butn_2"
            plain
            @click="$router.push('/login')"
          >
            {{ $t("已有賬號?") + $t("馬上登錄") }}
          </van-button> -->
        </div>
      </div>
    </div>
@@ -82,10 +63,10 @@
import * as api from "@/axios/api";
import { Notify } from "vant";
import { mapMutations } from "vuex";
import deTh from "@/utils/deTh";
export default {
  components: {
    headers,
    headers
  },
  name: "newRegister",
  data() {
@@ -94,13 +75,16 @@
      verification: this.$t("hj25"),
      loginWay: this.$t("hj26"),
      loginWay: this.$t("hj26"),
      placeholder: this.$t("hj27"),
      placeholder: this.$t("hj16"),
      phone: "",
      userName: "",
      yzmCode: '6666',
      code: "",
      userPassword: "",
      btnClass: false,
      rePassword: "",
      medium: "medium",
      djs: 0,
    };
  },
  mounted() {
@@ -109,22 +93,40 @@
      : "";
  },
  methods: {
    gotoxy(){
    gotoxy() {
      this.$router.push("/help_fwxy");
    },
    handleInput() {
      if (
        this.userPassword !== "" &&
        this.yzmCode !== "" &&
        this.phone !== "" &&
        this.userPassword == this.rePassword &&
        this.userName != ""
        this.userName != "" &&
        this.checked
      ) {
        this.btnClass = true;
      } else {
        this.btnClass = false;
      }
    },
    async getYzm() {
      let data = await api.getsendmail({ email: this.phone });
      if (data.status == 0) {
        Notify({ type: 'primary', message: data.msg });
        this.djs = 60;
        let time = setInterval(() => {
          this.djs--;
          if (this.djs <= 0) {
            clearInterval(time);
          }
        }, 1000);
      } else {
        Notify({ type: "warning", message: data.msg });
      }
    },
    async gook() {
      if (this.phone.length == 0) {
        Notify({ type: "warning", message: this.$t("hj28") });
@@ -145,9 +147,9 @@
          let opts = {
            // agentCode:'4023', // SR330001
            phone: this.phone,
            yzmCode: "6666",
            yzmCode: this.yzmCode,
            userPwd: this.userPassword,
            agentCode: this.userName,
            agentCode: this.userName
          };
          let data = await api.register(opts);
          if (data.status === 0) {
@@ -163,44 +165,62 @@
        // 支持
        navigator.vibrate([55]);
      }
    },
  },
    }
  }
};
</script>
<style  scoped lang="less">
<style scoped lang="less">
@green: #0e7ddd;
@Black1: #13161e;
.register {
  font-style: normal;
  font-weight: 400;
  font-weight: 500;
  font-size: 0.37333rem;
  color: #8c9fad;
  text-align: center;
  margin: 20px auto;
  // margin-top: 10px;
}
.radio-con {
  margin-top: 0.32rem;
}
/deep/ .el-input-group__append {
  background: #13161e;
  border: none !important;
  size: .3rem;
}
/deep/ .van-checkbox__icon--checked .van-icon {
  background: @green;
  border-color: @green;
}
/deep/ .van-checkbox__label {
  font-style: normal;
  font-weight: 400;
  font-weight: 500;
  font-size: 0.37333rem;
  line-height: 0.53333rem;
  color: #8c9fad;
}
/deep/ .van-button__text {
  font-size: 24px;
  font-family: "DINPro";
}
.login_title {
  font-family: "DINPro", serif;
  font-style: normal;
  font-weight: 500;
  font-size: 0.48rem;
  line-height: 0.66667rem;
  color: #14181f;
  margin-left: 0.53333rem;
  padding: 0.6rem 0.6rem 0;
}
.login_page {
  position: relative;
  width: 100%;
@@ -218,8 +238,7 @@
  flex: 1;
  width: 100%;
  height: 9.7436rem;
  margin-top: 0.4359rem;
  background: #fff;
  padding: 0.4rem 0.6rem 0;
  border-top-left-radius: 0.26667rem;
  border-top-right-radius: 0.26667rem;
@@ -227,13 +246,13 @@
    width: 100%;
    height: 2.0513rem;
    display: flex;
    padding: 0.6rem 0.6rem 0;
    align-items: center;
    font-size: 0.7023rem;
    color: #000;
    font-weight: 600 !important;
    > span {
    >span {
      font-weight: 600 !important;
    }
  }
@@ -243,7 +262,6 @@
    border-top-left-radius: 0.26667rem;
    border-top-right-radius: 0.26667rem;
    padding: 0.34667rem 0.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
@@ -255,6 +273,14 @@
      align-items: center;
      flex-wrap: wrap;
      .forms_title {
        font-size: 0.3rem;
        margin-top: 0.5rem;
        margin-bottom: 0.2rem;
        font-weight: 300;
        opacity: 0.7;
      }
      .user_name,
      .password {
        width: 100%;
@@ -263,7 +289,7 @@
        // background: #1e1e1e;
        border-radius: 0.3564rem;
        > input {
        >input {
          width: 100%;
          height: 100%;
          padding-left: 0.3564rem;
@@ -275,23 +301,37 @@
    /deep/.el-input__inner {
      width: 100%;
      height: 70px;
      background-color: rgb(246, 246, 247) !important;
      // background: #1e1e1e;
      // border-radius: 8px;
      font-size: 0.45rem !important;
      border: none;
      background-color: @Black1 !important;
      font-size: 0.3rem !important;
      border: @Black1 solid 1px;
      color: #fff;
      border-bottom: rgba(#fff, 0.7) solid 1px;
    }
    .bottom_btns {
      width: 100%;
      height: 3.3333rem;
      // margin-top: 0.8528rem;
      .butn {
        width: 100%;
        margin-top: 40px;
        height: 60px;
        border-radius: 8px;
        background-color: @green;
        border-color: @green;
      }
      .butn_2 {
        width: 100%;
        margin-top: 40px;
        height: 60px;
        border-radius: 8px;
        color: @green;
        border-color: @green;
        margin-top: 0.4rem;
      }
      .mes {
        width: 100%;
        height: 20%;
@@ -336,7 +376,7 @@
    align-items: center;
    justify-content: center;
    > span {
    >span {
      font-size: 0.3046rem;
      color: #000;
      background-color: #fff;
@@ -397,7 +437,7 @@
    width: 3rem;
    height: 3.5769rem;
    > img {
    >img {
      width: 100%;
      height: 100%;
    }
@@ -439,6 +479,7 @@
/deep/.el-input__clear {
  font-size: 0.5rem !important;
}
/deep/ .el-input-group__prepend {
  border: none !important;
  border-radius: 0 !important;