wenglk 6 vuotta sitten
vanhempi
commit
d2fea917ba
3 muutettua tiedostoa jossa 100 lisäystä ja 24 poistoa
  1. BIN
      src/assets/img/banner1.png
  2. BIN
      src/assets/img/banner2.png
  3. 100 24
      src/views/home/mBanner.vue

BIN
src/assets/img/banner1.png


BIN
src/assets/img/banner2.png


+ 100 - 24
src/views/home/mBanner.vue

@@ -106,7 +106,9 @@
               </div>
               <div class="icode-line">
                 <input type="text" placeholder="请输入验证码" class="input" v-model='regform.code'>
-                <button @click='changeParam(1);sendMail()'>发送验证码</button>
+                <button @click='changeParam(1);sendMail()' v-if='codeDisabled == 1'>发送验证码</button>
+                <button v-if='codeDisabled == 2' class="alsend">{{'已发送'+time}}</button>
+                <button @click='changeParam(1);sendMail()' v-if='codeDisabled ==3'>重新发送</button>
               </div>
               <div class="login-line">
                 <span><img src="../../assets/img/password.png"></span>
@@ -136,7 +138,9 @@
               </div>
               <div class="icode-line">
                 <input type="text" placeholder="请输入验证码" class="input" v-model='regform.code'>
-                <button @click='changeParam(2);sendCode()'>发送验证码</button>
+                <button @click='changeParam(2);sendCode()' v-if='codeDisabled == 1'>发送验证码</button>
+                <button v-if='codeDisabled == 2' class="alsend">{{'已发送'+time}}</button>
+                <button @click='changeParam(2);sendCode()' v-if='codeDisabled ==3'>重新发送</button>
               </div>
               <div class="login-line">
                 <span><img src="../../assets/img/password.png"></span>
