EnterpriseRegistration.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  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. callback()
  379. }
  380. }
  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. }
  409. }
  410. }
  411. return {
  412. // 企业注册第一步
  413. enterprise: {
  414. mobile: '',
  415. code: ''
  416. },
  417. // 企业注册第二步
  418. enterprise1: {
  419. spaceName: '',
  420. businessCode: '',
  421. vipName: '',
  422. password: '',
  423. confirm: '',
  424. email: ''
  425. },
  426. businessCodeExitMsg: '',
  427. spaceNameExitMsg: '',
  428. showPopTip: false,
  429. showPasswordError: false,
  430. isShowLoading: false,
  431. codeErrorMsg: '',
  432. checked: true,
  433. getCodeBtnIsDisabled: true,
  434. mobileChecked: false,
  435. codeChecked: false,
  436. showMsgTip: true,
  437. sendEnterpriseCode: true,
  438. codeErrorChecked: false,
  439. enterprise_time: 0,
  440. showMsgTip1: false,
  441. showMsgTip2: false,
  442. showMsgTip3: false,
  443. showMsgTip4: false,
  444. spaceNameChecked: false,
  445. businessCodeChecked: false,
  446. vipNameChecked: false,
  447. passwordChecked: false,
  448. passwordConfirmChecked: false,
  449. emailChecked: false,
  450. isHasRegister: false,
  451. isHasEmail: false,
  452. goNextStep: true,
  453. phoneIsRegisterTip: true,
  454. isSpaceNameExist: false,
  455. isBusinessCodeExist: false,
  456. emailHasRegister: false,
  457. queryLink: '',
  458. appId: '',
  459. // 企业注册第一步
  460. rules: {
  461. mobile: [
  462. {validator: validateMobile, trigger: 'blur'}
  463. ],
  464. code: [
  465. {validator: validateCode, trigger: 'blur'}
  466. ]
  467. },
  468. // 企业注册第二步
  469. rules1: {
  470. spaceName: [
  471. {validator: validateSpaceName, trigger: 'blur'}
  472. ],
  473. businessCode: [
  474. {validator: validateBusinessCode, trigger: 'blur'}
  475. ],
  476. vipName: [
  477. {validator: validateVipName, trigger: 'blur'}
  478. ],
  479. password: [
  480. {validator: validatePassword, trigger: 'change'},
  481. {validator: validatePasswordTip, trigger: 'blur'}
  482. ],
  483. confirm: [
  484. {validator: validateConfirm, trigger: 'blur'}
  485. ],
  486. email: [
  487. {validator: validateEmail, trigger: 'blur'}
  488. ]
  489. }
  490. }
  491. },
  492. mounted () {
  493. // 获取链接
  494. this.$nextTick(() => {
  495. this.getUrl()
  496. })
  497. },
  498. methods: {
  499. // 获取链接
  500. getUrl () {
  501. var url = window.location.search
  502. var request = {}
  503. if (url.indexOf('?' !== -1)) {
  504. var str = url.substr(1)
  505. var strs = str.split('&')
  506. this.queryLink = str
  507. for (var i = 0; i < strs.length; i++) {
  508. request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
  509. }
  510. }
  511. this.appId = request['appId'] || ''
  512. },
  513. // 注册
  514. goRegister () {
  515. console.log(this.queryLink)
  516. window.location.href = `/register/personalRegistration?${this.queryLink}`
  517. },
  518. // 我同意是否被选中
  519. checkboxIsChecked () {
  520. this.checked = !this.checked
  521. },
  522. // 获取校验码
  523. getCheckCode () {
  524. this.isShowLoading = true
  525. this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile}})
  526. .then(response => {
  527. this.isShowLoading = false
  528. if (response.data) {
  529. this.token = response.data.token
  530. if (this.token !== '') {
  531. this.$message({
  532. message: '验证码已经发送到您的手机,请注意查收',
  533. type: 'success'
  534. })
  535. this.sendEnterpriseCode = false
  536. this.enterprise_time = 60
  537. var enterpriseTime = setInterval(() => {
  538. this.enterprise_time--
  539. if (this.enterprise_time <= 0) {
  540. this.sendEnterpriseCode = true
  541. clearInterval(enterpriseTime)
  542. }
  543. }, 1000)
  544. }
  545. } else {
  546. return Promise.reject(response.data)
  547. }
  548. }).catch(err => {
  549. this.isShowLoading = false
  550. this.$message.error(err.errMsg)
  551. })
  552. },
  553. // 验证手机
  554. checkPhone () {
  555. if (this.mobileChecked && this.codeChecked && this.checked) {
  556. this.isShowLoading = true
  557. let param = new FormData()
  558. param.append('mobile', this.enterprise.mobile)
  559. param.append('code', this.enterprise.code)
  560. param.append('appId', this.appId)
  561. param.append('token', this.token)
  562. let config = {
  563. headers: {'Content-Type': 'multipart/form-data'}
  564. }
  565. this.$http.post('/sso/userspace/register/checkAdminTel', param, config)
  566. .then(response => {
  567. this.isShowLoading = false
  568. if (response.data.success) {
  569. this.goNextStep = false
  570. if (response.data.content.hasRegister) {
  571. this.isHasRegister = true
  572. if (response.data.content.hasEmail) {
  573. this.isHasEmail = true
  574. } else {
  575. this.isHasEmail = false
  576. }
  577. } else {
  578. this.isHasRegister = false
  579. this.isHasEmail = false
  580. }
  581. } else {
  582. this.goNextStep = true
  583. return Promise.reject(response.data)
  584. }
  585. }).catch(err => {
  586. this.$message.error(err.errMsg)
  587. this.isShowLoading = false
  588. // this.codeErrorChecked = true
  589. // this.codeChecked = false
  590. this.enterprise_time = 0
  591. })
  592. }
  593. },
  594. // 确认注册
  595. sureRegister () {
  596. if (!this.isHasRegister) {
  597. if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
  598. this.isShowLoading = true
  599. let param = new FormData()
  600. param.append('spaceName', this.enterprise1.spaceName)
  601. param.append('businessCode', this.enterprise1.businessCode)
  602. param.append('vipName', this.enterprise1.vipName || '')
  603. param.append('password', this.enterprise1.password)
  604. param.append('email', this.enterprise1.email || '')
  605. param.append('appId', this.$store.state.option.appId)
  606. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  607. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  608. param.append('invitationTime', this.$store.state.option.invitationTime)
  609. let config = {
  610. headers: {'Content-Type': 'multipart/form-data'}
  611. }
  612. this.$http.post('/sso/userspace/register', param, config)
  613. .then(response => {
  614. this.isShowLoading = false
  615. if (response.data.success) {
  616. window.location.href = '/overRegister/overEnterprise'
  617. } else {
  618. return Promise.reject(response.data)
  619. }
  620. }).catch(err => {
  621. this.isShowLoading = false
  622. this.$message.error(err.errMsg)
  623. })
  624. }
  625. } else {
  626. if (this.isHasEmail) {
  627. if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked) {
  628. this.isShowLoading = true
  629. let param = new FormData()
  630. param.append('spaceName', this.enterprise1.spaceName)
  631. param.append('businessCode', this.enterprise1.businessCode)
  632. param.append('vipName', this.enterprise1.vipName || '')
  633. param.append('password', this.enterprise1.password)
  634. param.append('email', this.enterprise1.email || '')
  635. param.append('appId', this.$store.state.option.appId)
  636. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  637. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  638. param.append('invitationTime', this.$store.state.option.invitationTime)
  639. let config = {
  640. headers: {'Content-Type': 'multipart/form-data'}
  641. }
  642. this.$http.post('/sso/userspace/register', param, config)
  643. .then(response => {
  644. this.isShowLoading = false
  645. if (response.data.success) {
  646. window.location.href = '/overRegister/overEnterprise'
  647. } else {
  648. return Promise.reject(response.data)
  649. }
  650. }).catch(err => {
  651. this.isShowLoading = false
  652. this.$message.error(err.errMsg)
  653. })
  654. }
  655. } else {
  656. if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked) {
  657. this.isShowLoading = true
  658. let param = new FormData()
  659. param.append('spaceName', this.enterprise1.spaceName)
  660. param.append('businessCode', this.enterprise1.businessCode)
  661. param.append('vipName', this.enterprise1.vipName || '')
  662. param.append('password', this.enterprise1.password)
  663. param.append('email', this.enterprise1.email || '')
  664. param.append('appId', this.$store.state.option.appId)
  665. param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
  666. param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
  667. param.append('invitationTime', this.$store.state.option.invitationTime)
  668. let config = {
  669. headers: {'Content-Type': 'multipart/form-data'}
  670. }
  671. this.$http.post('/sso/userspace/register', param, config)
  672. .then(response => {
  673. this.isShowLoading = false
  674. if (response.data.success) {
  675. window.location.href = '/overRegister/overEnterprise'
  676. } else {
  677. return Promise.reject(response.data)
  678. }
  679. }).catch(err => {
  680. this.isShowLoading = false
  681. this.$message.error(err.errMsg)
  682. })
  683. }
  684. }
  685. }
  686. }
  687. }
  688. }
  689. </script>
  690. <style lang="scss" scoped>
  691. .register {
  692. margin: 0 auto;
  693. width: 100%;
  694. background: #eee;
  695. .container{
  696. padding-top: 50px;
  697. margin: 0 auto;
  698. width: 980px;
  699. text-align: center;
  700. .content{
  701. padding: 0 50px;
  702. margin: 50px auto 0;
  703. width: 100%;
  704. text-align: center;
  705. background: #fff;
  706. .content-top{
  707. position: relative;
  708. height: 80px;
  709. line-height: 80px;
  710. border-bottom: 1px solid #dcdcdc;
  711. h3{
  712. font-family: 'SimHei';
  713. font-size: 24px;
  714. color: #000;
  715. }
  716. a.go{
  717. position: absolute;
  718. top: 0;
  719. right: 0;
  720. font-size: 14px;
  721. i{
  722. margin-right: 3px;
  723. }
  724. }
  725. }
  726. form {
  727. padding-bottom: 44px;
  728. margin-top: 35px;
  729. span.sure{
  730. position: absolute;
  731. top: 0;
  732. right: -240px;
  733. font-size: 13px;
  734. color: #8c8c8c;
  735. }
  736. span.codeError-tip{
  737. position: absolute;
  738. top: 3px;
  739. left: 378px;
  740. width: 200px;
  741. text-align: left;
  742. color: #ff4949;
  743. font-size: 12px;
  744. }
  745. input{
  746. padding: 0 0 0 18px;
  747. width: 360px;
  748. height: 44px;
  749. line-height: 44px;
  750. font-size: 14px;
  751. color: #000;
  752. border-radius: 0;
  753. }
  754. .pwd {
  755. margin: 6px 0 -15px 0;
  756. text-align: left;
  757. font-size: 13px;
  758. em{
  759. display: inline-block;
  760. margin: 0 8px 2px 0;
  761. width: 24px;
  762. height: 6px;
  763. &:first-child{
  764. margin-left: 10px;
  765. }
  766. }
  767. span{
  768. margin-left: 10px;
  769. font-size: 13px;
  770. }
  771. }
  772. .pwd.sm{
  773. color: #8c8c8c;
  774. em {
  775. background: #bfbfbf;
  776. &:first-child{
  777. background: #ff4e00;
  778. }
  779. }
  780. span{
  781. color: #ff4e00;
  782. }
  783. }
  784. .pwd.md{
  785. color: #8c8c8c;
  786. em {
  787. background: #22ac38;
  788. &:nth-child(3){
  789. background: #bfbfbf;
  790. }
  791. }
  792. span{
  793. color: #22ac38;
  794. }
  795. }
  796. .pwd.lar{
  797. color: #8c8c8c;
  798. em {
  799. background: #00a0e9;
  800. }
  801. span{
  802. color: #00a0e9;
  803. }
  804. }
  805. .pwd.low{
  806. color: #8c8c8c;
  807. em {
  808. background: #bfbfbf;
  809. }
  810. span{
  811. color: #00a0e9;
  812. }
  813. }
  814. span.tip{
  815. position: absolute;
  816. top: 0;
  817. right: -165px;
  818. font-size: 13px;
  819. color: #8c8c8c;
  820. }
  821. span.tip.exist{
  822. top: 5px;
  823. left: 380px;
  824. width: 250px;
  825. line-height: 18px;
  826. text-align: left;
  827. a{
  828. color: #2d8cf0;
  829. &:hover{
  830. color: #f44336;
  831. }
  832. }
  833. i.fa {
  834. font-size: 14px;
  835. color: #666;
  836. cursor: pointer;
  837. }
  838. }
  839. div.pop-tip{
  840. position: absolute;
  841. top: 39px;
  842. left: 470px;
  843. z-index: 10;
  844. span.pop-title{
  845. display: inline-block;
  846. padding: 5px;
  847. z-index:100;
  848. width: 150px;
  849. height: 55px;
  850. line-height: 16px;
  851. text-align: left;
  852. font-size: 12px;
  853. color: #8c8c8c;
  854. background: #fff;
  855. box-shadow: 0 0 5px rgba(0,0,0,.5);
  856. -moz-box-shadow: 0 0 5px rgba(0,0,0,.5);
  857. -o-box-shadow: 0 0 5px rgba(0,0,0,.5);
  858. -webkit-box-shadow: 0 0 5px rgba(0,0,0,.5);
  859. border-radius: 5px;
  860. }
  861. }
  862. span.tip.passwordError{
  863. position: absolute;
  864. top: 3px;
  865. left: 380px;
  866. width: 200px;
  867. text-align: left;
  868. color: #ff4949;
  869. font-size: 12px;
  870. }
  871. input.msg{
  872. float: left;
  873. width: 210px;
  874. }
  875. span.msg{
  876. float: right;
  877. width: 130px;
  878. height: 44px;
  879. line-height: 44px;
  880. font-size: 14px;
  881. color: #5a5a5a;
  882. background: #f4f4f4;
  883. border: 1px solid #dcdcdc;
  884. cursor: pointer;
  885. }
  886. span.msg.send{
  887. background: #d2d2d2;
  888. color: #fff;
  889. }
  890. input[type='checkbox']{
  891. margin: 0 14px 0 55px;
  892. float: left;
  893. width: 16px;
  894. height: 16px;
  895. }
  896. span.agree{
  897. float: left;
  898. margin: 1px 0 0 10px;
  899. font-size: 14px;
  900. color: #8b8b8b;
  901. a{
  902. color: #0076ad;
  903. }
  904. }
  905. .form-group.agree{
  906. margin: 20px auto 0 !important;
  907. }
  908. .btn {
  909. margin: 34px 0 16px 0;
  910. width: 360px;
  911. height: 44px;
  912. line-height: 44px;
  913. font-size: 16px;
  914. color: #fff;
  915. background: #0076AD;
  916. border-radius: 3px;
  917. }
  918. }
  919. }
  920. .login{
  921. margin-top: 20px;
  922. font-size: 14px;
  923. color: #8c8c8c;
  924. a{
  925. font-size: 14px;
  926. color: #0076ad;
  927. }
  928. }
  929. }
  930. }
  931. </style>