cloudCenter.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <template>
  2. <div class="cloud-info">
  3. <div class="box-header"><img src="/images/all/uas-m.png" alt="">账号中心</div>
  4. <div class="w-over-box">
  5. <div class="basic-nav">
  6. <span @click="activeTab = 0" :class="{active: activeTab === 0}">个人账号信息<em></em></span>
  7. <span @click="activeTab = 1" :class="{active: activeTab === 1}" v-show="user.userspace">绑定企业信息<em></em></span>
  8. </div>
  9. <div class="basic-info" v-show="activeTab === 0">
  10. <div class="basic-top">
  11. <div class="line">
  12. <div class="people"><i class="man"></i> <em class="user" v-text="user.user.vipName ? user.user.vipName : '用户名'"></em></div>
  13. <div class="time"><span>上次登录时间: {{user.user.lastLoginTime | time}}</span></div>
  14. </div>
  15. </div>
  16. <div class="basic-bottom">
  17. <div class="item">
  18. <div class="item-list">
  19. <div class="pwd-level">账号安全等级</div>
  20. <div class="pwd sm" v-show="accountLevel === 0"><em></em><em></em><em></em><span>弱</span></div>
  21. <div class="pwd md" v-show="accountLevel === 1"><em></em><em></em><em></em><span>中</span></div>
  22. <div class="pwd lar" v-show="accountLevel === 2"><em></em><em></em><em></em><span>强</span></div>
  23. </div>
  24. </div>
  25. <div class="item items">
  26. <div class="item-list">
  27. <div class="bind-name">
  28. <span>绑定手机</span>
  29. <img v-show="user.user.mobileValidCode != 2" src="/images/all/question-m.png" alt="">
  30. </div>
  31. <div class="bind-tip">
  32. <span>您绑定的手机:{{secretMobile}}。若已丢失或停用,请立即更换,避免账户被盗。</span>
  33. <a href="/validation/phoneValidation" class="bind-btn" v-show="user.user.mobileValidCode === 2">修改</a>
  34. <a href="/validation/phoneValidation" class="go-btn" v-show="user.user.mobileValidCode != 2">设置</a>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="item items">
  39. <div class="item-list">
  40. <div class="bind-name">
  41. <span>绑定邮箱</span>
  42. <img v-show="user.user.emailValidCode != 2" src="/images/all/question-m.png" alt="">
  43. </div>
  44. <div class="bind-tip">
  45. <span>{{secretEmail ? '您绑定的邮箱:' + secretEmail : '您还没有绑定邮箱哦!'}}</span>
  46. <a href="/validation/emailValidation" class="bind-btn" v-show="user.user.emailValidCode === 2">修改</a>
  47. <a href="/validation/emailValidation" class="go-btn" v-show="user.user.emailValidCode != 2">认证</a>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="item items">
  52. <div class="item-list">
  53. <div class="bind-name">
  54. <span>登录密码</span>
  55. <img v-show="user.user.passwordLevel === 1" src="/images/all/question-m.png" alt="">
  56. </div>
  57. <div class="bind-tip">
  58. <span class="tip-text tipText1">安全性高的密码可以使账号更安全,建议您定期更换密码,并且设置一个包含数字和字母,长度超过8位以上的密码。</span>
  59. <a href="/reset/forgetPasswordValidationAccount" class="bind-btn" v-show="user.user.passwordLevel === 2 || user.user.passwordLevel === 3">修改</a>
  60. <a href="/reset/forgetPasswordValidationAccount" class="go-btn" v-show="user.user.passwordLevel === 1">设置</a>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="item items">
  65. <div class="item-list">
  66. <div class="bind-name">
  67. <span>密保问题</span>
  68. <img v-show="!user.user.hasQuestion" src="/images/all/question-m.png" alt="">
  69. </div>
  70. <div class="bind-tip">
  71. <span class="tip-txt tipText2">是您找回登录密码的方法之一。建议您设置一个容易记住,且最不容易被他人获取的问题及答案。</span>
  72. <a href="/encrypted-setting/EncryptedSetting" class="bind-btn" v-show="user.user.hasQuestion">修改</a>
  73. <a href="/encrypted-setting/EncryptedSetting" class="go-btn" v-show="!user.user.hasQuestion">设置</a>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="item items">
  78. <div class="item-list">
  79. <div class="bind-name">
  80. <span>实名认证</span>
  81. <img v-show="user.user.identityValidCode != 2" src="/images/all/question-m.png" alt="">
  82. </div>
  83. <div class="bind-tip">
  84. <span>实名认证后,可通过实名信息找回支付密码、修改手机号等,提高账户安全性。</span>
  85. <a href="/certification/realNameCertification" class="bind-btn" v-show="user.user.identityValidCode === 2">修改</a>
  86. <a href="/certification/realNameCertification" class="go-btn" v-show="user.user.identityValidCode === 0 || user.user.identityValidCode === 3">设置</a>
  87. <a class="wait-btn" v-show="user.user.identityValidCode === 1">认证中</a>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="basic-info" v-show="activeTab === 1" v-if="user.userspace">
  94. <div class="basic-top">
  95. <div class="line">
  96. <div class="enter" :class="{enterprise : (user.userspace.validCode === 1 && user.newUserSpace)}">
  97. <i class="enterprise-img"></i>
  98. <em v-text="user.userspace.spaceName ? user.userspace.spaceName : '企业名称'"></em>
  99. <b v-if='user.userspace.validCode === 1 && user.newUserSpace' class="angle">——></b>
  100. <em class="new" v-if='user.userspace.validCode === 1 && user.newUserSpace' v-text="user.newUserSpace.spaceName ? user.newUserSpace.spaceName : '企业名称'"></em>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="enterprise-bottom">
  105. <div class="enterprise">
  106. <div class="bind-info">
  107. <span>管理员</span>
  108. <div>{{user.userspace.admin.vipName || '-'}}</div>
  109. </div>
  110. <div class="bind-detail"><a href="/change/changeManager">修改</a></div>
  111. </div>
  112. <div class="enterprise">
  113. <div class="bind-info">
  114. <span>企业认证</span>
  115. <div v-text="user.userspace.validCode === 0 ? '未认证' : user.userspace.validCode === 1 ? '待认证' : user.userspace.validCode === 2 ? '已认证' : user.userspace.validCode === 3 ? '未通过' : ''"></div>
  116. </div>
  117. <div class="bind-detail">
  118. <a v-show="user.userspace.validCode === 0" href="/certification/enterpriseCertification">申请认证</a>
  119. <a v-show="user.userspace.validCode === 3" href="/certification/enterpriseCertification">重新认证</a>
  120. </div>
  121. </div>
  122. <div class="enterprise">
  123. <div class="bind-info">
  124. <span>营业执照号</span>
  125. <div :class="{showAll: user.userspace.validCode != 1}">{{user.userspace.businessCode || '-'}}</div>
  126. <div class="new" v-if='user.userspace.validCode === 1 && user.newUserSpace'><b class="angle">——></b>{{user.newUserSpace.businessCode || '-'}}</div>
  127. </div>
  128. </div>
  129. <div class="enterprise">
  130. <div class="bind-info">
  131. <span>营业执照扫描件</span>
  132. <div v-if="user.userspace.businessCodeImage"
  133. @click="showImg(user.userspace.businessCodeImage)">查看附件: <i class="fa fa-eye" style="color:#0076ad"></i></div>
  134. <div v-if="!user.userspace.businessCodeImage">未上传</div>
  135. <b v-if='user.userspace.validCode === 1 && user.newUserSpace' class="angle" style="float: left;margin-top: .3rem;">——></b>
  136. <div v-if='user.userspace.validCode === 1 && user.newUserSpace'
  137. @click="showImg(user.newUserSpace.businessCodeImage)"
  138. v-show="user.newUserSpace.businessCodeImage" class="new">
  139. 查看附件: <i class="fa fa-eye" style="color:#0076ad"></i></div>
  140. </div>
  141. </div>
  142. <div class="enterprise">
  143. <div class="bind-info">
  144. <span>法定代表人</span>
  145. <div :class="{showAll: user.userspace.validCode != 1}">{{user.userspace.corporation || '-'}}</div>
  146. <div v-if='user.userspace.validCode === 1 && user.newUserSpace' class="new"><b class="angle">——></b>{{user.newUserSpace.corporation || '-'}}</div>
  147. </div>
  148. </div>
  149. <div class="enterprise">
  150. <div class="bind-info">
  151. <span>注册地址</span>
  152. <div :class="{showAll: user.userspace.validCode != 1}">{{user.userspace.regAddress || '-'}}</div>
  153. <div v-if='user.userspace.validCode === 1 && user.newUserSpace' class="new"><b class="angle">——></b>{{user.newUserSpace.regAddress || '-'}}</div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <!--查看大图-->
  160. <div id="image-box" v-if="isShow">
  161. <div class="x-floating-wrap"></div>
  162. <div class="x-floating">
  163. <div id="item-content">
  164. <div class="x-close-wrap" @click="isShow = false"><a href="javascript:void(0);">&times;</a></div>
  165. <div class="img"><img :src="imgUrl"/></div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </template>
  171. <script>
  172. export default {
  173. layout: 'cloud',
  174. middleware: 'authenticated',
  175. data () {
  176. return {
  177. activeTab: 0,
  178. secretMobile: '',
  179. secretEmail: '',
  180. isShow: false,
  181. imgUrl: '',
  182. accountLevel: ''
  183. }
  184. },
  185. computed: {
  186. user () {
  187. let mobile = this.$store.state.option.userInfo.data.content.user.mobile
  188. if (mobile) {
  189. var reg = /^(\d{3})\d{6}(\d{2})$/
  190. this.secretMobile = mobile.replace(reg, '$1******$2')
  191. }
  192. let email = this.$store.state.option.userInfo.data.content.user.email
  193. if (email) {
  194. let getEmailIndex = email.indexOf('@')
  195. if (getEmailIndex > 3) {
  196. let len = email.substring(3, getEmailIndex)
  197. this.secretEmail = email.replace(len, '*')
  198. } else {
  199. this.getEmailArr = email.split('')
  200. this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
  201. this.secretEmail = this.getEmailArr.join('')
  202. }
  203. }
  204. return this.$store.state.option.userInfo.data.content
  205. }
  206. },
  207. filters: {
  208. time: function (time) {
  209. if (typeof time === 'number') {
  210. if (!time) {
  211. return '无'
  212. } else {
  213. let d = new Date(time)
  214. let year = d.getFullYear()
  215. let month = d.getMonth() + 1
  216. let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  217. let hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
  218. let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes()
  219. let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : '' + d.getSeconds()
  220. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
  221. }
  222. }
  223. }
  224. },
  225. mounted () {
  226. // 获取账号等级
  227. this.$nextTick(() => {
  228. this.showLevel()
  229. })
  230. // 省略显示
  231. let ele = document.getElementsByClassName('tipText1')[0]
  232. let txt = ele.innerHTML
  233. if (txt.length > 30) {
  234. ele.innerText = txt.slice(0, 35) + ' ...'
  235. } else {
  236. ele.innerText = txt
  237. }
  238. let ele1 = document.getElementsByClassName('tipText2')[0]
  239. let txt1 = ele1.innerHTML
  240. if (txt1.length > 30) {
  241. ele1.innerText = txt1.slice(0, 35) + ' ...'
  242. } else {
  243. ele1.innerText = txt1
  244. }
  245. },
  246. methods: {
  247. showImg (imgUrl) {
  248. this.imgUrl = imgUrl
  249. this.isShow = true
  250. },
  251. showLevel () {
  252. var totle = !!(this.user.user.identityValidCode === 2) + !!(this.user.user.hasQuestion) + !!(this.user.user.mobileValidCode === 2) + !!(this.user.user.passwordLevel >= 2) + !!(this.user.user.emailValidCode === 2)
  253. if (totle === 0 || totle === 1 || totle === 2) {
  254. this.accountLevel = 0
  255. } else if (totle === 3 || totle === 4) {
  256. this.accountLevel = 1
  257. } else {
  258. this.accountLevel = 2
  259. }
  260. }
  261. }
  262. }
  263. </script>
  264. <style scoped type="text/scss" lang="scss">
  265. .cloud-info {
  266. margin: 0 auto;
  267. padding: 0;
  268. padding-bottom: 1rem;
  269. width: 100%;
  270. text-align: center;
  271. background: #eaeaea;
  272. .box-header {
  273. width: 100%;
  274. height: 1.2rem;
  275. line-height: 1.2rem;
  276. font-size: .4rem;
  277. font-weight: bold;
  278. color: #3c3c3c;
  279. text-align: center;
  280. img{
  281. margin-right: .2rem;
  282. margin-top: -.08rem;
  283. width: 1.2rem;
  284. height: .4rem;
  285. }
  286. }
  287. .w-over-box {
  288. width: 100%;
  289. background: #fff;
  290. .basic-nav{
  291. width: 100%;
  292. height: 1.3rem;
  293. line-height: 1.3rem;
  294. span{
  295. display: inline-block;
  296. font-size: .34rem;
  297. color: #a0a0a0;
  298. width: 49%;
  299. text-align: center;
  300. &.active,&:hover{
  301. color: #000;
  302. background: #f5f5f5;
  303. }
  304. }
  305. }
  306. }
  307. .w-over-box .basic-info i.man{
  308. display: inline-block;
  309. position: relative;
  310. margin-right: .08rem;
  311. width: .3rem;
  312. height: .3rem;
  313. background: url(/img/over_account/man.png) no-repeat;
  314. }
  315. .w-over-box .basic-info i.enterprise-img{
  316. display: inline-block;
  317. position: relative;
  318. margin-right: .08rem;
  319. width: .3rem;
  320. height: .3rem;
  321. background: url(/img/over_account/enter.png) no-repeat;
  322. float: left;
  323. margin-top: .5rem;
  324. }
  325. .w-over-box .basic-info{
  326. width: 100%;
  327. background: #fff;
  328. b.angle{
  329. margin: 0 .1rem;
  330. font-weight: normal;
  331. color: #000;
  332. float: left;
  333. }
  334. .new {
  335. color: #2ab300 !important ;
  336. }
  337. .basic-top{
  338. padding: 0 .3rem;
  339. width: 100%;
  340. height: 1.25rem;
  341. line-height: 1.25rem;
  342. div.line{
  343. overflow: hidden;
  344. border-bottom: 2px solid #e5e5e5;
  345. div.people{
  346. float: left;
  347. width: 1.6rem;
  348. overflow: hidden;
  349. text-overflow: ellipsis;
  350. white-space: nowrap;
  351. em{
  352. font-style: normal;
  353. font-size: .32rem;
  354. color: #000;
  355. }
  356. em.user{
  357. float: none;
  358. }
  359. }
  360. div.enter{
  361. width: 100%;
  362. text-align: left;
  363. overflow: hidden;
  364. white-space: nowrap;
  365. text-overflow: ellipsis;
  366. em{
  367. font-style: normal;
  368. font-size: .32rem;
  369. color: #000;
  370. }
  371. }
  372. div.enterprise {
  373. width: 100%;
  374. text-align: left;
  375. em{
  376. display: inline-block;
  377. font-style: normal;
  378. font-size: .32rem;
  379. color: #000;
  380. max-width: 1.5rem;
  381. overflow: hidden;
  382. text-overflow: ellipsis;
  383. white-space: nowrap;
  384. float: left;
  385. }
  386. }
  387. div.time{
  388. float: right;
  389. span{
  390. font-size: .24rem;
  391. color: #a0a0a0;
  392. }
  393. }
  394. }
  395. em.new{
  396. color: #2ab300;
  397. }
  398. }
  399. .basic-bottom{
  400. width: 100%;
  401. padding: .38rem 0;
  402. .item{
  403. height: 2.3rem;
  404. overflow: hidden;
  405. &:nth-child(1){
  406. margin-bottom: .85rem;
  407. height: auto;
  408. line-height: inherit;
  409. }
  410. .item-list{
  411. padding: 0 .3rem;
  412. width: 100%;
  413. overflow: hidden;
  414. .pwd-level{
  415. float: left;
  416. width: 2rem;
  417. height: .44rem;
  418. line-height: .44rem;
  419. text-align: center;
  420. font-size: .26rem;
  421. color: #797979;
  422. background: #eee;
  423. }
  424. .pwd{
  425. float: left;
  426. em{
  427. display: inline-block;
  428. margin: 0 0.08rem 0.02rem 0;
  429. width: .48rem;
  430. height: .1rem;
  431. &:first-child{
  432. margin-left: .3rem;
  433. }
  434. }
  435. span{
  436. margin-left: .2rem;
  437. font-weight: bold;
  438. font-size: .26rem;
  439. }
  440. }
  441. .pwd.sm{
  442. color: #8c8c8c;
  443. em {
  444. background: #bfbfbf;
  445. &:first-child{
  446. background: #ff4e00;
  447. }
  448. }
  449. span{
  450. color: #ff4e00;
  451. }
  452. }
  453. .pwd.md{
  454. color: #8c8c8c;
  455. em {
  456. background: #22ac38;
  457. &:nth-child(3){
  458. background: #bfbfbf;
  459. }
  460. }
  461. span{
  462. color: #22ac38;
  463. }
  464. }
  465. .pwd.lar{
  466. color: #8c8c8c;
  467. em {
  468. background: #00a0e9;
  469. }
  470. span{
  471. color: #00a0e9;
  472. }
  473. }
  474. }
  475. }
  476. .items{
  477. &:hover{
  478. background: #eaf4f9;
  479. }
  480. .bind-tip {
  481. padding-bottom: .4rem;
  482. border-bottom: 1px solid #ddd;
  483. }
  484. .bind-name{
  485. margin: 0 0 .45rem;
  486. text-align: left;
  487. span{
  488. font-size: .3rem;
  489. color: #000;
  490. }
  491. img{
  492. margin-left: .3rem;
  493. margin-top: -0.06rem;
  494. width: .35rem;
  495. height: .3rem;
  496. }
  497. }
  498. .bind-tip{
  499. overflow: hidden;
  500. span {
  501. word-break: break-all;
  502. display: -webkit-box;
  503. -webkit-line-clamp: 2;
  504. -webkit-box-orient: vertical;
  505. overflow: hidden;
  506. float: left;
  507. display: inline-block;
  508. width: 5rem;
  509. line-height: .46rem;
  510. text-align: left;
  511. font-size: .26rem;
  512. color: #b4b4b4;
  513. }
  514. span.tip-text {
  515. overflow : hidden;
  516. text-overflow: ellipsis;
  517. display: -webkit-box;
  518. -webkit-line-clamp: 2;
  519. -webkit-box-orient: vertical;
  520. }
  521. a{
  522. float: right;
  523. font-size: .26rem;
  524. color: #a0a0a0;
  525. }
  526. a.go-btn{
  527. color: #0076ad;
  528. }
  529. a.wait-btn{
  530. color: #9f9f9f;
  531. }
  532. }
  533. &:nth-child(6) {
  534. .bind-tip {
  535. border-bottom: none;
  536. }
  537. }
  538. &:nth-child(3) {
  539. .bind-tip {
  540. padding-bottom: .8rem;
  541. }
  542. }
  543. }
  544. }
  545. /* 管理员*/
  546. .enterprise-bottom{
  547. padding: 0 .3rem;
  548. width: 100%;
  549. .enterprise{
  550. padding: .35rem 0 .3rem 0;
  551. height: 1.75rem;
  552. overflow: hidden;
  553. border-bottom: 1px solid #ddd;
  554. &:nth-child(6){
  555. border-bottom: none;
  556. }
  557. .bind-info{
  558. float: left;
  559. text-align: left;
  560. width: 4.6rem;
  561. span{
  562. display: inline-block;
  563. width: 100%;
  564. font-size: .26rem;
  565. color: #000;
  566. }
  567. div{
  568. margin-top: .3rem;
  569. max-width: 2rem;
  570. white-space: nowrap;
  571. text-overflow: ellipsis;
  572. overflow: hidden;
  573. text-align: left;
  574. font-size: .26rem;
  575. color: #b4b4b4;
  576. float: left;
  577. }
  578. div.showAll{
  579. width: 100%;
  580. overflow: visible;
  581. }
  582. .new {
  583. max-width: 2.6rem;
  584. color: #2ab300 !important ;
  585. }
  586. }
  587. .bind-detail{
  588. float: right;
  589. margin-top: .3rem;
  590. a{
  591. font-size: .26rem;
  592. color: #0076ad;
  593. }
  594. i{
  595. font-size: .26rem;
  596. font-style: normal;
  597. color: #0076ad;
  598. }
  599. }
  600. }
  601. }
  602. }
  603. }
  604. </style>