瀏覽代碼

Merge remote-tracking branch 'origin/dev' into dev

huangb 7 年之前
父節點
當前提交
9495e42c14

+ 8 - 8
app.html

@@ -91,18 +91,18 @@
 
   document.getElementById("weChatBtn").addEventListener('click', function() {
     setTimeout(function() {
-      let url = window.location.search
-      let request = {}
+      var url = window.location.search
+      var request = {}
       if (url.indexOf('?' !== -1)) {
-        let str = url.substr(1)
-        let strs = str.split('&')
-        for (let i = 0; i < strs.length; i++) {
+        var str = url.substr(1)
+        var strs = str.split('&')
+        for (var i = 0; i < strs.length; i++) {
           request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
         }
       }
-      let appId = request['appId'] || ''
-      let returnUrl = request['returnURL'] || ''
-      let baseUrl = request['baseUrl'] || ''
+      var appId = request['appId'] || ''
+      var returnUrl = request['returnURL'] || ''
+      var baseUrl = request['baseUrl'] || ''
       new WxLogin({
         id: 'login_container',
         appid: 'wx4511639d0a71b945',

+ 5 - 0
assets/scss/mobileCommon.scss

@@ -31,6 +31,11 @@
 }
 .page-part{
   margin-bottom:.4rem;
+  & > span{
+    font-size:.26rem;
+    color:#000;
+    line-height:.35rem;
+  }
   .img-list{
     .item{
       display:inline-block;

+ 120 - 4
components/mobile/registerPersonal/index.vue

@@ -4,14 +4,18 @@
       <p>个人注册</p>
       <a class="go" @click="goRegister"><i class="fa fa-long-arrow-right"></i>企业注册</a>
     </div>
+    <div class="content-tab">
+      <span :class="{speed: speediness === false}" @click="clickWay(false)">用户名注册</span>
+      <span :class="{speed: speediness === true}" @click="clickWay(true)">手机号注册</span>
+    </div>
     <div class="f-form">
-      <div class="page-part">
+      <div class="page-part" v-if="!speediness">
         <mt-field :state="state.vipName"
                   placeholder="会员名"
                   :attr="{ maxlength: 20 }"
                   v-model="vipName"></mt-field>
       </div>
-      <div class="page-part">
+      <div class="page-part" v-if="!speediness">
         <mt-field :state="state.password"
                   placeholder="密码"
                   :attr="{ maxlength: 20 }"
@@ -23,7 +27,7 @@
           <p class="pwd">密码须为8-20字符的英文、数字混合</p>
         </template>
       </div>
-      <div class="page-part">
+      <div class="page-part" v-if="!speediness">
         <mt-field :state="state.confirm"
                   placeholder="确认密码"
                   v-model="confirm"
@@ -53,7 +57,7 @@
       <div class="page-part">
         <el-checkbox v-model="checked">我已阅读并同意 <a class="rgba" href="/common/agreement">《优软云服务条款》</a></el-checkbox>
       </div>
-      <mt-button type="primary" size="large" @click.native="submit">完成注册</mt-button>
+      <mt-button type="primary" size="large" @click.native="allSubmit">完成注册</mt-button>
     </div>
   </div>
 </template>
@@ -64,6 +68,7 @@
     name: 'registerPerson',
     data () {
       return {
+        speediness: false,
         imgSrc: '',
         code: '',
         step: 1,
@@ -102,6 +107,14 @@
       }
     },
     methods: {
+      // 切换注册方式
+      clickWay (type) {
+        if (this.speediness !== type) {
+          this.speediness = type
+          this.imgSrc = ''
+          this.getCode()
+        }
+      },
       getCode () {
         this.imgSrc = '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf()
       },
@@ -356,6 +369,84 @@
             })
         }
       },
+      // 快速登录
+      waySubmit () {
+        if (this.state.mobile !== 'success') {
+          this.codeMobile()
+        } else if (this.state.token !== 'success') {
+          this.codeToken()
+        } else if (this.checked === false) {
+          this.downToast('您对阅读条款未做勾选')
+        } else {
+          this.$indicator.open('注册中...')
+          let param = new FormData()
+          param.append('mobile', this.mobile)
+          // param.append('mobileArea', '')
+          param.append('appId', this.$store.state.option.appId)
+          param.append('code', this.token)
+          param.append('token', this.tokenCode)
+          param.append('t', this.$route.query.tk ? this.$route.query.tk : '')
+          if (this.$route.query.baseUrl) {
+            param.append('baseUrl', this.$route.query.baseUrl)
+          }
+          if (this.$route.query.returnURL) {
+            param.append('returnUrl', this.$route.query.returnURL)
+          }
+          let config = {
+            header: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/sso/personal/register/sms', param, config)
+            .then(response => {
+              this.$indicator.close()
+              if (response.data.success) {
+                if (response.data.content.data) {
+                  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 {
+                  let userUU = response.data.content.userUU
+                  window.location.href = `/overRegister/${userUU}`
+                }
+              } else if (response.data.error) {
+                this.$toast({
+                  message: response.data.errMsg,
+                  iconClass: 'el-icon-error'
+                })
+              }
+            }).catch((err) => {
+              this.$indicator.close()
+              this.downToast(err.errMsg)
+            })
+        }
+      },
+      // 提交注册流程
+      allSubmit () {
+        if (this.speediness) {
+          this.waySubmit()
+        } else {
+          this.submit()
+        }
+      },
       getJsonp: function (url, timeout = 500) {
         return new Promise((resolve, reject) => {
           this.$jsonp(url, {
@@ -397,3 +488,28 @@
   }
 </script>
 
+<style type="text/scss" scoped lang="scss">
+  .content-tab{
+    width: 70%;
+    margin: 0 auto;
+    margin-top:.3rem;
+    span{
+      display:inline-block;
+      width:49%;
+      vertical-align:top;
+      text-align: center;
+      line-height:.6rem;
+      height:.6rem;
+      font-size:16px;
+      border:1px solid #E7E7E7;
+      background: #E7E7E7;
+      color:#999;
+      &.speed{
+         color:#3F84F6;
+         border:1px solid #3F84F6;
+        background: #fff;
+       }
+    }
+  }
+</style>
+

+ 3 - 3
components/mobile/reset/stepMobile.vue

@@ -72,11 +72,11 @@
         } else {
           this.$indicator.open('获取中...')
           let _this = this
-          this.$http.get('/sso/personal/register/checkCode', {params: {mobile: this.info, timestamp: new Date().getTime() + ''}})
+          this.$http.get('/sso/resetPwd/check/mobile', {params: {mobile: this.info, timestamp: new Date().getTime() + ''}})
             .then(response => {
               this.$indicator.close()
-              if (response.data) {
-                this.tokenCode = response.data.token
+              if (response.data.content) {
+                this.tokenCode = response.data.content.token
                 this.$toast({
                   message: '验证码已经发送到您的手机,请注意查收',
                   iconClass: 'el-icon-success'

+ 4 - 1
components/mobile/reset/stepSecurity .vue

@@ -44,7 +44,10 @@
           answer1: '',
           answer2: ''
         },
-        questions: '',
+        questions: [
+          {question: ''},
+          {question: ''}
+        ],
         token: ''
       }
     },