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}} <i class="fa fa-question-circle" aria-hidden="true"
  50. v-show="spaceNameExitMsg != '出现异常'"
  51. @mouseenter='showPopTip =true'
  52. @mouseleave='showPopTip = false'></i>
  53. </span>
  54. <div class="pop-tip" @mouseenter='showPopTip =true'
  55. @mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span></div>
  56. </el-form-item>
  57. <el-form-item prop="businessCode">
  58. <el-input type="text"
  59. v-model="enterprise1.businessCode"
  60. v-bind:class="{ active: isBusinessCodeExist }"
  61. auto-complete="off"
  62. placeholder="营业执照号"></el-input>
  63. <span class="tip exist" v-show="isBusinessCodeExist">{{businessCodeExitMsg}}。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
  64. </el-form-item>
  65. <el-form-item prop="vipName" v-if="!isHasRegister">
  66. <el-input type="text" v-model="enterprise1.vipName" auto-complete="off" placeholder="管理员姓名"></el-input>
  67. </el-form-item>
  68. <el-form-item prop="password" v-if="!isHasRegister">
  69. <el-input type="password" v-model="enterprise1.password" auto-complete="off" placeholder="登录密码"></el-input>
  70. <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
  71. <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
  72. <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
  73. <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
  74. </el-form-item>
  75. <el-form-item prop="password" v-if="isHasRegister">
  76. <el-input type="password"
  77. v-model="enterprise1.password"
  78. auto-complete="off"
  79. placeholder="密码确认"
  80. v-bind:class="{ correct: passwordChecked }"></el-input>
  81. <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a href="/reset/ForgetPasswordValidationAccount">忘记密码?</a></span>
  82. </el-form-item>
  83. <el-form-item prop="confirm" v-if="!isHasRegister">
  84. <el-input type="password"
  85. auto-complete="off"
  86. placeholder="密码确认"
  87. v-bind:class="{active: showPasswordError}"
  88. v-model="enterprise1.confirm"></el-input>
  89. <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
  90. </el-form-item>
  91. <el-form-item prop="email" v-if="!isHasEmail">
  92. <el-input type="text"
  93. v-model="enterprise1.email"
  94. auto-complete="off"
  95. placeholder="联系邮箱"
  96. v-bind:class="{active: emailHasRegister}"></el-input>
  97. <span class="codeError-tip" v-if="emailHasRegister">该邮箱已被注册</span>
  98. </el-form-item>
  99. <a class="btn finish"
  100. :disabled="!isHasRegister ? !spaceNameChecked || !businessCodeChecked || !vipNameChecked || !passwordChecked || !passwordConfirmChecked || !emailChecked || !checked : !isHasEmail ? !spaceNameChecked || !businessCodeChecked || !passwordChecked || !emailChecked || !checked : !spaceNameChecked || !businessCodeChecked || !passwordChecked || !checked"
  101. @click="sureRegister">确认注册
  102. </a>
  103. </el-form-item>
  104. <el-form-item>
  105. <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
  106. <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
  107. </el-form-item>
  108. </el-form>
  109. </div>
  110. </div>
  111. <div class="login">已有账号?<a href="/">立即登录</a></div>
  112. <loading v-show="isShowLoading"/>
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. import Loading from '~components/common/loading/Loading.vue'
  118. export default {
  119. name: 'EnterpriseRegistration',
  120. components: {
  121. Loading
  122. },
  123. data () {
  124. // 企业注册第一步
  125. var validateMobile = (rule, value, callback) => {
  126. if (value === '') {
  127. callback(new Error('请填写正确的手机号'))
  128. this.showMsgTip = false
  129. this.getCodeBtnIsDisabled = true
  130. this.mobileChecked = false
  131. } else {
  132. if (this.enterprise.mobile !== '') {
  133. var reg = /^1[0-9]{10}$/
  134. if (!reg.test(value)) {
  135. callback(new Error('请填写正确的手机号'))
  136. this.showMsgTip = false
  137. this.getCodeBtnIsDisabled = true
  138. this.mobileChecked = false
  139. } else {
  140. this.getCodeBtnIsDisabled = false
  141. this.showMsgTip = false
  142. this.mobileChecked = true
  143. }
  144. }
  145. callback()
  146. }
  147. }
  148. var validateCode = (rule, value, callback) => {
  149. if (value === '') {
  150. callback(new Error('请填写正确的验证码'))
  151. this.codeErrorChecked = false
  152. this.codeChecked = false
  153. } else {
  154. if (this.enterprise.code !== '') {
  155. if (this.enterprise.mobile === '') {
  156. callback(new Error('请先填写正确的手机号'))
  157. } else {
  158. if (this.token) {
  159. let param = new FormData()
  160. param.append('mobile', this.enterprise.mobile)
  161. param.append('code', this.enterprise.code)
  162. param.append('token', this.token)
  163. let config = {
  164. headers: {'Content-Type': 'multipart/form-data'}
  165. }
  166. this.$http.post(`/sso/personal/register/checkCode`, param, config)
  167. .then(response => {
  168. if (response.data.success) {
  169. this.codeChecked = true
  170. this.codeErrorChecked = false
  171. } else {
  172. this.codeErrorChecked = true
  173. this.codeChecked = false
  174. return Promise.reject(response.data)
  175. }
  176. }).catch(err => {
  177. this.codeErrorChecked = true
  178. this.codeErrorMsg = err.errMsg
  179. // this.$message.error(err.errMsg)
  180. })
  181. } else {
  182. callback(new Error('请先获取验证码'))
  183. this.codeChecked = false
  184. this.codeErrorChecked = false
  185. }
  186. }
  187. }
  188. callback()
  189. }
  190. }
  191. // 企业注册第二步
  192. var validateSpaceName = (rule, value, callback) => {
  193. if (value === '') {
  194. callback(new Error('请填写正确的企业名称'))
  195. this.spaceNameChecked = false
  196. this.isSpaceNameExist = false
  197. } else {
  198. if (this.enterprise1.spaceName !== '') {
  199. if (value.length > 20) {
  200. callback(new Error('输入长度过长,20个字符以内'))
  201. this.spaceNameChecked = false
  202. } else {
  203. this.$http.get(`/api/userspace/checkSpaceName`, {params: {spaceName: this.enterprise1.spaceName}})
  204. .then(response => {
  205. if (response.data.success) {
  206. this.spaceNameChecked = true
  207. this.isSpaceNameExist = false
  208. } else {
  209. this.spaceNameChecked = false
  210. this.isSpaceNameExist = true
  211. return Promise.reject(response.data)
  212. }
  213. }).catch(err => {
  214. this.spaceNameExitMsg = err.errMsg
  215. // this.$message.error(err.errMsg)
  216. })
  217. }
  218. }
  219. callback()
  220. }
  221. }
  222. var validateBusinessCode = (rule, value, callback) => {
  223. if (value === '') {
  224. callback(new Error('请填写正确的营业执照号'))
  225. this.businessCodeChecked = false
  226. this.isBusinessCodeExist = false
  227. } else {
  228. if (this.enterprise1.businessCode !== '') {
  229. let reg = /^[A-Za-z0-9]+$/
  230. if (reg.test(value)) {
  231. if (value.length > 20) {
  232. callback(new Error('输入长度过长,20个字符以内'))
  233. this.businessCodeChecked = false
  234. this.isBusinessCodeExist = false
  235. } else {
  236. this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise1.businessCode}})
  237. .then(response => {
  238. if (response.data.success) {
  239. this.businessCodeChecked = true
  240. this.isBusinessCodeExist = false
  241. } else {
  242. this.businessCodeChecked = false
  243. this.isBusinessCodeExist = true
  244. return Promise.reject(response.data)
  245. }
  246. }).catch(err => {
  247. this.businessCodeExitMsg = err.errMsg
  248. // this.$message.error(err.errMsg)
  249. })
  250. }
  251. } else {
  252. callback(new Error('请填写正确的营业执照号'))
  253. this.businessCodeChecked = false
  254. this.isBusinessCodeExist = false
  255. }
  256. }
  257. callback()
  258. }
  259. }
  260. var validateVipName = (rule, value, callback) => {
  261. if (this.isHasRegister) {
  262. this.vipNameChecked = true
  263. } else {
  264. if (value === '') {
  265. callback(new Error('请填写正确的管理员姓名'))
  266. this.vipNameChecked = false
  267. } else {
  268. if (this.enterprise1.vipName !== '') {
  269. if (value.length > 20) {
  270. callback(new Error('输入长度过长,20个字符以内'))
  271. } else {
  272. this.vipNameChecked = true
  273. }
  274. }
  275. callback()
  276. }
  277. }
  278. }
  279. var validatePassword = (rule, value, callback) => {
  280. if (this.enterprise1.password !== '') {
  281. if (value.length <= 20 && value.length >= 8) {
  282. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  283. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  284. if (reg1.test(value)) {
  285. // callback(new Error('密码强度强'))
  286. this.showMsgTip3 = true
  287. this.showMsgTip2 = false
  288. this.showMsgTip1 = false
  289. this.showMsgTip4 = false
  290. this.passwordChecked = true
  291. } else if (reg2.test(value)) {
  292. // callback(new Error('密码强度中'))
  293. this.showMsgTip2 = true
  294. this.showMsgTip3 = false
  295. this.showMsgTip1 = false
  296. this.showMsgTip4 = false
  297. this.passwordChecked = true
  298. } else {
  299. this.showMsgTip1 = true
  300. this.showMsgTip3 = false
  301. this.showMsgTip2 = false
  302. this.showMsgTip4 = false
  303. this.passwordChecked = false
  304. }
  305. } else {
  306. this.showMsgTip3 = false
  307. this.showMsgTip2 = false
  308. this.showMsgTip1 = false
  309. this.showMsgTip4 = true
  310. this.passwordChecked = false
  311. }
  312. }
  313. callback()
  314. }
  315. var validatePasswordTip = (rule, value, callback) => {
  316. if (this.isHasRegister) {
  317. if (value === '') {
  318. callback(new Error('请输入密码'))
  319. this.passwordChecked = false
  320. this.phoneIsRegisterTip = false
  321. } else {
  322. this.passwordChecked = true
  323. }
  324. } else {
  325. if (value === '') {
  326. callback(new Error('请输入密码'))
  327. this.passwordChecked = false
  328. } else {
  329. if (this.enterprise1.password !== '') {
  330. if (value.length <= 20 && value.length >= 8) {
  331. var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
  332. var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
  333. if (reg1.test(value)) {
  334. this.passwordChecked = true
  335. } else if (reg2.test(value)) {
  336. this.passwordChecked = true
  337. } else {
  338. callback(new Error('密码须为8-20字符的英文、数字混合'))
  339. this.passwordChecked = false
  340. }
  341. } else {
  342. callback(new Error('密码须为8-20字符的英文、数字混合'))
  343. this.passwordChecked = false
  344. }
  345. if (this.enterprise1.confirm !== '') {
  346. if (value !== this.enterprise1.confirm) {
  347. this.showPasswordError = true
  348. // callback(new Error('两次输入密码不一致!'))
  349. this.passwordConfirmChecked = false
  350. } else {
  351. this.passwordConfirmChecked = true
  352. this.showPasswordError = false
  353. callback()
  354. }
  355. }
  356. }
  357. callback()
  358. }
  359. }
  360. }
  361. var validateConfirm = (rule, value, callback) => {
  362. if (this.isHasRegister) {
  363. this.passwordConfirmChecked = true
  364. } else {
  365. if (value === '') {
  366. callback(new Error('请再次输入密码'))
  367. this.passwordConfirmChecked = false
  368. this.showPasswordError = false
  369. } else if (value !== this.enterprise1.password) {
  370. // callback(new Error('两次输入密码不一致!'))
  371. this.showPasswordError = true
  372. this.passwordConfirmChecked = false
  373. } else {
  374. this.passwordConfirmChecked = true
  375. this.showPasswordError = false
  376. callback()
  377. }
  378. }
  379. }
  380. var validateEmail = (rule, value, callback) => {
  381. if (this.isHasEmail) {
  382. this.emailChecked = true
  383. this.emailHasRegister = false
  384. } else {
  385. if (!value) {
  386. callback(new Error('请填写正确的联系邮箱'))
  387. this.emailChecked = false
  388. this.emailHasRegister = false
  389. } else {
  390. if (this.enterprise1.email) {
  391. var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
  392. if (!reg.test(value)) {
  393. callback(new Error('请输入正确的邮箱地址格式'))
  394. this.emailChecked = false
  395. this.emailHasRegister = false
  396. } else {
  397. this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
  398. .then(response => {
  399. if (response.data.hasRegister) {
  400. this.emailChecked = false
  401. this.emailHasRegister = true
  402. } else {
  403. this.emailChecked = true
  404. this.emailHasRegister = false
  405. return Promise.reject(response.data)
  406. }
  407. }).catch(err => {
  408. this.$message.error(err.errMsg)
  409. })
  410. }
  411. }
  412. callback()
  413. }
  414. }
  415. }
  416. return {
  417. // 企业注册第一步
  418. enterprise: {
  419. mobile: '',
  420. code: ''
  421. },
  422. // 企业注册第二步
  423. enterprise1: {
  424. spaceName: '',
  425. businessCode: '',
  426. vipName: '',
  427. password: '',
  428. confirm: '',
  429. email: ''
  430. },
  431. businessCodeExitMsg: '',
  432. spaceNameExitMsg: '',
  433. showPopTip: false,
  434. showPasswordError: false,
  435. isShowLoading: false,
  436. codeErrorMsg: '',
  437. checked: true,
  438. getCodeBtnIsDisabled: true,
  439. mobileChecked: false,
  440. codeChecked: false,
  441. showMsgTip: true,
  442. sendEnterpriseCode: true,
  443. codeErrorChecked: false,
  444. enterprise_time: 0,
  445. showMsgTip1: false,
  446. showMsgTip2: false,
  447. showMsgTip3: false,
  448. showMsgTip4: false,
  449. spaceNameChecked: false,
  450. businessCodeChecked: false,
  451. vipNameChecked: false,
  452. passwordChecked: false,
  453. passwordConfirmChecked: false,
  454. emailChecked: false,
  455. isHasRegister: false,
  456. isHasEmail: false,
  457. goNextStep: true,
  458. phoneIsRegisterTip: true,
  459. isSpaceNameExist: false,
  460. isBusinessCodeExist: false,
  461. emailHasRegister: false,
  462. queryLink: '',
  463. appId: '',
  464. // 企业注册第一步
  465. rules: {
  466. mobile: [
  467. {validator: validateMobile, trigger: 'blur'}
  468. ],
  469. code: [
  470. {validator: validateCode, trigger: 'blur'}
  471. ]
  472. },
  473. // 企业注册第二步
  474. rules1: {
  475. spaceName: [
  476. {validator: validateSpaceName, trigger: 'blur'}
  477. ],
  478. businessCode: [
  479. {validator: validateBusinessCode, trigger: 'blur'}
  480. ],
  481. vipName: [
  482. {validator: validateVipName, trigger: 'blur'}
  483. ],
  484. password: [
  485. {validator: validatePassword, trigger: 'change'},
  486. {validator: validatePasswordTip, trigger: 'blur'}
  487. ],
  488. confirm: [
  489. {validator: validateConfirm, trigger: 'blur'}
  490. ],
  491. email: [
  492. {validator: validateEmail, trigger: 'blur'}
  493. ]
  494. }
  495. }
  496. },
  497. mounted () {
  498. // 获取链接
  499. this.$nextTick(() => {
  500. this.getUrl()
  501. })
  502. },
  503. methods: {
  504. // 获取链接
  505. getUrl () {
  506. var url = window.location.search
  507. var request = {}
  508. if (url.indexOf('?' !== -1)) {
  509. var str = url.substr(1)
  510. var strs = str.split('&')
  511. this.queryLink = str
  512. for (var i = 0; i < strs.length; i++) {
  513. request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
  514. }
  515. }
  516. this.appId = request['appId'] || ''
  517. },
  518. // 注册
  519. goRegister () {
  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>