| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <template>
- <div class="reg">
- <yd-popup v-model="rgShow" position="center">
- <div class="reg-box">
- <div class="reg-top row allAlignment item-center">
- <span>注册-用户信息</span>
- <img :src="url1" alt @click="closeRg()">
- </div>
- <div class="reg-mian">
- <div>
- <span>会员账号</span>
- <br>
- <input
- type="text"
- v-model="account"
- maxlength="15"
- onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
- @blur="vipID()"
- placeholder="请输入你的账号"
- >
- <br>
- <i :class="idInfo?'infoRed':''">*使用4-15位数字、字母和汉字,不能使用特殊字符</i>
- </div>
- <div>
- <span>会员密码</span>
- <br>
- <input
- type="password"
- maxlength="15"
- v-model="password"
- onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
- @blur="pwd()"
- placeholder="请输入你的密码"
- >
- <br>
- <i :class="pwdInfo?'infoRed':''">*使用6-15位数字或字母,不能使用特殊字符</i>
- </div>
- <div>
- <span>密码确认</span>
- <br>
- <input
- type="password"
- v-model="again_password"
- @blur="monitor()"
- maxlength="15"
- onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
- placeholder="请输入确认密码"
- >
- <br>
- <i :class="suerPwdInfo?'infoRed':''">*请输入确认密码</i>
- </div>
- <div>
- <span>真实姓名</span>
- <br>
- <input
- type="text"
- v-model="userName"
- @blur="username()"
-
- placeholder="请输入真实姓名"
- >
- <br>
- <i :class="userInfo?'infoRed':''">*请输入真实姓名</i>
- </div>
- <div>
- <span>手机号</span>
- <br>
- <input
- type="number"
- v-model="iPhone"
- @blur="iphone()"
- onkeyup="this.value=this.value.replace(/^ +| +$/g,'')"
- placeholder="请输入手机号"
- >
- <br>
- <i :class="phoneInfo?'infoRed':''">*请输入正确的手机号码</i>
- </div>
- </div>
- <div class="row vertical-center">
- <yd-button :class="access?'btnCor':''" @click.native="reg()">完成注册</yd-button>
- </div>
- </div>
- </yd-popup>
- </div>
- </template>
- <script>
- import "@/css/index.css";
- export default {
- name: "register",
- data() {
- return {
-
- idInfo: false, // ID字段提醒输入错误
- pwdInfo: false, //密码提醒
- suerPwdInfo: false, //确认密码
- userInfo: false, //用户信息提醒
- phoneInfo: false, //手机号提醒
- access: false, //btn样式修改
- account: "",
- password: "",
- again_password: "",
- userName: "",
- iPhone: "",
- rgShow:this.$store.state.rgShow,
- url1: require("@/assets/st-imges/guanbi.png"),
- docmHeight: '0', //默认屏幕高度
- showHeight: '0', //实时屏幕高度
- hidshow:true, //显示或者隐藏footer,
- isResize:false, //默认屏幕高度是否已获取
- };
- },
- methods: {
- closeRg(){
- // 关闭投注框改变背景滚动
- this.$store.dispatch('SET_NOROLL',false)
- this.$store.dispatch('GETRGSHOW', false);
- },
- monitor() {
- if (this.again_password != this.password) {
- this.suerPwdInfo = true;
- this.again_password = "";
- } else {
- this.suerPwdInfo = false;
- }
- },
- reg() {
- if (
- this.account != "" &&
- this.password != "" &&
- this.again_password != "" &&
- this.userName != "" &&
- this.iPhone != ""
- ) {
- this.$http.post(this.$ports.login.reg,{account:this.account,name:this.userName,password:this.password,again_password:this.again_password,phone:this.iPhone}).then(res =>{
- if(res.data.status == 1){
- sessionStorage.setItem('token',res.data.data[0].token)
- localStorage.setItem('name',res.data.data[0].name)
- this.$dialog.alert({mes: res.data.msg });
- this.$store.dispatch('GETRGSHOW', false);
- }else{
- this.$dialog.alert({mes: res.data.msg });
- }
- })
- }else{
- this.$dialog.alert({mes: '请完善您的信息!' });
- }
- },
- vipID() {
- if (/^[0-9a-zA-Z\u4e00-\u9fa5]{4,15}$/.test(this.account) && this.password != this.account) {
- this.idInfo = false;
- } else {
- this.account = "";
- this.idInfo = true;
- }
- },
- pwd() {
- if (/^[a-zA-Z0-9]{6,15}$/.test(this.password) && this.password != this.account) {
- this.pwdInfo = false;
- }
- else {
- this.password = "";
- this.pwdInfo = true;
- }
- },
- username() {
- if (/^[a-zA-Z\u4e00-\u9fa5]{2,32}$/.test(this.userName)) {
- this.userInfo = false;
- } else {
- this.userInfo = true;
- this.userName = "";
- }
- },
- iphone() {
- if (/^1[34578]\d{9}$/.test(this.iPhone)) {
- this.phoneInfo = false;
- } else {
- this.phoneInfo = true;
- this.iPhone = "";
- }
- }
- },
- computed:{
- Isshow:function(){
- //根据注册框改变滚动状态
- this.$store.dispatch('SET_NOROLL',this.rgShow)
- this.$store.dispatch('GETRGSHOW',this.rgShow)
- return {
- isshow_code:this.$store.state.rgShow
- }
- },
- noNull(){
- if (
- this.account != "" &&
- this.password != "" &&
- this.again_password != "" &&
- this.userName != "" &&
- this.iPhone != ""
- ) {
- this.access = true;
- }
- return this.access
- }
- },
- watch:{
- noNull(val){
- },
- Isshow(obj){
- this.rgShow=obj.isshow_code
- },
- isshow:{
- istrue(val){
-
- }
- }
- },
- mounted(){
-
- }
- };
- </script>
- <style scoped>
- .reg{
- z-index: 1000;
- position: fixed;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- }
- .reg-box {
- width: 6.75rem;
- background: #f8f8f8;
- border-radius: 0.52rem;
- padding: 0 0.54rem;
- }
- .reg-top {
- font-size: 0.32rem;
- padding-top: 0.58rem;
- padding-bottom: 0.6rem;
- color: #f76649;
- }
- .reg-top img {
- width: 0.26rem;
- height: 0.26rem;
- }
- .reg-mian {
- /* height: 5.46rem; */
- }
- .reg-mian div {
- padding-bottom: 0.27rem;
- }
- .reg-mian span {
- font-size: 0.28rem;
- }
- .reg-mian i {
- font-size: 0.22rem;
- color: #aaaaaa;
- }
- .reg-mian input {
- width: 90%;
- height: 0.46rem;
- border: none;
- outline: none;
- border-bottom: 1px solid #aaaaaa;
- margin: 0.14rem auto 0.1rem ;
- font-size: 0.24rem;
- }
- button {
- width: 1.9rem;
- height: 0.7rem;
- border-radius: 0.35rem;
- border: none;
- background: #aaaaaa;
- color: #f8f8f8;
- margin-bottom: 0.5rem;
- }
- input {
- font-size: 0.2rem;
- }
- .reg-mian .infoRed {
- color: #f76649;
- }
- div.row .btnCor {
- background: #f76649;
- }
- .yd-btn-primary:not(.yd-btn-loading){
- background: #aaaaaa;
- }
- div /deep/ .yd-popup-center{
- margin: 0;
- overflow-y: scroll;
- -webkit-overflow-scrolling: touch;
- position: absolute;
- }
- </style>
|