EnterpriseRegistration.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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 v-show="goNextStep">
  10. <el-form :model="enterprise" :rules="rules" ref="enterprise" label-width="100px" class="demo-ruleForm">
  11. <el-form-item prop="mobile">
  12. <el-input v-model="enterprise.mobile" placeholder="手机号码"></el-input>
  13. <span class="tip" v-show="showMsgTip">一个手机可注册多个企业</span>
  14. </el-form-item>
  15. <el-form-item prop="code">
  16. <el-input type="text" v-model="enterprise.code"
  17. v-bind:class="{ active: codeErrorChecked }"
  18. auto-complete="off"
  19. class="msg"
  20. placeholder="短信验证码"></el-input>
  21. <el-button type="primary" class="code"
  22. v-show="sendEnterpriseCode"
  23. @click="getCheckCode"
  24. :disabled="getCodeBtnIsDisabled">获取验证码</el-button>
  25. <el-button type="primary" v-show="!sendEnterpriseCode" class="code code-send">已发送({{enterprise_time}}s)</el-button>
  26. <span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
  27. </el-form-item>
  28. <el-form-item>
  29. <a class="btn finish"
  30. @click="checkPhone"
  31. :disabled="!this.checked || !this.mobileChecked || !this.codeChecked">验证手机</a>
  32. </el-form-item>
  33. <el-form-item>
  34. <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
  35. <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
  36. </el-form-item>
  37. </el-form>
  38. </div>
  39. <div v-show="!goNextStep">
  40. <el-form :model="enterprise1" :rules="rules1" ref="enterprise1" label-width="100px" class="demo-ruleForm">
  41. <el-form-item prop="spaceName">
  42. <el-input type="text"
  43. v-model="enterprise1.spaceName"
  44. v-bind:class="{ active: isSpaceNameExist }"
  45. auto-complete="off"
  46. placeholder="企业名称"
  47. ></el-input>
  48. <span class="tip exist" v-show="isSpaceNameExist">
  49. {{spaceNameExitMsg}}
  50. <!--<i class="fa fa-question-circle" aria-hidden="true"-->
  51. <!--v-show="spaceNameExitMsg != '出现异常'"-->
  52. <!--@mouseenter='showPopTip =true'-->
  53. <!--@mouseleave='showPopTip = false'></i>-->
  54. </span>
  55. <!--<div class="pop-tip" @mouseenter='showPopTip =true'-->
  56. <!--@mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span>-->
  57. <!--</div>-->
  58. </el-form-item>
  59. <el-form-item prop="businessCode">
  60. <el-input type="text"
  61. v-model="enterprise1.businessCode"
  62. v-bind:class="{ active: isBusinessCodeExist }"
  63. auto-complete="off"
  64. placeholder="营业执照号"></el-input>
  65. <span class="tip exist" v-show="isBusinessCodeExist">{{businessCodeExitMsg}}。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
  66. </el-form-item>
  67. <el-form-item prop="vipName" v-if="!isHasRegister">
  68. <el-input type="text" v-model="enterprise1.vipName" auto-complete="off" placeholder="管理员姓名"></el-input>
  69. </el-form-item>
  70. <el-form-item prop="password" v-if="!isHasRegister">
  71. <el-input type="password" v-model="enterprise1.password" auto-complete="off" placeholder="登录密码"></el-input>
  72. <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
  73. <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
  74. <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
  75. <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
  76. </el-form-item>
  77. <el-form-item prop="password" v-if="isHasRegister">
  78. <el-input type="password"
  79. v-model="enterprise1.password"
  80. auto-complete="off"
  81. placeholder="密码确认"
  82. v-bind:class="{ correct: passwordChecked }"></el-input>
  83. <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a href="/reset/ForgetPasswordValidationAccount">忘记密码?</a></span>
  84. </el-form-item>
  85. <el-form-item prop="confirm" v-if="!isHasRegister">
  86. <el-input type="password"
  87. auto-complete="off"
  88. placeholder="密码确认"
  89. v-bind:class="{active: showPasswordError}"
  90. v-model="enterprise1.confirm"></el-input>
  91. <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
  92. </el-form-item>
  93. <el-form-item prop="email" v-if="!isHasEmail">
  94. <el-input type="text"
  95. v-model="enterprise1.email"
  96. auto-complete="off"
  97. placeholder="联系邮箱"
  98. v-bind:class="{active: emailHasRegister}"></el-input>
  99. <span class="codeError-tip" v-if="emailHasRegister">该邮箱已被注册</span>
  100. </el-form-item>
  101. <a class="btn finish"
  102. :disabled="!isHasRegister ? !spaceNameChecked || !businessCodeChecked || !vipNameChecked || !passwordChecked || !passwordConfirmChecked || !emailChecked || !checked : !isHasEmail ? !spaceNameChecked || !businessCodeChecked || !passwordChecked || !emailChecked || !checked : !spaceNameChecked || !businessCodeChecked || !passwordChecked || !checked"
  103. @click="sureRegister">确认注册
  104. </a>
  105. </el-form-item>
  106. <el-form-item>
  107. <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
  108. <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
  109. </el-form-item>
  110. </el-form>
  111. </div>
  112. </div>
  113. <div class="login">已有账号?<a href="/">立即登录</a></div>
  114. <loading v-show="isShowLoading"/>
  115. </div>
  116. </div>
  117. </template>
  118. <script>
  119. import Loading from '~components/common/loading/Loading.vue'
  120. export default {
  121. name: 'EnterpriseRegistration',
  122. components: {
  123. Loading
  124. },
  125. data () {
  126. // 企业注册第一步
  127. var validateMobile = (rule, value, callback) => {
  128. if (value === '') {
  129. callback(new Error('请填写正确的手机号'))
  130. this.showMsgTip = false
  131. this.getCodeBtnIsDisabled = true
  132. this.mobileChecked = false
  133. } else {
  134. if (this.enterprise.mobile !== '') {
  135. var reg = /^1[0-9]{10}$/
  136. if (!reg.test(value)) {
  137. callback(new Error('请填写正确的手机号'))
  138. this.showMsgTip = false
  139. this.getCodeBtnIsDisabled = true
  140. this.mobileChecked = false
  141. } else {
  142. this.getCodeBtnIsDisabled = false
  143. this.showMsgTip = false
  144. this.mobileChecked = true
  145. }
  146. }
  147. callback()
  148. }
  149. }
  150. var validateCode = (rule, value, callback) => {
  151. if (value === '') {
  152. callback(new Error('请填写正确的验证码'))
  153. this.codeErrorChecked = false
  154. this.codeChecked = false
  155. } else {
  156. if (this.enterprise.code !== '') {
  157. if (this.enterprise.mobile === '') {
  158. callback(new Error('请先填写正确的手机号'))
  159. } else {
  160. if (this.token) {
  161. let param = new FormData()
  162. param.append('mobile', this.enterprise.mobile)
  163. param.append('code', this.enterprise.code)
  164. param.append('token', this.token)
  165. let config = {
  166. headers: {'Content-Type': 'multipart/form-data'}
  167. }
  168. this.$http.post(`/sso/personal/register/checkCode`, param, config)
  169. .then(response => {
  170. if (response.data.success) {
  171. this.codeChecked = true
  172. this.codeErrorChecked = false
  173. } else {
  174. this.codeErrorChecked = true
  175. this.codeChecked = false
  176. return Promise.reject(response.data)
  177. }
  178. }).catch(err => {
  179. this.codeErrorChecked = true
  180. this.codeErrorMsg = err.errMsg
  181. // this.$message.error(err.errMsg)
  182. })
  183. } else {
  184. callback(new Error('请先获取验证码'))
  185. this.codeChecked = false
  186. this.codeErrorChecked = false
  187. }
  188. }
  189. }
  190. callback()
  191. }
  192. }
  193. // 企业注册第二步
  194. var validateSpaceName = (rule, value, callback) => {
  195. if (value === '') {
  196. callback(new Error('请填写正确的企业名称'))
  197. this.spaceNameChecked = false
  198. this.isSpaceNameExist = false
  199. } else {
  200. if (this.enterprise1.spaceName !== '') {
  201. if (value.length > 20) {
  202. callback(new Error('输入长度过长,20个字符以内'))
  203. this.spaceNameChecked = false
  204. } else {
  205. this.$http.get(`/api/userspace/checkSpaceName`, {params: {spaceName: this.enterprise1.spaceName}})
  206. .then(response => {
  207. if (response.data.success) {
  208. this.spaceNameChecked = true
  209. this.isSpaceNameExist = false
  210. } else {
  211. this.spaceNameChecked = false
  212. this.isSpaceNameExist = true
  213. return Promise.reject(response.data)
  214. }
  215. }).catch(err => {
  216. this.spaceNameExitMsg = err.errMsg
  217. // this.$message.error(err.errMsg)
  218. })
  219. }
  220. }
  221. callback()
  222. }
  223. }
  224. var validateBusinessCode = (rule, value, callback) => {
  225. if (value === '') {
  226. callback(new Error('请填写正确的营业执照号'))
  227. this.businessCodeChecked = false
  228. this.isBusinessCodeExist = false
  229. } else {
  230. if (this.enterprise1.businessCode !== '') {
  231. let reg = /^[A-Za-z0-9]+$/
  232. if (reg.test(value)) {
  233. if (value.length > 20) {
  234. callback(new Error('输入长度过长,20个字符以内'))
  235. this.businessCodeChecked = false
  236. this.isBusinessCodeExist = false
  237. } else {
  238. this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise1.businessCode}})
  239. .then(response => {
  240. if (response.data.success) {
  241. this.businessCodeChecked = true
  242. this.isBusinessCodeExist = false
  243. } else {
  244. this.businessCodeChecked = false
  245. this.isBusinessCodeExist = true
  246. return Promise.reject(response.data)
  247. }
  248. }).catch(err => {
  249. this.businessCodeExitMsg = err.errMsg
  250. // this.$message.error(err.errMsg)
  251. })
  252. }
  253. } else {
  254. callback(new Error('请填写正确的营业执照号'))
  255. this.businessCodeChecked = false
  256. this.isBusinessCodeExist = false
  257. }
  258. }
  259. callback()
  260. }
  261. }
  262. var validateVipName = (rule, value, callback) => {
  263. if (this.isHasRegister) {
  264. this.vipNameChecked = true
  265. } else {
  266. if (value === '') {
  267. callback(new Error('请填写正确的管理员姓名'))
  268. this.vipNameChecked = false
  269. } else {
  270. if (this.enterprise1.vipName !== '') {
  271. if (value.length > 20) {
  272. callback(new Error('输入长度过长,20个字符以内'))
  273. } else {
  274. this.vipNameChecked = true
  275. }
  276. }
  277. callback()
  278. }
  279. }
  280. }
  281. var validatePassword = (rule, value, callback) => {
  282. if (this.enterprise1.password !== '') {
  283. if (value.length <= 20 && value.length >= 8) {
  284. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  285. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  286. if (reg1.test(value)) {
  287. // callback(new Error('密码强度强'))
  288. this.showMsgTip3 = true
  289. this.showMsgTip2 = false
  290. this.showMsgTip1 = false
  291. this.showMsgTip4 = false
  292. this.passwordChecked = true
  293. } else if (reg2.test(value)) {
  294. // callback(new Error('密码强度中'))
  295. this.showMsgTip2 = true
  296. this.showMsgTip3 = false
  297. this.showMsgTip1 = false
  298. this.showMsgTip4 = false
  299. this.passwordChecked = true
  300. } else {
  301. this.showMsgTip1 = true
  302. this.showMsgTip3 = false
  303. this.showMsgTip2 = false
  304. this.showMsgTip4 = false
  305. this.passwordChecked = false
  306. }
  307. } else {
  308. this.showMsgTip3 = false
  309. this.showMsgTip2 = false
  310. this.showMsgTip1 = false
  311. this.showMsgTip4 = true
  312. this.passwordChecked = false
  313. }
  314. }
  315. callback()
  316. }
  317. var validatePasswordTip = (rule, value, callback) => {
  318. if (this.isHasRegister) {
  319. if (value === '') {
  320. callback(new Error('请输入密码'))
  321. this.passwordChecked = false
  322. this.phoneIsRegisterTip = false
  323. } else {
  324. this.passwordChecked = true
  325. }
  326. } else {
  327. if (value === '') {
  328. callback(new Error('请输入密码'))
  329. this.passwordChecked = false
  330. } else {
  331. if (this.enterprise1.password !== '') {
  332. if (value.length <= 20 && value.length >= 8) {
  333. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  334. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  335. if (reg1.test(value)) {
  336. this.passwordChecked = true
  337. } else if (reg2.test(value)) {
  338. this.passwordChecked = true
  339. } else {
  340. callback(new Error('密码须为8-20字符的英文、数字混合'))
  341. this.passwordChecked = false
  342. }
  343. } else {
  344. callback(new Error('密码须为8-20字符的英文、数字混合'))
  345. this.passwordChecked = false
  346. }
  347. if (this.enterprise1.confirm !== '') {
  348. if (value !== this.enterprise1.confirm) {
  349. this.showPasswordError = true
  350. // callback(new Error('两次输入密码不一致!'))
  351. this.passwordConfirmChecked = false
  352. } else {
  353. this.passwordConfirmChecked = true
  354. this.showPasswordError = false
  355. callback()
  356. }
  357. }
  358. }
  359. callback()
  360. }
  361. }
  362. }
  363. var validateConfirm = (rule, value, callback) => {
  364. if (this.isHasRegister) {
  365. this.passwordConfirmChecked = true
  366. } else {
  367. if (value === '') {
  368. callback(new Error('请再次输入密码'))
  369. this.passwordConfirmChecked = false
  370. this.showPasswordError = false
  371. } else if (value !== this.enterprise1.password) {
  372. // callback(new Error('两次输入密码不一致!'))
  373. this.showPasswordError = true
  374. this.passwordConfirmChecked = false
  375. } else {
  376. this.passwordConfirmChecked = true
  377. this.showPasswordError = false
  378. }
  379. }
  380. callback()
  381. }
  382. var validateEmail = (rule, value, callback) => {
  383. if (this.isHasEmail) {
  384. this.emailChecked = true
  385. this.emailHasRegister = false
  386. } else {
  387. if (value && this.enterprise1.email) {
  388. var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
  389. if (!reg.test(value)) {
  390. callback(new Error('请输入正确的邮箱地址格式'))
  391. this.emailChecked = false
  392. this.emailHasRegister = false
  393. } else {
  394. this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
  395. .then(response => {
  396. if (response.data.hasRegister) {
  397. this.emailChecked = false
  398. this.emailHasRegister = true
  399. } else {
  400. this.emailChecked = true
  401. this.emailHasRegister = false
  402. return Promise.reject(response.data)
  403. }
  404. }).catch(err => {
  405. this.$message.error(err.errMsg)
  406. })
  407. }
  408. callback()
  409. } else {
  410. this.emailChecked = true
  411. this.emailHasRegister = false
  412. }
  413. }
  414. }
  415. return {
  416. // 企业注册第一步
  417. enterprise: {
  418. mobile: '',
  419. code: ''
  420. },
  421. // 企业注册第二步
  422. enterprise1: {
  423. spaceName: '',
  424. businessCode: '',
  425. vipName: '',
  426. password: '',
  427. confirm: '',
  428. email: ''
  429. },
  430. businessCodeExitMsg: '',
  431. spaceNameExitMsg: '',
  432. showPopTip: false,
  433. showPasswordError: false,
  434. isShowLoading: false,
  435. codeErrorMsg: '',
  436. checked: true,
  437. getCodeBtnIsDisabled: true,
  438. mobileChecked: false,
  439. codeChecked: false,
  440. showMsgTip: true,
  441. sendEnterpriseCode: true,
  442. codeErrorChecked: false,
  443. enterprise_time: 0,
  444. showMsgTip1: false,
  445. showMsgTip2: false,
  446. showMsgTip3: false,
  447. showMsgTip4: false,
  448. spaceNameChecked: false,
  449. businessCodeChecked: false,
  450. vipNameChecked: false,
  451. passwordChecked: false,
  452. passwordConfirmChecked: false,
  453. emailChecked: false,
  454. isHasRegister: false,
  455. isHasEmail: false,
  456. goNextStep: true,
  457. phoneIsRegisterTip: true,
  458. isSpaceNameExist: false,
  459. isBusinessCodeExist: false,
  460. emailHasRegister: false,
  461. queryLink: '',
  462. appId: '',
  463. // 企业注册第一步
  464. rules: {
  465. mobile: [
  466. {validator: validateMobile, trigger: 'blur'}
  467. ],
  468. code: [
  469. {validator: validateCode, trigger: 'blur'}
  470. ]
  471. },
  472. // 企业注册第二步
  473. rules1: {
  474. spaceName: [
  475. {validator: validateSpaceName, trigger: 'blur'}
  476. ],
  477. businessCode: [
  478. {validator: validateBusinessCode, trigger: 'blur'}
  479. ],
  480. vipName: [
  481. {validator: validateVipName, trigger: 'blur'}
  482. ],
  483. password: [
  484. {validator: validatePassword, trigger: 'change'},
  485. {validator: validatePasswordTip, trigger: 'blur'}
  486. ],
  487. confirm: [
  488. {validator: validateConfirm, trigger: 'blur'}
  489. ],
  490. email: [
  491. {validator: validateEmail, trigger: 'blur'}
  492. ]
  493. }
  494. }
  495. },
  496. mounted () {
  497. // 获取链接
  498. this.$nextTick(() => {
  499. this.getUrl()
  500. })
  501. },
  502. methods: {
  503. // 获取链接
  504. getUrl () {
  505. var url = window.location.search
  506. var request = {}
  507. if (url.indexOf('?' !== -1)) {
  508. var str = url.substr(1)
  509. var strs = str.split('&')
  510. this.queryLink = str
  511. for (var i = 0; i < strs.length; i++) {
  512. request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
  513. }
  514. }
  515. this.appId = request['appId'] || ''
  516. },
  517. // 注册
  518. goRegister () {
  519. console.log(this.queryLink)
  520. window.location.href = `/register/personalRegistration?${this.queryLink}`
  521. },
  522. // 我同意是否被选中
  523. checkboxIsChecked () {
  524. this.checked = !this.checked
  525. },
  526. // 获取校验码
  527. getCheckCode () {
  528. this.isShowLoading = true
  529. this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile}})
  530. .then(response => {
  531. this.isShowLoading = false
  532. if (response.data) {
  533. this.token = response.data.token
  534. if (this.token !== '') {
  535. this.$message({
  536. message: '验证码已经发送到您的手机,请注意查收',
  537. type: 'success'
  538. })
  539. this.sendEnterpriseCode = false
  540. this.enterprise_time = 60
  541. var enterpriseTime = setInterval(() => {
  542. this.enterprise_time--
  543. if (this.enterprise_time <= 0) {
  544. this.sendEnterpriseCode = true
  545. clearInterval(enterpriseTime)
  546. }
  547. }, 1000)
  548. }
  549. } else {
  550. return Promise.reject(response.data)
  551. }
  552. }).catch(err => {
  553. this.isShowLoading = false
  554. this.$message.error(err.errMsg)
  555. })
  556. },
  557. // 验证手机
  558. checkPhone () {
  559. if (this.mobileChecked && this.codeChecked && this.checked) {
  560. this.isShowLoading = true
  561. let param = new FormData()
  562. param.append('mobile', this.enterprise.mobile)
  563. param.append('code', this.enterprise.code)
  564. param.append('appId', this.appId)
  565. param.append('token', this.token)
  566. let config = {
  567. headers: {'Content-Type': 'multipart/form-data'}
  568. }
  569. this.$http.post('/sso/userspace/register/checkAdminTel', param, config)
  570. .then(response => {
  571. this.isShowLoading = false
  572. if (response.data.success) {
  573. this.goNextStep = false
  574. if (response.data.content.hasRegister) {
  575. this.isHasRegister = true
  576. if (response.data.content.hasEmail) {
  577. this.isHasEmail = true
  578. } else {
  579. this.isHasEmail = false
  580. }
  581. } else {
  582. this.isHasRegister = false
  583. this.isHasEmail = false
  584. }
  585. } else {
  586. this.goNextStep = true
  587. return Promise.reject(response.data)
  588. }
  589. }).catch(err => {
  590. this.$message.error(err.errMsg)
  591. this.isShowLoading = false
  592. // this.codeErrorChecked = true
  593. // this.codeChecked = false
  594. this.enterprise_time = 0
  595. })
  596. }
  597. },
  598. // 确认注册
  599. sureRegister () {
  600. if (!this.isHasRegister) {
  601. if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
  602. this.isShowLoading = true
  603. let param = new FormData()
  604. param.append('spaceName', this.enterprise1.spaceName)
  605. param.append('businessCode', this.enterprise1.businessCode)
  606. param.append('vipName', this.enterprise1.vipName || '')
  607. param.append('password', this.enterprise1.password)
  608. param.append('email', this.enterprise1.email || '')
  609. param.append('appId', this.$store.state.option.appId)
  610. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  611. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  612. param.append('invitationTime', this.$store.state.option.invitationTime)
  613. let config = {
  614. headers: {'Content-Type': 'multipart/form-data'}
  615. }
  616. this.$http.post('/sso/userspace/register', param, config)
  617. .then(response => {
  618. this.isShowLoading = false
  619. if (response.data.success) {
  620. window.location.href = '/overRegister/overEnterprise'
  621. } else {
  622. return Promise.reject(response.data)
  623. }
  624. }).catch(err => {
  625. this.isShowLoading = false
  626. this.$message.error(err.errMsg)
  627. })
  628. }
  629. } else {
  630. if (this.isHasEmail) {
  631. if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked) {
  632. this.isShowLoading = true
  633. let param = new FormData()
  634. param.append('spaceName', this.enterprise1.spaceName)
  635. param.append('businessCode', this.enterprise1.businessCode)
  636. param.append('vipName', this.enterprise1.vipName || '')
  637. param.append('password', this.enterprise1.password)
  638. param.append('email', this.enterprise1.email || '')
  639. param.append('appId', this.$store.state.option.appId)
  640. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  641. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  642. param.append('invitationTime', this.$store.state.option.invitationTime)
  643. let config = {
  644. headers: {'Content-Type': 'multipart/form-data'}
  645. }
  646. this.$http.post('/sso/userspace/register', param, config)
  647. .then(response => {
  648. this.isShowLoading = false
  649. if (response.data.success) {
  650. window.location.href = '/overRegister/overEnterprise'
  651. } else {
  652. return Promise.reject(response.data)
  653. }
  654. }).catch(err => {
  655. this.isShowLoading = false
  656. this.$message.error(err.errMsg)
  657. })
  658. }
  659. } else {
  660. if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked) {
  661. this.isShowLoading = true
  662. let param = new FormData()
  663. param.append('spaceName', this.enterprise1.spaceName)
  664. param.append('businessCode', this.enterprise1.businessCode)
  665. param.append('vipName', this.enterprise1.vipName || '')
  666. param.append('password', this.enterprise1.password)
  667. param.append('email', this.enterprise1.email || '')
  668. param.append('appId', this.$store.state.option.appId)
  669. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  670. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  671. param.append('invitationTime', this.$store.state.option.invitationTime)
  672. let config = {
  673. headers: {'Content-Type': 'multipart/form-data'}
  674. }
  675. this.$http.post('/sso/userspace/register', param, config)
  676. .then(response => {
  677. this.isShowLoading = false
  678. if (response.data.success) {
  679. window.location.href = '/overRegister/overEnterprise'
  680. } else {
  681. return Promise.reject(response.data)
  682. }
  683. }).catch(err => {
  684. this.isShowLoading = false
  685. this.$message.error(err.errMsg)
  686. })
  687. }
  688. }
  689. }
  690. }
  691. }
  692. }
  693. </script>
  694. <style lang="scss" scoped>
  695. .register {
  696. margin: 0 auto;
  697. width: 100%;
  698. background: #eee;
  699. .container{
  700. padding-top: 50px;
  701. margin: 0 auto;
  702. width: 980px;
  703. text-align: center;
  704. .content{
  705. padding: 0 50px;
  706. margin: 50px auto 0;
  707. width: 100%;
  708. text-align: center;
  709. background: #fff;
  710. .content-top{
  711. position: relative;
  712. height: 80px;
  713. line-height: 80px;
  714. border-bottom: 1px solid #dcdcdc;
  715. h3{
  716. font-family: 'SimHei';
  717. font-size: 24px;
  718. color: #000;
  719. }
  720. a.go{
  721. position: absolute;
  722. top: 0;
  723. right: 0;
  724. font-size: 14px;
  725. i{
  726. margin-right: 3px;
  727. }
  728. }
  729. }
  730. form {
  731. padding-bottom: 44px;
  732. margin-top: 35px;
  733. span.sure{
  734. position: absolute;
  735. top: 0;
  736. right: -240px;
  737. font-size: 13px;
  738. color: #8c8c8c;
  739. }
  740. span.codeError-tip{
  741. position: absolute;
  742. top: 3px;
  743. left: 378px;
  744. width: 200px;
  745. text-align: left;
  746. color: #ff4949;
  747. font-size: 12px;
  748. }
  749. input{
  750. padding: 0 0 0 18px;
  751. width: 360px;
  752. height: 44px;
  753. line-height: 44px;
  754. font-size: 14px;
  755. color: #000;
  756. border-radius: 0;
  757. }
  758. .pwd {
  759. margin: 6px 0 -15px 0;
  760. text-align: left;
  761. font-size: 13px;
  762. em{
  763. display: inline-block;
  764. margin: 0 8px 2px 0;
  765. width: 24px;
  766. height: 6px;
  767. &:first-child{
  768. margin-left: 10px;
  769. }
  770. }
  771. span{
  772. margin-left: 10px;
  773. font-size: 13px;
  774. }
  775. }
  776. .pwd.sm{
  777. color: #8c8c8c;
  778. em {
  779. background: #bfbfbf;
  780. &:first-child{
  781. background: #ff4e00;
  782. }
  783. }
  784. span{
  785. color: #ff4e00;
  786. }
  787. }
  788. .pwd.md{
  789. color: #8c8c8c;
  790. em {
  791. background: #22ac38;
  792. &:nth-child(3){
  793. background: #bfbfbf;
  794. }
  795. }
  796. span{
  797. color: #22ac38;
  798. }
  799. }
  800. .pwd.lar{
  801. color: #8c8c8c;
  802. em {
  803. background: #00a0e9;
  804. }
  805. span{
  806. color: #00a0e9;
  807. }
  808. }
  809. .pwd.low{
  810. color: #8c8c8c;
  811. em {
  812. background: #bfbfbf;
  813. }
  814. span{
  815. color: #00a0e9;
  816. }
  817. }
  818. span.tip{
  819. position: absolute;
  820. top: 0;
  821. right: -165px;
  822. font-size: 13px;
  823. color: #8c8c8c;
  824. }
  825. span.tip.exist{
  826. top: 5px;
  827. left: 380px;
  828. width: 250px;
  829. line-height: 18px;
  830. text-align: left;
  831. a{
  832. color: #2d8cf0;
  833. &:hover{
  834. color: #f44336;
  835. }
  836. }
  837. i.fa {
  838. font-size: 14px;
  839. color: #666;
  840. cursor: pointer;
  841. }
  842. }
  843. div.pop-tip{
  844. position: absolute;
  845. top: 39px;
  846. left: 470px;
  847. z-index: 10;
  848. span.pop-title{
  849. display: inline-block;
  850. padding: 5px;
  851. z-index:100;
  852. width: 150px;
  853. height: 55px;
  854. line-height: 16px;
  855. text-align: left;
  856. font-size: 12px;
  857. color: #8c8c8c;
  858. background: #fff;
  859. box-shadow: 0 0 5px rgba(0,0,0,.5);
  860. -moz-box-shadow: 0 0 5px rgba(0,0,0,.5);
  861. -o-box-shadow: 0 0 5px rgba(0,0,0,.5);
  862. -webkit-box-shadow: 0 0 5px rgba(0,0,0,.5);
  863. border-radius: 5px;
  864. }
  865. }
  866. span.tip.passwordError{
  867. position: absolute;
  868. top: 3px;
  869. left: 380px;
  870. width: 200px;
  871. text-align: left;
  872. color: #ff4949;
  873. font-size: 12px;
  874. }
  875. input.msg{
  876. float: left;
  877. width: 210px;
  878. }
  879. span.msg{
  880. float: right;
  881. width: 130px;
  882. height: 44px;
  883. line-height: 44px;
  884. font-size: 14px;
  885. color: #5a5a5a;
  886. background: #f4f4f4;
  887. border: 1px solid #dcdcdc;
  888. cursor: pointer;
  889. }
  890. span.msg.send{
  891. background: #d2d2d2;
  892. color: #fff;
  893. }
  894. input[type='checkbox']{
  895. margin: 0 14px 0 55px;
  896. float: left;
  897. width: 16px;
  898. height: 16px;
  899. }
  900. span.agree{
  901. float: left;
  902. margin: 1px 0 0 10px;
  903. font-size: 14px;
  904. color: #8b8b8b;
  905. a{
  906. color: #0076ad;
  907. }
  908. }
  909. .form-group.agree{
  910. margin: 20px auto 0 !important;
  911. }
  912. .btn {
  913. margin: 34px 0 16px 0;
  914. width: 360px;
  915. height: 44px;
  916. line-height: 44px;
  917. font-size: 16px;
  918. color: #fff;
  919. background: #0076AD;
  920. border-radius: 3px;
  921. }
  922. }
  923. }
  924. .login{
  925. margin-top: 20px;
  926. font-size: 14px;
  927. color: #8c8c8c;
  928. a{
  929. font-size: 14px;
  930. color: #0076ad;
  931. }
  932. }
  933. }
  934. }
  935. </style>