@@ -272,8 +276,10 @@
       return{
         username:'',
         usertip:2,
-        activeName: 'first',        
-        select: '',
+        activeName: 'first',
+        select:'',        
+        time:60,
+        codeDisabled:1,
         scrollBottombar:false,
         scrollTopbar:false,
         regshow:2,
@@ -486,7 +492,7 @@
             this.axios.post('https://dev407.33.cn/api/broker/login',param).then((res)=>{
             const result = res.data;
             if(result.code!=200){
-              console.log(result.message);
+              // console.log(result.message);
               this.$notify({
                 title:'提示',
                 message: result.message,
@@ -515,7 +521,7 @@
       },
       toRegister: function(checked){
         const Form = this.regform;
-        console.log(Form);
+        // console.log(Form);
         const param = new URLSearchParams();
         for (let item in Form){
           param.append(item,Form[item]);
@@ -559,27 +565,72 @@
                 this.axios.post('https://dev407.33.cn/api/broker/register',param).then((res)=>{
                 const result = res.data;
                   if(result.code!=200){
-                    console.log(result.message);
+                    // console.log(result.message);
                     this.$notify({
                       title:'提示',
                       message: result.message,
                       type:'warning',
                     })
+                    const LogForm = this.loginform;
+                    // console.log(LogForm);
+                    LogForm.type = Form.type;
+                    LogForm.area = Form.area;
+                    LogForm.password = Form.password;
+                    LogForm.mobile = Form.mobile;
+                    LogForm.email = Form.email;
+                    // console.log(LogForm);
+                    const logparam = new URLSearchParams();
+                    for (let item in LogForm){
+                      logparam.append(item,Form[item]);
+                    }
+                    console.log(logparam);
                   }else{
                     this.$notify({
                     title:'成功',
                     message:'注册成功',
                     type:'success'
                     })
-                    this.username = this.regform.email!=''? this.regform.email:this.regform.mobile;
-                    this.usertip = 1;
-                    this.regshow = 4;
-                    this.Authorization = 'Bearer '+result.data.access_token;
-                    sessionStorage.setItem('regshow',this.regshow);
-                    sessionStorage.setItem('usertip',this.usertip);
-                    sessionStorage.setItem('username',this.username);
-                    sessionStorage.setItem('token_code',this.Authorization);
-                    console.log('注册成功')
+                    const LogForm = this.loginform;
+                    LogForm.type = Form.type;
+                    LogForm.area = Form.area;
+                    LogForm.password = Form.password;
+                    LogForm.mobile = Form.mobile;
+                    LogForm.email = Form.email;
+                    const logparam = new URLSearchParams();
+                    for (let item in LogForm){
+                      logparam.append(item,LogForm[item]);
+                    }
+                    this.axios.post('https://dev407.33.cn/api/broker/login',logparam).then((res)=>{
+                    const logresult = res.data;
+                    if(logresult.code!=200){
+                      // console.log(result.message);
+                      this.$notify({
+                        title:'提示',
+                        message: logresult.message,
+                        type:'warning',
+                      })
+                    }else{
+                      this.username = logresult.data.username;
+                      this.usertip = 1;
+                      this.regshow = 4;
+                      this.Authorization = 'Bearer '+logresult.data.access_token;
+                      sessionStorage.setItem('regshow',this.regshow);
+                      sessionStorage.setItem('usertip',this.usertip);
+                      sessionStorage.setItem('username',this.username);
+                      sessionStorage.setItem('token_code',this.Authorization);
+                      console.log('登陆成功');
+                    }
+                    })
+
+                    // this.username = this.regform.email!=''? this.regform.email:this.regform.mobile;
+                    // this.usertip = 1;
+                    // this.regshow = 4;
+                    // this.Authorization = 'Bearer '+result.data.access_token;
+                    // sessionStorage.setItem('regshow',this.regshow);
+                    // sessionStorage.setItem('usertip',this.usertip);
+                    // sessionStorage.setItem('username',this.username);
+                    // sessionStorage.setItem('token_code',this.Authorization);
+                    // console.log('注册成功')
                   }
                 })
               }
@@ -623,7 +674,6 @@
         for (let item in Form){
           param.append(item,Form[item]);
         }
-        console.log(param);
         if (this.regform.mobile==''){
           this.$notify({
             title:'提示',
@@ -634,16 +684,27 @@
           this.axios.post('https://dev407.33.cn/api/send/newsms',param).then((res)=>{
             const result = res.data;
             if(result.code!=200){
-              console.log(result.message);
               this.$notify({
                 title:'提示',
                 message: result.message,
                 type:'warning',
               })
             }else{
-              this.username = result.data.username;
-              this.regshow = 4;
-              console.log('注册成功')
+              this.$notify({
+                title:'提示',
+                message: '发送成功',
+                type:'success',
+              })
+              let timeCode = this;
+              timeCode.codeDisabled = 2;
+              let interval = window.setInterval(function(){
+                if((timeCode.time--)<= 0){
+                  timeCode.time = 60;
+                  timeCode.codeDisabled = 3;
+                  window.clearInterval(interval);
+                }
+              },1000);
+              //倒计时
             }
           })
         }
@@ -664,14 +725,27 @@
           this.axios.post('https://dev407.33.cn/api/send/newmail',param).then((res)=>{
             const result = res.data;
             if(result.code!=200){
-              console.log(result.message);
               this.$notify({
                 title:'提示',
                 message: result.message,
                 type:'warning',
               })
             }else{
-              console.log('发送成功')
+              this.$notify({
+                title:'提示',
+                message: '发送成功',
+                type:'success',
+              })
+              let timeCode = this;
+              timeCode.codeDisabled = 2;
+              let interval = window.setInterval(function(){
+                if((timeCode.time--)<= 0){
+                  timeCode.time = 60;
+                  timeCode.codeDisabled = 3;
+                  window.clearInterval(interval);
+                }
+              },1000);
+              //倒计时
             }
           })
         }
@@ -1305,7 +1379,9 @@
 .slect{
   margin-top: 5px;
 }
-    
+.alsend{
+  background: #eee !important;
+}    
 </style>
 
 <style>