Browse Source

sass登录

huangb 7 years ago
parent
commit
0231a19b6c
2 changed files with 98 additions and 183 deletions
  1. 91 88
      pages/sassLogin/index.vue
  2. 7 95
      pages/sassLogin/register.vue

+ 91 - 88
pages/sassLogin/index.vue

@@ -823,92 +823,95 @@
   }
 </script>
 <style lang="scss" type="text/scss">
- .y-container {
-   width: 346px !important ;
-   margin: 0 auto;
-   text-align: center;
-   /*background: #FFFFFF;*/
-   /*box-shadow: 0 22px 24px 0 rgba(0,0,0,0.08);*/
-   /*border-radius: 3px;*/
-   .x-login-wrap{
-     margin-top: 45px;
-   }
-   .login-tab {
-     margin-bottom: 30px;
-     width: 100%;
-     height: 50px;
-     line-height: 50px;
-     border-bottom: 1px solid #dcdcdc;
-     span{
-       display: inline-block;
-       width: 30%;
-       font-size: 16px;
-       color: #999;
-       cursor: pointer;
-       &.active{
-         color: #333;
-         border-bottom: 2px solid #282828;
-       }
-     }
-   }
-   .x-login {
-     width: 100%;
-     .x-login-form {
-       .btn.login{
-         width: 306px;
-         height: 34px;
-         background: #5078cb;
-         color: #fff;
-         font-weight: 700;
-         letter-spacing: 4px;
-         border-radius: 0;
-       }
-       .text-position{
-         .el-form-item__content .el-checkbox{
-           margin-left: 0!important;
-         }
-       }
-     }
-     .link-go {
-       position: relative;
-       text-align: right;
-       margin-top: 35px;
-       padding: 0 21px 20px 0;
-       a{
-         margin-left: 20px;
-         font-size: 14px;
-         color: #999;
-         background: 0 0;
-         text-decoration: none;
-         outline: 0;
-         cursor: pointer;
-       }
-       span{
-         position: absolute;
-         top: 1px;
-         display: inline-block;
-         margin: 0 10px;
-         width: 2px;
-         height: 15px;
-         background-color: #ddd;
-       }
-     }
-   }
-   .login-success {
-     padding-top: 95px;
-     width: 100%;
-     height: 400px;
-     margin: 0 auto;
-     text-align: center;
-     i{
-       font-size: 125px;
-       color: #22ac38;
-     }
-     p{
-       margin-top: 20px;
-       font-size: 28px;
-       color: #333;
-     }
-   }
- }
+  .y-container {
+    position: relative;
+    bottom: -50px;
+    width: 346px !important ;
+    margin: 0 auto;
+    text-align: center;
+    /*background: #FFFFFF;*/
+    /*box-shadow: 0 22px 24px 0 rgba(0,0,0,0.08);*/
+    /*border-radius: 3px;*/
+    .x-login-wrap{
+      margin: 20px 0 0!important ;
+      height: auto;
+    }
+    .login-tab {
+      margin-bottom: 30px;
+      width: 100%;
+      height: 50px;
+      line-height: 50px;
+      border-bottom: 1px solid #dcdcdc;
+      span{
+        display: inline-block;
+        width: 30%;
+        font-size: 16px;
+        color: #999;
+        cursor: pointer;
+        &.active{
+          color: #333;
+          border-bottom: 2px solid #282828;
+        }
+      }
+    }
+    .x-login {
+      width: 100%;
+      .x-login-form {
+        .btn.login{
+          width: 306px;
+          height: 34px;
+          background: #5078cb;
+          color: #fff;
+          font-weight: 700;
+          letter-spacing: 4px;
+          border-radius: 0;
+        }
+        .text-position{
+          .el-form-item__content .el-checkbox{
+            margin-left: 0!important;
+          }
+        }
+      }
+      .link-go {
+        position: relative;
+        text-align: right;
+        margin-top: 35px;
+        padding: 0 21px 20px 0;
+        a{
+          margin-left: 20px;
+          font-size: 14px;
+          color: #999;
+          background: 0 0;
+          text-decoration: none;
+          outline: 0;
+          cursor: pointer;
+        }
+        span{
+          position: absolute;
+          top: 1px;
+          display: inline-block;
+          margin: 0 10px;
+          width: 2px;
+          height: 15px;
+          background-color: #ddd;
+        }
+      }
+    }
+    .login-success {
+      padding-top: 95px;
+      width: 100%;
+      height: 400px;
+      margin: 0 auto;
+      text-align: center;
+      i{
+        font-size: 125px;
+        color: #22ac38;
+      }
+      p{
+        margin-top: 20px;
+        font-size: 28px;
+        color: #333;
+      }
+    }
+  }
 </style>

