PersonalRegistration.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. <template>
  2. <div class="register">
  3. <div class="container">
  4. <div class="content">
  5. <div class="content-top">
  6. <h3>个人注册</h3>
  7. <a class="go" @click="goRegister"><i class="fa fa-long-arrow-right"></i>企业注册</a>
  8. </div>
  9. <div>
  10. <el-form :model="item" :rules="rules2" ref="item" label-width="100px" class="demo-ruleForm">
  11. <el-form-item prop="vipName">
  12. <el-input type="text" v-model="item.vipName" auto-complete="off" placeholder="会员名"></el-input>
  13. </el-form-item>
  14. <el-form-item prop="password">
  15. <el-input type="password" v-model="item.password" auto-complete="new-password" placeholder="登录密码"></el-input>
  16. <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
  17. <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
  18. <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
  19. <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
  20. </el-form-item>
  21. <el-form-item prop="confirm">
  22. <el-input type="password"
  23. v-model="item.confirm"
  24. v-bind:class="{active: showPasswordError}"
  25. auto-complete="new-password"
  26. placeholder="密码确认"></el-input>
  27. <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
  28. </el-form-item>
  29. <el-form-item prop="mobile">
  30. <el-input v-model="item.mobile"
  31. v-bind:class="{active: mobileRegister}"
  32. placeholder="手机号码"></el-input>
  33. <span class="tip" v-show="showMsgTip">单个手机号只能注册一个用户</span>
  34. <span class="tip tip-mobile" v-show="mobileRegister">该手机号已被注册</span>
  35. </el-form-item>
  36. <el-form-item prop="code">
  37. <el-input type="text" v-model="item.code"
  38. v-bind:class="{ active: codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
  39. <el-popover
  40. placement="top"
  41. width="300"
  42. v-model="visible2">
  43. <div>
  44. <el-input type="text"
  45. v-model="ImgCode"
  46. auto-complete="off"
  47. class="code-input2"></el-input>
  48. <img id="captchaImage2" class="code-img" src="/sso/login/checkCode"/>
  49. <a class="code-click" @click="getCode" style="font-size: 12px">看不清换一张</a>
  50. </div>
  51. <div style="text-align: right; margin: 0">
  52. <el-button size="mini" type="text" @click="visible2 = false">取消</el-button>
  53. <el-button type="primary" size="mini" @click="getCheckCode">确定</el-button>
  54. </div>
  55. <el-button type="primary" class="code"
  56. v-show="sendPersonalCode" slot="reference" :disabled="this.checkMobile">获取验证码</el-button>
  57. </el-popover>
  58. <!--<el-button type="primary" class="code"-->
  59. <!--v-show="sendPersonalCode"-->
  60. <!--@click="getCheckCode"-->
  61. <!--:disabled="this.checkMobile">获取验证码</el-button>-->
  62. <el-button type="primary" v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
  63. <span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
  64. </el-form-item>
  65. <el-form-item>
  66. <a class="btn finish" @click="submit">确认注册</a>
  67. </el-form-item>
  68. <el-form-item>
  69. <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
  70. <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
  71. <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
  72. </el-form-item>
  73. </el-form>
  74. </div>
  75. </div>
  76. <div class="login">已有账号?<a :href="returnLogin">立即登录</a></div>
  77. <loading v-show="isShowLoading"/>
  78. </div>
  79. <!--尾部-->
  80. <div v-html="loginStyle.footUrl" class="footer"></div>
  81. </div>
  82. </template>
  83. <script>
  84. import Loading from '~components/common/loading/Loading.vue'
  85. export default {
  86. name: 'PersonalRegistration',
  87. components: {
  88. Loading
  89. },
  90. data () {
  91. var validateName = (rule, value, callback) => {
  92. if (value === '') {
  93. callback(new Error('会员名不能为空'))
  94. this.vipNameChecked = false
  95. } else {
  96. if (this.item.vipName !== '') {
  97. if (value.length < 2 || value.length > 20) {
  98. callback(new Error('请填写合适的会员名称,2~20个字符'))
  99. this.vipNameChecked = false
  100. } else {
  101. this.vipNameChecked = true
  102. }
  103. }
  104. }
  105. callback()
  106. }
  107. var validatePass = (rule, value, callback) => {
  108. if (this.item.password !== '') {
  109. if (value.length <= 20 && value.length >= 8) {
  110. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  111. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  112. if (reg1.test(value)) {
  113. // callback(new Error('密码强度强'))
  114. this.showMsgTip3 = true
  115. this.showMsgTip2 = false
  116. this.showMsgTip1 = false
  117. this.showMsgTip4 = false
  118. this.passwordChecked = true
  119. } else if (reg2.test(value)) {
  120. // callback(new Error('密码强度中'))
  121. this.showMsgTip2 = true
  122. this.showMsgTip3 = false
  123. this.showMsgTip1 = false
  124. this.showMsgTip4 = false
  125. this.passwordChecked = true
  126. } else {
  127. this.showMsgTip1 = true
  128. this.showMsgTip3 = false
  129. this.showMsgTip2 = false
  130. this.showMsgTip4 = false
  131. this.passwordChecked = false
  132. }
  133. } else {
  134. this.showMsgTip3 = false
  135. this.showMsgTip2 = false
  136. this.showMsgTip1 = false
  137. this.showMsgTip4 = true
  138. this.passwordChecked = false
  139. }
  140. }
  141. callback()
  142. }
  143. var validatePassTip = (rule, value, callback) => {
  144. if (value === '') {
  145. callback(new Error('请输入密码'))
  146. this.passwordChecked = false
  147. } else {
  148. if (this.item.password !== '') {
  149. if (value.length <= 20 && value.length >= 8) {
  150. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  151. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  152. if (reg1.test(value)) {
  153. this.passwordChecked = true
  154. } else if (reg2.test(value)) {
  155. this.passwordChecked = true
  156. } else {
  157. callback(new Error('密码须为8-20字符的英文、数字混合'))
  158. this.passwordChecked = false
  159. }
  160. } else {
  161. callback(new Error('密码须为8-20字符的英文、数字混合'))
  162. this.passwordChecked = false
  163. }
  164. if (this.item.confirm !== '') {
  165. if (value !== this.item.confirm) {
  166. this.showPasswordError = true
  167. // callback(new Error('两次输入密码不一致!'))
  168. this.confirmChecked = false
  169. } else {
  170. this.confirmChecked = true
  171. this.showPasswordError = false
  172. callback()
  173. }
  174. }
  175. }
  176. callback()
  177. }
  178. }
  179. var validatePass2 = (rule, value, callback) => {
  180. if (value === '') {
  181. callback(new Error('请再次输入密码'))
  182. this.confirmChecked = false
  183. this.showPasswordError = false
  184. } else if (value !== this.item.password) {
  185. // callback(new Error('两次输入密码不一致!'))
  186. this.showPasswordError = true
  187. this.confirmChecked = false
  188. } else {
  189. this.confirmChecked = true
  190. this.showPasswordError = false
  191. callback()
  192. }
  193. }
  194. var validateMobile = (rule, value, callback) => {
  195. if (value === '') {
  196. callback(new Error('请填写正确的手机号'))
  197. this.showMsgTip = false
  198. this.checkMobile = true
  199. this.mobileRegister = false
  200. this.mobileChecked = false
  201. } else {
  202. if (this.item.mobile !== '') {
  203. var reg = /^1([0-9]{10})$/
  204. if (!reg.test(value)) {
  205. callback(new Error('请填写正确的手机号'))
  206. this.showMsgTip = false
  207. this.checkMobile = true
  208. this.mobileRegister = false
  209. this.mobileChecked = false
  210. } else {
  211. this.$http.get(`/api/user/checkMobile`, {params: {mobile: this.item.mobile, mobileArea: ''}})
  212. .then(response => {
  213. if (response.data.hasRegister) {
  214. this.mobileRegister = true
  215. this.showMsgTip = false
  216. this.checkMobile = true
  217. this.mobileChecked = false
  218. } else {
  219. this.showMsgTip = false
  220. this.checkMobile = false
  221. this.mobileRegister = false
  222. this.mobileChecked = true
  223. }
  224. })
  225. }
  226. }
  227. callback()
  228. }
  229. }
  230. var validateCode = (rule, value, callback) => {
  231. if (value === '') {
  232. callback(new Error('请填写正确的验证码'))
  233. this.codeErrorChecked = false
  234. this.codeChecked = false
  235. } else {
  236. if (this.item.mobile === '') {
  237. callback(new Error('请先填写正确的手机号'))
  238. } else {
  239. if (this.token) {
  240. if (this.item.code.length === 6) {
  241. let param = new FormData()
  242. param.append('mobile', this.item.mobile)
  243. param.append('code', this.item.code)
  244. param.append('token', this.token)
  245. let config = {
  246. headers: {'Content-Type': 'multipart/form-data'}
  247. }
  248. this.$http.post(`/sso/personal/register/checkCode`, param, config)
  249. .then(response => {
  250. if (response.data.success) {
  251. this.codeChecked = true
  252. this.codeErrorChecked = false
  253. } else {
  254. this.codeErrorChecked = true
  255. this.codeChecked = false
  256. // callback(new Error('验证码输入错误'))
  257. return Promise.reject(response.data)
  258. }
  259. }).catch(err => {
  260. this.codeErrorMsg = err.errMsg
  261. // this.$message.error(err.errMsg)
  262. })
  263. } else {
  264. callback(new Error('请输入正确的验证码'))
  265. this.codeChecked = false
  266. this.codeErrorChecked = false
  267. }
  268. } else {
  269. callback(new Error('请先获取验证码'))
  270. this.codeChecked = false
  271. this.codeErrorChecked = false
  272. }
  273. }
  274. callback()
  275. }
  276. }
  277. var validateCodeIsEmpty = (rule, value, callback) => {
  278. if (value === '') {
  279. callback(new Error('请填写正确的验证码'))
  280. this.codeErrorChecked = false
  281. this.codeChecked = false
  282. } else {
  283. if (this.item.mobile === '') {
  284. callback(new Error('请先填写正确的手机号'))
  285. } else {
  286. if (this.token) {
  287. if (this.item.code.length === 6) {
  288. let param = new FormData()
  289. param.append('mobile', this.item.mobile)
  290. param.append('code', this.item.code)
  291. param.append('token', this.token)
  292. let config = {
  293. headers: {'Content-Type': 'multipart/form-data'}
  294. }
  295. this.$http.post(`/sso/personal/register/checkCode`, param, config)
  296. .then(response => {
  297. if (response.data.success) {
  298. this.codeChecked = true
  299. this.codeErrorChecked = false
  300. } else {
  301. this.codeErrorChecked = true
  302. this.codeChecked = false
  303. return Promise.reject(response.data)
  304. }
  305. }).catch(err => {
  306. this.codeErrorMsg = err.errMsg
  307. })
  308. } else {
  309. callback(new Error('请输入正确的验证码'))
  310. this.codeChecked = false
  311. this.codeErrorChecked = false
  312. }
  313. } else {
  314. callback(new Error('请先获取验证码'))
  315. this.codeChecked = false
  316. this.codeErrorChecked = false
  317. }
  318. }
  319. callback()
  320. }
  321. }
  322. return {
  323. ImgCode: '',
  324. visible2: false,
  325. item: {
  326. vipName: '',
  327. password: '',
  328. confirm: '',
  329. mobile: '',
  330. code: ''
  331. },
  332. isShowLoading: false,
  333. showPasswordError: false,
  334. vipNameChecked: false,
  335. passwordChecked: false,
  336. confirmChecked: false,
  337. mobileChecked: false,
  338. codeChecked: false,
  339. codeErrorChecked: false,
  340. showMsgTip: true,
  341. showMsgTip1: false,
  342. showMsgTip2: false,
  343. showMsgTip3: false,
  344. showMsgTip4: false,
  345. checkMobile: true,
  346. checked: true,
  347. token: '',
  348. mobileRegister: false,
  349. sendPersonalCode: true,
  350. codeErrorMsg: '',
  351. personal_time: 0,
  352. queryLink: '',
  353. appId: '',
  354. returnLogin: '',
  355. rules2: {
  356. vipName: [
  357. { validator: validateName, trigger: 'blur' }
  358. ],
  359. password: [
  360. { validator: validatePassTip, trigger: 'blur' },
  361. { validator: validatePass, trigger: 'change' }
  362. ],
  363. confirm: [
  364. { required: true, validator: validatePass2, trigger: 'blur' }
  365. ],
  366. mobile: [
  367. { validator: validateMobile, trigger: 'blur' }
  368. ],
  369. code: [
  370. { validator: validateCode, trigger: 'change' },
  371. { validator: validateCodeIsEmpty, trigger: 'blur' }
  372. ]
  373. }
  374. }
  375. },
  376. mounted () {
  377. // 获取链接
  378. this.$nextTick(() => {
  379. this.getUrl()
  380. this.getCode()
  381. })
  382. },
  383. computed: {
  384. loginStyle () {
  385. return this.$store.state.login.loginStyle.data.content
  386. },
  387. agreementUrl () {
  388. return this.$store.state.login.agreementUrl.data.content
  389. }
  390. },
  391. methods: {
  392. // 获取链接
  393. getUrl () {
  394. var url = window.location.search
  395. var request = {}
  396. var origin = window.location.origin
  397. this.returnLogin = origin + url
  398. if (url.indexOf('?' !== -1)) {
  399. var str = url.substr(1)
  400. var strs = str.split('&')
  401. this.queryLink = str
  402. for (var i = 0; i < strs.length; i++) {
  403. request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
  404. }
  405. }
  406. this.appId = request['appId'] || ''
  407. },
  408. // 注册
  409. goRegister () {
  410. window.location.href = `/register/enterpriseRegistration?${this.queryLink}`
  411. },
  412. // 我同意是否被选中
  413. checkboxChecked () {
  414. this.checked = !this.checked
  415. },
  416. // 表单提交
  417. submit () {
  418. if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked && this.checked) {
  419. if (this.item.password !== this.item.confirm) {
  420. this.$message.error('请确认两次填写密码是否一致')
  421. } else {
  422. this.isShowLoading = true
  423. let param = new FormData()
  424. param.append('vipName', this.item.vipName)
  425. param.append('password', this.item.password)
  426. param.append('mobile', this.item.mobile)
  427. // param.append('mobileArea', '')
  428. param.append('appId', this.appId)
  429. param.append('code', this.item.code)
  430. param.append('token', this.token)
  431. param.append('t', this.$route.query.tk ? this.$route.query.tk : '')
  432. param.append('returnUrl', this.$route.query.returnURL ? this.$route.query.returnURL : '')
  433. let config = {
  434. headers: {'Content-Type': 'multipart/form-data'}
  435. }
  436. this.$http.post('/sso/personal/register', param, config)
  437. .then(response => {
  438. this.isShowLoading = false
  439. if (response.data.success) {
  440. if (response.data.content.type) {
  441. if (response.data.content.type === 'mall') {
  442. let param = response.data.content.data
  443. let a = ''
  444. for (let n in param) {
  445. a += (n + '=' + encodeURIComponent(param[n]) + '&')
  446. }
  447. let params = a.substr(0, a.length - 1)
  448. this.isShowLoading = true
  449. if (response.data.content.currentUrl) {
  450. this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
  451. name: 'successCallback',
  452. timeout: 3000
  453. }, (err, data) => {
  454. if (err) {
  455. this.$message.error('注册成功,请点击下方“立即登录”完成登录')
  456. this.isShowLoading = false
  457. throw err
  458. } else {
  459. this.loginOther(response, params)
  460. }
  461. })
  462. } else {
  463. this.loginOther(response, params, 3000)
  464. }
  465. } else if (response.data.content.type === 'city') {
  466. let param = response.data.content.data
  467. let a = ''
  468. for (let n in param) {
  469. a += (n + '=' + encodeURIComponent(param[n]) + '&')
  470. }
  471. let params = a.substr(0, a.length - 1)
  472. this.isShowLoading = true
  473. if (response.data.content.currentUrl) {
  474. this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
  475. name: 'successCallback',
  476. timeout: 3000
  477. }, (err, data) => {
  478. if (err) {
  479. this.$message.error('注册成功,请点击下方“立即登录”完成登录')
  480. this.isShowLoading = false
  481. throw err
  482. } else {
  483. this.loginCityOther(response, params)
  484. }
  485. })
  486. } else {
  487. this.loginCityOther(response, params, 3000)
  488. }
  489. }
  490. } else {
  491. let userUU = response.data.content.userUU
  492. console.log(userUU)
  493. window.location.href = `/overRegister/${userUU}`
  494. }
  495. } else {
  496. return Promise.reject(response.data)
  497. }
  498. }).catch(err => {
  499. this.$message.error(err.errMsg)
  500. this.isShowLoading = false
  501. this.personal_time = 0
  502. })
  503. }
  504. } else {
  505. if (!this.item.vipName) {
  506. this.$message.error('会员名不能为空')
  507. } else if (!this.vipNameChecked) {
  508. this.$message.error('会员名输入有误,请按提示重新输入')
  509. } else if (!this.item.password) {
  510. this.$message.error('密码不能为空')
  511. } else if (!this.passwordChecked) {
  512. this.$message.error('密码输入有误,请按提示重新输入')
  513. } else if (!this.item.confirm) {
  514. this.$message.error('请再次输入密码')
  515. } else if (!this.confirmChecked) {
  516. this.$message.error('请确认两次填写密码是否一致')
  517. } else if (!this.item.mobile) {
  518. this.$message.error('手机号不能为空')
  519. } else if (!this.mobileChecked) {
  520. this.$message.error('手机号输入有误,请按提示重新输入')
  521. } else if (!this.token) {
  522. this.$message.error('请先获取验证码')
  523. } else if (!this.item.code) {
  524. this.$message.error('验证码不能为空')
  525. } else if (!this.codeChecked) {
  526. this.$message.error('验证码输入有误,请按提示重新输入')
  527. } else if (!this.checked) {
  528. this.$message.error('您对阅读条款未做勾选')
  529. }
  530. }
  531. },
  532. // 获取验证码
  533. // async getCode () {
  534. // let { data } = await this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
  535. // this.token = data.token
  536. // },
  537. // 获取验证码
  538. getCode () {
  539. let imgSrc = document.getElementById('captchaImage2')
  540. imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
  541. },
  542. getCheckCode () {
  543. this.isShowLoading = true
  544. // this.getCode()
  545. this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode}})
  546. .then(response => {
  547. this.isShowLoading = false
  548. if (response.data) {
  549. this.token = response.data.token
  550. if (response.data.errMsg) {
  551. this.$message({
  552. message: response.data.errMsg,
  553. type: 'error'
  554. })
  555. this.ImgCode = ''
  556. this.getCode()
  557. return
  558. }
  559. if (this.token !== '') {
  560. this.$message({
  561. message: '验证码已经发送到您的手机,请注意查收',
  562. type: 'success'
  563. })
  564. this.sendPersonalCode = false
  565. this.visible2 = false
  566. this.personal_time = 60
  567. this.ImgCode = ''
  568. var personalTime = setInterval(() => {
  569. this.personal_time--
  570. if (this.personal_time <= 0) {
  571. this.sendPersonalCode = true
  572. clearInterval(personalTime)
  573. }
  574. }, 1000)
  575. this.getCode()
  576. }
  577. } else {
  578. return Promise.reject(response.data)
  579. }
  580. }).catch(err => {
  581. this.isShowLoading = false
  582. this.$message.error(err.errMsg)
  583. })
  584. },
  585. getJsonp: function (url, timeout = 500) {
  586. return new Promise((resolve, reject) => {
  587. this.$jsonp(url, {
  588. name: 'successCallback',
  589. timeout: timeout
  590. }, function (err, data) {
  591. if (err) {
  592. reject(err)
  593. throw err
  594. } else {
  595. resolve(data)
  596. }
  597. })
  598. })
  599. },
  600. crossAfter (url) {
  601. try {
  602. window.location.href = url
  603. } catch (err) {
  604. console.log(err)
  605. }
  606. },
  607. loginOther (response, a, timeout) {
  608. const crossAfter = this.crossAfter
  609. let promises = []
  610. for (let i in response.data.content.loginUrls) {
  611. if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
  612. promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
  613. }
  614. }
  615. let returnUrl = decodeURIComponent(this.$route.query.returnURL)
  616. Promise.all(promises).then(() => {
  617. crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
  618. }).catch(() => {
  619. crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
  620. })
  621. },
  622. loginCityOther (response, a, timeout) {
  623. const crossAfter = this.crossAfter
  624. let promises = []
  625. for (let i in response.data.content.loginUrls) {
  626. if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
  627. promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
  628. }
  629. }
  630. Promise.all(promises).then(() => {
  631. crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
  632. }).catch(() => {
  633. crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
  634. })
  635. }
  636. }
  637. }
  638. </script>
  639. <style lang="scss" scoped>
  640. .register {
  641. margin: 0 auto;
  642. width: 100%;
  643. background: #eee;
  644. .container{
  645. padding-top: 50px;
  646. margin: 0 auto;
  647. width: 980px;
  648. text-align: center;
  649. .content{
  650. padding: 0 50px;
  651. margin: 50px auto 0;
  652. width: 100%;
  653. text-align: center;
  654. background: #fff;
  655. .content-top{
  656. position: relative;
  657. height: 80px;
  658. line-height: 80px;
  659. border-bottom: 1px solid #dcdcdc;
  660. h3{
  661. font-family: 'SimHei';
  662. font-size: 24px;
  663. color: #000;
  664. }
  665. a.go{
  666. position: absolute;
  667. top: 0;
  668. right: 0;
  669. font-size: 14px;
  670. i{
  671. margin-right: 3px;
  672. }
  673. }
  674. }
  675. form {
  676. padding-bottom: 44px;
  677. margin-top: 35px;
  678. input{
  679. padding: 0 0 0 18px;
  680. width: 360px;
  681. height: 44px;
  682. line-height: 44px;
  683. font-size: 14px;
  684. color: #000;
  685. border-radius: 0;
  686. }
  687. span.help{
  688. position: absolute;
  689. right: -230px;
  690. top:0;
  691. font-size: 12px;
  692. color: #f00;
  693. }
  694. i.fa{
  695. position: absolute;
  696. top: 10px;
  697. right: 18px;
  698. font-size: 24px;
  699. color: #a0a0a0;
  700. cursor: pointer;
  701. }
  702. .pwd {
  703. margin: 6px 0 -15px 0;
  704. text-align: left;
  705. font-size: 13px;
  706. em{
  707. display: inline-block;
  708. margin: 0 8px 2px 0;
  709. width: 24px;
  710. height: 6px;
  711. &:first-child{
  712. margin-left: 10px;
  713. }
  714. }
  715. span{
  716. margin-left: 10px;
  717. font-size: 13px;
  718. }
  719. }
  720. .pwd.sm{
  721. color: #8c8c8c;
  722. em {
  723. background: #bfbfbf;
  724. &:first-child{
  725. background: #ff4e00;
  726. }
  727. }
  728. span{
  729. color: #ff4e00;
  730. }
  731. }
  732. .pwd.md{
  733. color: #8c8c8c;
  734. em {
  735. background: #22ac38;
  736. &:nth-child(3){
  737. background: #bfbfbf;
  738. }
  739. }
  740. span{
  741. color: #22ac38;
  742. }
  743. }
  744. .pwd.lar{
  745. color: #8c8c8c;
  746. em {
  747. background: #00a0e9;
  748. }
  749. span{
  750. color: #00a0e9;
  751. }
  752. }
  753. .pwd.low{
  754. color: #8c8c8c;
  755. em{
  756. background: #bfbfbf;
  757. }
  758. }
  759. span.tip{
  760. position: absolute;
  761. top: 3px;
  762. right: -190px;
  763. font-size: 13px;
  764. color: #8c8c8c;
  765. }
  766. span.tip.tip-mobile{
  767. top: 3px;
  768. right: -118px;
  769. color: #ff4949;
  770. font-size: 12px;
  771. }
  772. span.codeError-tip{
  773. position: absolute;
  774. top: 3px;
  775. left: 378px;
  776. width: 200px;
  777. text-align: left;
  778. color: #ff4949;
  779. font-size: 12px;
  780. }
  781. span.tip.passwordError{
  782. position: absolute;
  783. top: 3px;
  784. left: 380px;
  785. width: 200px;
  786. text-align: left;
  787. color: #ff4949;
  788. font-size: 12px;
  789. }
  790. input.msg{
  791. float: left;
  792. width: 210px;
  793. }
  794. button.msg{
  795. float: right;
  796. width: 130px;
  797. height: 44px;
  798. font-size: 14px;
  799. color: #5a5a5a;
  800. background: #f4f4f4;
  801. border: 1px solid #dcdcdc;
  802. cursor: pointer;
  803. &:disabled{
  804. cursor: not-allowed ;
  805. opacity: .7;
  806. }
  807. }
  808. span.msg.send{
  809. float: right;
  810. width: 130px;
  811. height: 44px;
  812. line-height: 44px;
  813. font-size: 14px;
  814. background: #d2d2d2;
  815. color: #fff;
  816. border: 1px solid #dcdcdc;
  817. }
  818. input[type='checkbox']{
  819. margin: 0 14px 0 55px;
  820. float: left;
  821. width: 16px;
  822. height: 16px;
  823. }
  824. span.agree{
  825. float: left;
  826. margin: 1px 0 0 10px;
  827. font-size: 14px;
  828. color: #8b8b8b;
  829. a{
  830. color: #0076ad;
  831. }
  832. }
  833. .form-group.agree{
  834. margin: 20px auto 0 !important;
  835. }
  836. .submitBtn {
  837. display: inline-block;
  838. margin-top: 34px;
  839. width: 360px;
  840. height: 44px;
  841. line-height: 44px;
  842. font-size: 16px;
  843. color: #fff;
  844. background: #0076AD;
  845. border-radius: 3px;
  846. border: none;
  847. &:disabled{
  848. cursor: not-allowed ;
  849. opacity: .7;
  850. }
  851. }
  852. }
  853. }
  854. .login{
  855. margin-top: 20px;
  856. font-size: 14px;
  857. color: #8c8c8c;
  858. a{
  859. font-size: 14px;
  860. color: #0076ad;
  861. }
  862. }
  863. }
  864. }
  865. .footer{
  866. padding: 50px 0;
  867. }
  868. </style>