123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <!DOCTYPE html>
- <html class="h100p">
- <head>
- <meta charset="utf-8">
- <title>注册-创业帮</title>
- <meta name="keywords" content="注册-创业帮">
- <meta name="description" content="注册-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="注册-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="bgc-back h100p nopb regist">
- <div id="app" v-cloak>
- <van-nav-bar class="bgc-back user_rank_explan_title" left-arrow @click-left="backlogin" v-if="toptitleisshow">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- <div class="regist-box-input pt8 pb32 pl32 pr32">
- <div class="f24 c333 b">注册创业帮</div>
- <div class="f12 c999 pb32" v-if="phoneissure && passwordissure">请填写以下注册信息</div>
- <div class="f12 c999 pb32 cstrong_color" v-if="!phoneissure">手机号填写有误</div>
- <div class="f12 c999 pb32 cstrong_color" v-if="!passwordissure">密码长度应为6~20位</div>
- <div class="f12 c666 mb6">新用户注册</div>
- <van-field class="mb12" v-model="userinfo.Mobile" @input="checkRegist" placeholder="请输入注册手机号"></van-field>
- <div class="f12 c666 mb6">验证码</div>
- <van-field class="user-phone mb12" center clearable placeholder="请输入验证码" @input="checkRegist" v-model="userinfo.MobileCode">
- <template #button>
- <van-button class="fl" plain color="#FF502A" @click="getsmscode" v-if="codeisclick">获取验证码</van-button>
- <van-button class="fl" plain color="#FF502A" disabled v-else>{{countdown}}s</van-button>
- </template>
- </van-field>
- <div class="f12 c666 mb6">推荐码(必填)</div>
- <van-field class="mb12" v-model="userinfo.ReferenceCode" placeholder="请输入推荐码" @input="checkRegist"></van-field>
- <div class="f12 c666 mb6">登录密码</div>
- <van-field v-model="userinfo.LoginPwd" @input="checkRegist" :type="isShowPwd ? 'text' : 'password'" placeholder="请设置登录密码">
- <template #button>
- <van-button class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></van-button>
- </template>
- </van-field>
- <div class="df pt16">
- <van-checkbox v-model="agreement" icon-size=".426667rem" checked-color="#ec5e3b" @change="checkRegist"><span class="f14 c999">我已阅读并同意</span><span class="f14 more" @click="goservice">「创业帮服务协议」</span></van-checkbox>
- </div>
- <div class="pt16" v-cloak>
- <van-button type="primary" block color="#FF502A" :disabled="canRegist ? false : true" @click="regist">注册</van-button>
- </div>
- <div class="pt16 tc">
- <div class="f12 more">注意:用户年龄必须18-60周岁</div>
- </div>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- toptitleisshow:false,
- isShowPwd: false,
- userinfo:{
- Mobile: '',
- ReferenceCode: '',
- LoginPwd:'',
- MobileCode:''
- },
- agreement: false,
- canRegist: false,
- phoneissure:true,
- passwordissure:true,
- codeisclick:true,
- countdown:60
- };
- },
- created() {
- this.toptitleisshow = toptitleisshow;
- },
- methods: {
- //- 是否显示密码
- showPwd(){
- this.isShowPwd = !this.isShowPwd;
- },
- //- 验证表单是否填写
- checkRegist(){
- this.canRegist = (this.userinfo.Mobile !== '' && this.userinfo.ReferenceCode !== '' && this.userinfo.LoginPwd !== '' && this.userinfo.MobileCode !== '' && this.agreement == true) ? true : false;
- },
- //- 获取验证码
- async getsmscode(){
- if(verification(this.userinfo.Mobile)) return;
- this.codeisclick = false;
- setTimeout(()=>{
- this.codeisclick = true;
- },60000);
- const timer = setInterval(()=>{
- this.countdown--;
- if(this.countdown === 0) {
- this.countdown = 60;
- clearInterval(timer)
- }
- },1000);
- const res = await postRequest('/api/v1/mobilecodecheck/sendsms',JSON.stringify({Mobile:this.userinfo.Mobile}));
- if(res) tips('验证码已发送,请注意查收');
- },
- //- 点击注册
- async regist(){
- if(this.userinfo.ReferenceCode.length !== 8) return tips('推荐码长度为8位');
- if(this.userinfo.ReferenceCode[0] !== 'K') return tips('推荐码以大写K开头');
- if(!verificationphonenumber(this.userinfo.Mobile)){
- return this.phoneissure = false;
- };
- if(this.userinfo.LoginPwd.length < 6 && this.userinfo.LoginPwd.length > 20){
- return this.passwordissure = false;
- };
- if(verificationpassword(this.userinfo.LoginPwd)) return;
- this.phoneissure = true;
- this.passwordissure = true;
- const value = JSON.stringify(this.userinfo);
- const res = await postRequest('/api/v1/users/register?t='+Math.random(6),value);
- if(res.status !== '1') return tips(res.info);
- tips('注册成功!');
- setTimeout(()=>{
- this.backlogin();
- },2000)
- },
- //- 返回登录
- backlogin(){
- PublicLib.GoBack({Level:1});
- },
- goservice(){
- PublicLib.Goto({Url:'user-servce-agreement'});
- }
- }
- });
- </script>
- </body>
- </html>
|