| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007 |
- <template>
- <div class="register">
- <div class="container">
- <div class="content">
- <div class="content-top">
- <h3>个人注册</h3>
- <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>
- <el-form :model="item" :rules="rules2" ref="item" label-width="100px" class="demo-ruleForm">
- <el-form-item prop="vipName" v-if="!speediness">
- <el-input type="text" v-model="item.vipName" auto-complete="off" placeholder="会员名"></el-input>
- </el-form-item>
- <el-form-item prop="password" v-if="!speediness">
- <el-input type="password" v-model="item.password" auto-complete="new-password" placeholder="登录密码"></el-input>
- <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
- <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
- <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
- <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
- </el-form-item>
- <el-form-item prop="confirm" v-if="!speediness">
- <el-input type="password"
- v-model="item.confirm"
- v-bind:class="{active: showPasswordError}"
- auto-complete="new-password"
- placeholder="密码确认"></el-input>
- <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
- </el-form-item>
- <el-form-item prop="mobile">
- <el-input v-model="item.mobile"
- v-bind:class="{active: mobileRegister}"
- placeholder="手机号码"></el-input>
- <span class="tip" v-show="showMsgTip">单个手机号只能注册一个用户</span>
- <span class="tip tip-mobile" v-show="mobileRegister">该手机号已被注册</span>
- </el-form-item>
- <el-form-item prop="captcha" class="captcha">
- <el-input type="text"
- v-model="ImgCode"
- auto-complete="off"
- class="code-input"
- @keyup.enter.native="getCheckCode"></el-input>
- <img id="captchaImage2" class="code-img" src="/sso/login/checkCode"/>
- <a class="code-click" @click="getCode">看不清换一张</a>
- </el-form-item>
- <el-form-item prop="code">
- <el-input type="text" v-model="item.code"
- v-bind:class="{ active: codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
- <el-button type="primary" class="code"
- v-show="sendPersonalCode"
- @click="getCheckCode"
- :disabled="this.checkMobile">获取验证码</el-button>
- <el-button type="primary" v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
- <span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
- </el-form-item>
- <el-form-item>
- <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
- <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
- <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
- </el-form-item>
- <el-form-item>
- <a class="btn finish" @click="allSubmit">确认注册</a>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <div class="login">已有账号?<a :href="returnLogin">立即登录</a></div>
- <loading v-show="isShowLoading"/>
- </div>
- <!--尾部-->
- <div v-html="loginStyle.footUrl" class="footer"></div>
- </div>
- </template>
- <script>
- import md5 from 'js-md5'
- import Loading from '~components/common/loading/Loading.vue'
- export default {
- name: 'PersonalRegistration',
- components: {
- Loading
- },
- data () {
- var validateName = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('会员名不能为空'))
- this.vipNameChecked = false
- } else {
- if (this.item.vipName !== '') {
- if (value.length < 2 || value.length > 20) {
- callback(new Error('请填写合适的会员名称,2~20个字符'))
- this.vipNameChecked = false
- } else {
- this.vipNameChecked = true
- }
- }
- }
- callback()
- }
- var validatePass = (rule, value, callback) => {
- if (this.item.password !== '') {
- if (value.length <= 20 && value.length >= 8) {
- var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
- var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
- if (reg1.test(value)) {
- // callback(new Error('密码强度强'))
- this.showMsgTip3 = true
- this.showMsgTip2 = false
- this.showMsgTip1 = false
- this.showMsgTip4 = false
- this.passwordChecked = true
- } else if (reg2.test(value)) {
- // callback(new Error('密码强度中'))
- this.showMsgTip2 = true
- this.showMsgTip3 = false
- this.showMsgTip1 = false
- this.showMsgTip4 = false
- this.passwordChecked = true
- } else {
- this.showMsgTip1 = true
- this.showMsgTip3 = false
- this.showMsgTip2 = false
- this.showMsgTip4 = false
- this.passwordChecked = false
- }
- } else {
- this.showMsgTip3 = false
- this.showMsgTip2 = false
- this.showMsgTip1 = false
- this.showMsgTip4 = true
- this.passwordChecked = false
- }
- }
- callback()
- }
- var validatePassTip = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请输入密码'))
- this.passwordChecked = false
- } else {
- if (this.item.password !== '') {
- if (value.length <= 20 && value.length >= 8) {
- var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
- var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
- if (reg1.test(value)) {
- this.passwordChecked = true
- } else if (reg2.test(value)) {
- this.passwordChecked = true
- } else {
- callback(new Error('密码须为8-20字符的英文、数字混合'))
- this.passwordChecked = false
- }
- } else {
- callback(new Error('密码须为8-20字符的英文、数字混合'))
- this.passwordChecked = false
- }
- if (this.item.confirm !== '') {
- if (value !== this.item.confirm) {
- this.showPasswordError = true
- // callback(new Error('两次输入密码不一致!'))
- this.confirmChecked = false
- } else {
- this.confirmChecked = true
- this.showPasswordError = false
- callback()
- }
- }
- }
- callback()
- }
- }
- var validatePass2 = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请再次输入密码'))
- this.confirmChecked = false
- this.showPasswordError = false
- } else if (value !== this.item.password) {
- // callback(new Error('两次输入密码不一致!'))
- this.showPasswordError = true
- this.confirmChecked = false
- } else {
- this.confirmChecked = true
- this.showPasswordError = false
- callback()
- }
- }
- var validateMobile = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的手机号'))
- this.showMsgTip = false
- this.checkMobile = true
- this.mobileRegister = false
- this.mobileChecked = false
- } else {
- if (this.item.mobile !== '') {
- var reg = /^1([0-9]{10})$/
- if (!reg.test(value)) {
- callback(new Error('请填写正确的手机号'))
- this.showMsgTip = false
- this.checkMobile = true
- this.mobileRegister = false
- this.mobileChecked = false
- } else {
- this.$http.get(`/api/user/checkMobile`, {params: {mobile: this.item.mobile, mobileArea: ''}})
- .then(response => {
- if (response.data.hasRegister) {
- this.mobileRegister = true
- this.showMsgTip = false
- this.checkMobile = true
- this.mobileChecked = false
- } else {
- this.showMsgTip = false
- this.checkMobile = false
- this.mobileRegister = false
- this.mobileChecked = true
- }
- })
- }
- }
- callback()
- }
- }
- var validateCode = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的验证码'))
- this.codeErrorChecked = false
- this.codeChecked = false
- } else {
- if (this.item.mobile === '') {
- callback(new Error('请先填写正确的手机号'))
- } else {
- if (this.token) {
- if (this.item.code.length === 6) {
- let param = new FormData()
- param.append('mobile', this.item.mobile)
- param.append('code', this.item.code)
- param.append('token', this.token)
- let config = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post(`/sso/personal/register/checkCode`, param, config)
- .then(response => {
- if (response.data.success) {
- this.codeChecked = true
- this.codeErrorChecked = false
- } else {
- this.codeErrorChecked = true
- this.codeChecked = false
- // callback(new Error('验证码输入错误'))
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.codeErrorMsg = err.errMsg
- // this.$message.error(err.errMsg)
- })
- } else {
- callback(new Error('请输入正确的验证码'))
- this.codeChecked = false
- this.codeErrorChecked = false
- }
- } else {
- callback(new Error('请先获取验证码'))
- this.codeChecked = false
- this.codeErrorChecked = false
- }
- }
- callback()
- }
- }
- var validateCodeIsEmpty = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的验证码'))
- this.codeErrorChecked = false
- this.codeChecked = false
- } else {
- if (this.item.mobile === '') {
- callback(new Error('请先填写正确的手机号'))
- } else {
- if (this.token) {
- if (this.item.code.length === 6) {
- let param = new FormData()
- param.append('mobile', this.item.mobile)
- param.append('code', this.item.code)
- param.append('token', this.token)
- let config = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post(`/sso/personal/register/checkCode`, param, config)
- .then(response => {
- if (response.data.success) {
- this.codeChecked = true
- this.codeErrorChecked = false
- } else {
- this.codeErrorChecked = true
- this.codeChecked = false
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.codeErrorMsg = err.errMsg
- })
- } else {
- callback(new Error('请输入正确的验证码'))
- this.codeChecked = false
- this.codeErrorChecked = false
- }
- } else {
- callback(new Error('请先获取验证码'))
- this.codeChecked = false
- this.codeErrorChecked = false
- }
- }
- callback()
- }
- }
- return {
- speediness: false,
- ImgCode: '',
- item: {
- vipName: '',
- password: '',
- confirm: '',
- mobile: '',
- code: ''
- },
- isShowLoading: false,
- showPasswordError: false,
- vipNameChecked: false,
- passwordChecked: false,
- confirmChecked: false,
- mobileChecked: false,
- codeChecked: false,
- codeErrorChecked: false,
- showMsgTip: true,
- showMsgTip1: false,
- showMsgTip2: false,
- showMsgTip3: false,
- showMsgTip4: false,
- checkMobile: true,
- checked: true,
- token: '',
- mobileRegister: false,
- sendPersonalCode: true,
- codeErrorMsg: '',
- personal_time: 0,
- queryLink: '',
- appId: '',
- returnLogin: '',
- rules2: {
- vipName: [
- { validator: validateName, trigger: 'blur' }
- ],
- password: [
- { validator: validatePassTip, trigger: 'blur' },
- { validator: validatePass, trigger: 'change' }
- ],
- confirm: [
- { required: true, validator: validatePass2, trigger: 'blur' }
- ],
- mobile: [
- { validator: validateMobile, trigger: 'blur' }
- ],
- code: [
- { validator: validateCode, trigger: 'change' },
- { validator: validateCodeIsEmpty, trigger: 'blur' }
- ]
- }
- }
- },
- mounted () {
- // 获取链接
- this.$nextTick(() => {
- this.getUrl()
- this.getCode()
- })
- },
- computed: {
- loginStyle () {
- return this.$store.state.login.loginStyle.data.content
- },
- agreementUrl () {
- return this.$store.state.login.agreementUrl.data.content
- }
- },
- methods: {
- // 切换注册方式
- clickWay (type) {
- this.speediness = type
- this.ImgCode = ''
- this.$refs.item.resetFields()
- },
- // 获取链接
- getUrl () {
- var url = window.location.search
- var request = {}
- var origin = window.location.origin
- this.returnLogin = origin + url
- if (url.indexOf('?' !== -1)) {
- var str = url.substr(1)
- var strs = str.split('&')
- this.queryLink = str
- for (var i = 0; i < strs.length; i++) {
- request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
- }
- }
- this.appId = request['appId'] || ''
- },
- // 注册
- goRegister () {
- window.location.href = `/register/enterpriseRegistration${this.queryLink ? '?' + this.queryLink : ''}`
- },
- // 我同意是否被选中
- checkboxChecked () {
- this.checked = !this.checked
- },
- // 用户名表单提交
- submit () {
- if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked && this.checked) {
- if (this.item.password !== this.item.confirm) {
- this.$message.error('请确认两次填写密码是否一致')
- } else {
- this.isShowLoading = true
- let param = new FormData()
- param.append('vipName', this.item.vipName)
- param.append('password', this.item.password)
- param.append('mobile', this.item.mobile)
- // param.append('mobileArea', '')
- param.append('appId', this.appId)
- param.append('code', this.item.code)
- param.append('token', this.token)
- param.append('t', this.$route.query.tk ? this.$route.query.tk : '')
- param.append('returnUrl', this.$route.query.returnURL ? this.$route.query.returnURL : '')
- let config = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post('/sso/personal/register', param, config)
- .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
- let returnUrl = ''
- if (this.$route.query.returnURL) {
- returnUrl = decodeURIComponent(this.$route.query.returnURL)
- }
- window.location.href = returnUrl || `/overRegister/${userUU}`
- }
- } else {
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.$message.error(err.errMsg)
- this.isShowLoading = false
- this.personal_time = 0
- })
- }
- } else {
- if (!this.item.vipName) {
- this.$message.error('会员名不能为空')
- } else if (!this.vipNameChecked) {
- this.$message.error('会员名输入有误,请按提示重新输入')
- } else if (!this.item.password) {
- this.$message.error('密码不能为空')
- } else if (!this.passwordChecked) {
- this.$message.error('密码输入有误,请按提示重新输入')
- } else if (!this.item.confirm) {
- this.$message.error('请再次输入密码')
- } else if (!this.confirmChecked) {
- this.$message.error('请确认两次填写密码是否一致')
- } else if (!this.item.mobile) {
- this.$message.error('手机号不能为空')
- } else if (!this.mobileChecked) {
- this.$message.error('手机号输入有误,请按提示重新输入')
- } else if (!this.token) {
- this.$message.error('请先获取验证码')
- } else if (!this.item.code) {
- this.$message.error('验证码不能为空')
- } else if (!this.codeChecked) {
- this.$message.error('验证码输入有误,请按提示重新输入')
- } else if (!this.checked) {
- this.$message.error('您对阅读条款未做勾选')
- }
- }
- },
- // 快速登录
- waySubmit () {
- if (this.mobileChecked && this.codeChecked && this.checked) {
- this.isShowLoading = true
- let param = new FormData()
- param.append('mobile', this.item.mobile)
- param.append('appId', this.appId)
- param.append('code', this.item.code)
- param.append('token', this.token)
- 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 = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post('/sso/personal/register/sms', param, config)
- .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
- let returnUrl = ''
- if (this.$route.query.returnURL) {
- returnUrl = decodeURIComponent(this.$route.query.returnURL)
- }
- window.location.href = returnUrl || `/overRegister/${userUU}`
- }
- } else {
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.$message.error(err.errMsg)
- this.isShowLoading = false
- this.personal_time = 0
- })
- } else {
- if (!this.item.mobile) {
- this.$message.error('手机号不能为空')
- } else if (!this.mobileChecked) {
- this.$message.error('手机号输入有误,请按提示重新输入')
- } else if (!this.token) {
- this.$message.error('请先获取验证码')
- } else if (!this.item.code) {
- this.$message.error('验证码不能为空')
- } else if (!this.codeChecked) {
- this.$message.error('验证码输入有误,请按提示重新输入')
- } else if (!this.checked) {
- this.$message.error('您对阅读条款未做勾选')
- }
- }
- },
- // 提交注册流程
- allSubmit () {
- if (this.speediness) {
- this.waySubmit()
- } else {
- this.submit()
- }
- },
- // 获取验证码
- // async getCode () {
- // let { data } = await this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
- // this.token = data.token
- // },
- // 获取验证码
- getCode () {
- let imgSrc = document.getElementById('captchaImage2')
- imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
- },
- getCheckCode () {
- let md5Code = md5(`{mobile=${this.item.mobile},code=${this.ImgCode},salt=sso}`)
- this.isShowLoading = true
- this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode, sign: md5Code}})
- .then(response => {
- this.isShowLoading = false
- if (response.data) {
- this.token = response.data.token
- if (response.data.errMsg) {
- this.$message({
- message: response.data.errMsg,
- type: 'error'
- })
- this.ImgCode = ''
- this.getCode()
- return
- }
- if (this.token !== '') {
- this.$message({
- message: '验证码已经发送到您的手机,请注意查收',
- type: 'success'
- })
- this.sendPersonalCode = false
- // this.visible2 = false
- this.personal_time = 60
- // this.ImgCode = ''
- var personalTime = setInterval(() => {
- this.personal_time--
- if (this.personal_time <= 0) {
- this.sendPersonalCode = true
- clearInterval(personalTime)
- }
- }, 1000)
- // this.getCode()
- }
- } else {
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.isShowLoading = false
- this.$message.error(err.errMsg)
- })
- },
- getJsonp: function (url, timeout = 500) {
- return new Promise((resolve, reject) => {
- this.$jsonp(url, {
- name: 'successCallback',
- timeout: timeout
- }, function (err, data) {
- if (err) {
- reject(err)
- throw err
- } else {
- resolve(data)
- }
- })
- })
- },
- 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(() => {
- crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
- }).catch(() => {
- 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>
- .register {
- margin: 0 auto;
- width: 100%;
- background: #eee;
- .container{
- padding-top: 50px;
- margin: 0 auto;
- width: 980px;
- text-align: center;
- .content{
- padding: 0 50px;
- margin: 50px auto 0;
- width: 100%;
- text-align: center;
- background: #fff;
- .content-top{
- position: relative;
- height: 80px;
- line-height: 80px;
- border-bottom: 1px solid #dcdcdc;
- h3{
- font-family: 'SimHei';
- font-size: 24px;
- color: #000;
- }
- a.go{
- position: absolute;
- top: 0;
- right: 0;
- font-size: 14px;
- i{
- margin-right: 3px;
- }
- }
- }
- .content-tab{
- width: 360px;
- margin: 0 auto;
- height: 50px;
- margin-top: 15px;
- color: #999;
- span{
- display:inline-block;
- width:50%;
- vertical-align:top;
- font-size:20px;
- text-align: center;
- line-height:40px;
- height:40px;
- border-bottom:2px solid #fff;
- cursor:pointer;
- &.speed{
- color:#3375a7;
- border-bottom:2px solid #3375a7;
- }
- }
- }
- form {
- padding-bottom: 44px;
- margin-top: 15px;
- input{
- padding: 0 0 0 18px;
- width: 360px;
- height: 44px;
- line-height: 44px;
- font-size: 14px;
- color: #000;
- border-radius: 0;
- }
- span.help{
- position: absolute;
- right: -230px;
- top:0;
- font-size: 12px;
- color: #f00;
- }
- i.fa{
- position: absolute;
- top: 10px;
- right: 18px;
- font-size: 24px;
- color: #a0a0a0;
- cursor: pointer;
- }
- .pwd {
- margin: 6px 0 -15px 0;
- text-align: left;
- font-size: 13px;
- em{
- display: inline-block;
- margin: 0 8px 2px 0;
- width: 24px;
- height: 6px;
- &:first-child{
- margin-left: 10px;
- }
- }
- span{
- margin-left: 10px;
- font-size: 13px;
- }
- }
- .pwd.sm{
- color: #8c8c8c;
- em {
- background: #bfbfbf;
- &:first-child{
- background: #ff4e00;
- }
- }
- span{
- color: #ff4e00;
- }
- }
- .pwd.md{
- color: #8c8c8c;
- em {
- background: #22ac38;
- &:nth-child(3){
- background: #bfbfbf;
- }
- }
- span{
- color: #22ac38;
- }
- }
- .pwd.lar{
- color: #8c8c8c;
- em {
- background: #00a0e9;
- }
- span{
- color: #00a0e9;
- }
- }
- .pwd.low{
- color: #8c8c8c;
- em{
- background: #bfbfbf;
- }
- }
- span.tip{
- position: absolute;
- top: 3px;
- right: -190px;
- font-size: 13px;
- color: #8c8c8c;
- }
- span.tip.tip-mobile{
- top: 3px;
- right: -118px;
- color: #ff4949;
- font-size: 12px;
- }
- span.codeError-tip{
- position: absolute;
- top: 3px;
- left: 378px;
- width: 200px;
- text-align: left;
- color: #ff4949;
- font-size: 12px;
- }
- span.tip.passwordError{
- position: absolute;
- top: 3px;
- left: 380px;
- width: 200px;
- text-align: left;
- color: #ff4949;
- font-size: 12px;
- }
- input.msg{
- float: left;
- width: 210px;
- }
- button.msg{
- float: right;
- width: 130px;
- height: 44px;
- font-size: 14px;
- color: #5a5a5a;
- background: #f4f4f4;
- border: 1px solid #dcdcdc;
- cursor: pointer;
- &:disabled{
- cursor: not-allowed ;
- opacity: .7;
- }
- }
- span.msg.send{
- float: right;
- width: 130px;
- height: 44px;
- line-height: 44px;
- font-size: 14px;
- background: #d2d2d2;
- color: #fff;
- border: 1px solid #dcdcdc;
- }
- input[type='checkbox']{
- margin: 0 14px 0 55px;
- float: left;
- width: 16px;
- height: 16px;
- }
- span.agree{
- float: left;
- margin: 1px 0 0 10px;
- font-size: 14px;
- color: #8b8b8b;
- a{
- color: #0076ad;
- }
- }
- .form-group.agree{
- margin: 20px auto 0 !important;
- }
- .submitBtn {
- display: inline-block;
- width: 360px;
- height: 44px;
- line-height: 44px;
- font-size: 16px;
- color: #fff;
- background: #0076AD;
- border-radius: 3px;
- border: none;
- &:disabled{
- cursor: not-allowed ;
- opacity: .7;
- }
- }
- }
- }
- .login{
- margin-top: 20px;
- font-size: 14px;
- color: #8c8c8c;
- a{
- font-size: 14px;
- color: #0076ad;
- }
- }
- }
- }
- .footer{
- padding: 50px 0;
- }
- </style>
|