+ 7 - 95
pages/sassLogin/register.vue

@@ -235,6 +235,7 @@
       this.$nextTick(() => {
         this.getUrl()
         this.getCode()
+        console.log(decodeURIComponent(this.$route.query.baseUrl))
       })
     },
     computed: {
@@ -272,6 +273,7 @@
       },
       // 快速注册
       waySubmit () {
+        console.log(this.$route.params.baseUrl)
         if (this.mobileChecked && this.codeChecked && this.checked) {
           this.isShowLoading = true
           let param = new FormData()
@@ -293,61 +295,9 @@
             .then(response => {
               this.isShowLoading = false
               if (response.data.success) {
-                if (response.data.content.type) {
-                  if (response.data.content.type === 'mall') {
-                    let param = response.data.content.data
-                    let a = ''
-                    for (let n in param) {
-                      a += (n + '=' + encodeURIComponent(param[n]) + '&')
-                    }
-                    let params = a.substr(0, a.length - 1)
-                    this.isShowLoading = true
-                    if (response.data.content.currentUrl) {
-                      this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
-                        name: 'successCallback',
-                        timeout: 3000
-                      }, (err, data) => {
-                        if (err) {
-                          this.$message.error('注册成功,请点击下方“立即登录”完成登录')
-                          this.isShowLoading = false
-                          throw err
-                        } else {
-                          this.loginOther(response, params)
-                        }
-                      })
-                    } else {
-                      this.loginOther(response, params, 3000)
-                    }
-                  } else if (response.data.content.type === 'city') {
-                    let param = response.data.content.data
-                    let a = ''
-                    for (let n in param) {
-                      a += (n + '=' + encodeURIComponent(param[n]) + '&')
-                    }
-                    let params = a.substr(0, a.length - 1)
-                    this.isShowLoading = true
-                    if (response.data.content.currentUrl) {
-                      this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
-                        name: 'successCallback',
-                        timeout: 3000
-                      }, (err, data) => {
-                        if (err) {
-                          this.$message.error('注册成功,请点击下方“立即登录”完成登录')
-                          this.isShowLoading = false
-                          throw err
-                        } else {
-                          this.loginCityOther(response, params)
-                        }
-                      })
-                    } else {
-                      this.loginCityOther(response, params, 3000)
-                    }
-                  }
-                } else {
-                  let userUU = response.data.content.userUU
-                  console.log(userUU)
-                  window.location.href = `/overRegister/${userUU}`
-                }
+                this.isSuccess = false
+                this.isShowLoading = false
+                this.getJsonp(decodeURIComponent(this.$route.query.baseUrl))
               } else {
                 return Promise.reject(response.data)
               }
@@ -431,52 +381,14 @@
             }
           })
         })
-      },
-      // crossAfter (url) {
-      //   try {
-      //     window.location.href = url
-      //   } catch (err) {
-      //     console.log(err)
-      //   }
-      // },
-      loginOther (response, a, timeout) {
-        // const crossAfter = this.crossAfter
-        let promises = []
-        for (let i in response.data.content.loginUrls) {
-          if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
-            promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
-          }
-        }
-        // let returnUrl = decodeURIComponent(this.$route.query.returnURL)
-        Promise.all(promises).then(() => {
-          this.isSuccess = false
-          this.isShowLoading = false
-          // crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
-        }).catch(() => {
-          this.isSuccess = false
-          this.isShowLoading = false
-          // crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
-        })
-      },
-      loginCityOther (response, a, timeout) {
-        const crossAfter = this.crossAfter
-        let promises = []
-        for (let i in response.data.content.loginUrls) {
-          if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
-            promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
-          }
-        }
-        Promise.all(promises).then(() => {
-          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
-        }).catch(() => {
-          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
-        })
       }
     }
   }
 </script>
 <style lang="scss" scoped>
   .go-register {
+    position: relative;
+    bottom: -50px;
     margin: 0 auto;
     width: 100%;
     background: #eee;