cloudCenter.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. <template>
  2. <div class="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 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">安全性高的密码可以使账号更安全,建议您定期更换密码,并且设置一个包含数字和字母,长度超过8位以上的密码。</span>
  59. <a href="/reset/changePasswordChooseStyle" class="bind-btn" v-show="user.user.passwordLevel === 2 || user.user.passwordLevel === 3">修改</a>
  60. <a href="/reset/changePasswordChooseStyle" 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">是您找回登录密码的方法之一。建议您设置一个容易记住,且最不容易被他人获取的问题及答案。</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="people">
  97. <i class="enterprise-img" style="margin-right: .1rem;"></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>{{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-show="user.userspace.businessCodeImage">附件: 营业执照扫描.jpg</div>
  133. <div v-show="!user.userspace.businessCodeImage">未上传</div>
  134. <!--<b v-if='user.userspace.validCode === 1 && user.newUserSpace' class="angle" style="float: left;">——></b>-->
  135. <!--<div class="new" v-if='user.userspace.validCode === 1 && user.newUserSpace'-->
  136. <!--v-show="user.newUserSpace.businessCodeImage">-->
  137. <!--附件: 营业执照扫描.jpg-->
  138. <!--</div>-->
  139. </div>
  140. <div class="bind-detail"
  141. v-show="user.userspace.businessCodeImage">
  142. <i @click="showImg(user.userspace.businessCodeImage)">查看</i>
  143. </div>
  144. </div>
  145. <div class="enterprise">
  146. <div class="bind-info">
  147. <span>法定代表人</span>
  148. <div>{{user.userspace.corporation || '-'}}</div>
  149. <!--<div v-if='user.userspace.validCode === 1 && user.newUserSpace' class="new"><b class="angle">——></b>{{user.newUserSpace.corporation || '-'}}</div>-->
  150. </div>
  151. </div>
  152. <div class="enterprise">
  153. <div class="bind-info">
  154. <span>注册地址</span>
  155. <div>{{user.userspace.regAddress || '-'}}</div>
  156. <!--<div v-if='user.userspace.validCode === 1 && user.newUserSpace' class="new"><b class="angle">——></b>{{user.newUserSpace.regAddress || '-'}}</div>-->
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. <!--查看大图-->
  163. <div id="image-box" v-if="isShow">
  164. <div class="x-floating-wrap"></div>
  165. <div class="x-floating">
  166. <div id="item-content">
  167. <div class="x-close-wrap" @click="isShow = false"><a href="javascript:void(0);">&times;</a></div>
  168. <div class="img"><img :src="imgUrl"/></div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </template>
  174. <script>
  175. export default {
  176. layout: 'cloud',
  177. middleware: 'authenticated',
  178. data () {
  179. return {
  180. activeTab: 0,
  181. secretMobile: '',
  182. secretEmail: '',
  183. isShow: false,
  184. imgUrl: '',
  185. accountLevel: ''
  186. }
  187. },
  188. computed: {
  189. user () {
  190. let mobile = this.$store.state.option.userInfo.data.content.user.mobile
  191. if (mobile) {
  192. var reg = /^(\d{3})\d{6}(\d{2})$/
  193. this.secretMobile = mobile.replace(reg, '$1******$2')
  194. }
  195. let email = this.$store.state.option.userInfo.data.content.user.email
  196. if (email) {
  197. let getEmailIndex = email.indexOf('@')
  198. if (getEmailIndex > 3) {
  199. let len = email.substring(3, getEmailIndex)
  200. this.secretEmail = email.replace(len, '*')
  201. } else {
  202. this.getEmailArr = email.split('')
  203. this.getEmailSplit = this.getEmailArr.splice(getEmailIndex, 0, '*')
  204. this.secretEmail = this.getEmailArr.join('')
  205. }
  206. }
  207. return this.$store.state.option.userInfo.data.content
  208. }
  209. },
  210. filters: {
  211. time: function (time) {
  212. if (typeof time === 'number') {
  213. if (!time) {
  214. return '无'
  215. } else {
  216. let d = new Date(time)
  217. let year = d.getFullYear()
  218. let month = d.getMonth() + 1
  219. let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  220. let hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
  221. let minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes()
  222. let seconds = d.getSeconds() < 10 ? '0' + d.getSeconds() : '' + d.getSeconds()
  223. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
  224. }
  225. }
  226. }
  227. },
  228. mounted () {
  229. // 获取账号等级
  230. this.$nextTick(() => {
  231. this.showLevel()
  232. })
  233. // 省略显示
  234. let ele = document.getElementsByClassName('tip-text')[0]
  235. let txt = ele.innerHTML
  236. if (txt.length > 30) {
  237. ele.innerText = txt.slice(0, 35) + ' ...'
  238. } else {
  239. ele.innerText = txt
  240. }
  241. let ele1 = document.getElementsByClassName('tip-txt')[0]
  242. let txt1 = ele.innerHTML
  243. if (txt1.length > 30) {
  244. ele1.innerText = txt1.slice(0, 35) + ' ...'
  245. } else {
  246. ele1.innerText = txt1
  247. }
  248. },
  249. methods: {
  250. showImg (imgUrl) {
  251. this.imgUrl = imgUrl
  252. this.isShow = true
  253. },
  254. showLevel () {
  255. 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)
  256. if (totle === 0 || totle === 1 || totle === 2) {
  257. this.accountLevel = 0
  258. } else if (totle === 3 || totle === 4) {
  259. this.accountLevel = 1
  260. } else {
  261. this.accountLevel = 2
  262. }
  263. }
  264. }
  265. }
  266. </script>
  267. <style scoped type="text/scss" lang="scss">
  268. .info {
  269. margin: 0 auto;
  270. padding: 0;
  271. padding-bottom: 1rem;
  272. width: 100%;
  273. text-align: center;
  274. background: #eaeaea;
  275. .box-header {
  276. width: 100%;
  277. height: 1.2rem;
  278. line-height: 1.2rem;
  279. font-size: .4rem;
  280. font-weight: bold;
  281. color: #3c3c3c;
  282. text-align: center;
  283. img{
  284. margin-right: .2rem;
  285. margin-top: -.08rem;
  286. width: 1.2rem;
  287. height: .4rem;
  288. }
  289. }
  290. .w-over-box {
  291. width: 100%;
  292. background: #fff;
  293. .basic-nav{
  294. width: 100%;
  295. height: 1.3rem;
  296. line-height: 1.3rem;
  297. span{
  298. display: inline-block;
  299. font-size: .34rem;
  300. color: #a0a0a0;
  301. width: 50%;
  302. text-align: center;
  303. &.active,&:hover{
  304. color: #000;
  305. background: #f5f5f5;
  306. }
  307. }
  308. }
  309. }
  310. .w-over-box .basic-info i.man{
  311. display:inline-block;
  312. position:relative;
  313. top: 0.06rem;
  314. width: .4rem;
  315. height: .4rem;
  316. background: url('/img/over_account/man.png') no-repeat;
  317. }
  318. .w-over-box .basic-info i.enterprise-img{
  319. display:inline-block;
  320. position:relative;
  321. top: 0.05rem;
  322. width: .4rem;
  323. height: .4rem;
  324. background: url('/img/over_account/enter.png') no-repeat;
  325. }
  326. .w-over-box .basic-info{
  327. width: 100%;
  328. background: #fff;
  329. b.angle{
  330. margin: 0 .1rem;
  331. font-weight: normal;
  332. color: #000;
  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. margin-right: 30px;
  348. em{
  349. font-style: normal;
  350. font-size: .32rem;
  351. color: #000;
  352. }
  353. }
  354. div.time{
  355. float: right;
  356. span{
  357. font-size: .24rem;
  358. color: #a0a0a0;
  359. }
  360. }
  361. }
  362. em.new{
  363. color: #2ab300;
  364. }
  365. }
  366. .basic-bottom{
  367. width: 100%;
  368. padding: .38rem 0;
  369. .item{
  370. height: 2.3rem;
  371. overflow: hidden;
  372. &:nth-child(1){
  373. margin-bottom: .85rem;
  374. height: auto;
  375. line-height: inherit;
  376. }
  377. .item-list{
  378. padding: 0 .3rem;
  379. width: 100%;
  380. overflow: hidden;
  381. .pwd-level{
  382. float: left;
  383. width: 2rem;
  384. height: .44rem;
  385. line-height: .44rem;
  386. text-align: center;
  387. font-size: .26rem;
  388. color: #797979;
  389. background: #eee;
  390. }
  391. .pwd{
  392. float: left;
  393. em{
  394. display: inline-block;
  395. margin: 0 0.08rem 0.02rem 0;
  396. width: .48rem;
  397. height: .1rem;
  398. &:first-child{
  399. margin-left: .3rem;
  400. }
  401. }
  402. span{
  403. margin-left: .2rem;
  404. font-weight: bold;
  405. font-size: .26rem;
  406. }
  407. }
  408. .pwd.sm{
  409. color: #8c8c8c;
  410. em {
  411. background: #bfbfbf;
  412. &:first-child{
  413. background: #ff4e00;
  414. }
  415. }
  416. span{
  417. color: #ff4e00;
  418. }
  419. }
  420. .pwd.md{
  421. color: #8c8c8c;
  422. em {
  423. background: #22ac38;
  424. &:nth-child(3){
  425. background: #bfbfbf;
  426. }
  427. }
  428. span{
  429. color: #22ac38;
  430. }
  431. }
  432. .pwd.lar{
  433. color: #8c8c8c;
  434. em {
  435. background: #00a0e9;
  436. }
  437. span{
  438. color: #00a0e9;
  439. }
  440. }
  441. }
  442. }
  443. .items{
  444. &:hover{
  445. background: #eaf4f9;
  446. }
  447. .bind-tip {
  448. padding-bottom: .4rem;
  449. border-bottom: 1px solid #ddd;
  450. }
  451. .bind-name{
  452. margin: 0 0 .45rem;
  453. text-align: left;
  454. span{
  455. font-size: .3rem;
  456. color: #000;
  457. }
  458. img{
  459. margin-left: .3rem;
  460. margin-top: -0.06rem;
  461. width: .35rem;
  462. height: .3rem;
  463. }
  464. }
  465. .bind-tip{
  466. overflow: hidden;
  467. span {
  468. word-break: break-all;
  469. display: -webkit-box;
  470. -webkit-line-clamp: 2;
  471. -webkit-box-orient: vertical;
  472. overflow: hidden;
  473. float: left;
  474. display: inline-block;
  475. width: 5.5rem;
  476. line-height: .46rem;
  477. text-align: left;
  478. font-size: .26rem;
  479. color: #b4b4b4;
  480. }
  481. span.tip-text {
  482. overflow : hidden;
  483. text-overflow: ellipsis;
  484. display: -webkit-box;
  485. -webkit-line-clamp: 2;
  486. -webkit-box-orient: vertical;
  487. }
  488. a{
  489. float: right;
  490. font-size: .26rem;
  491. color: #a0a0a0;
  492. }
  493. a.go-btn{
  494. color: #0076ad;
  495. }
  496. a.wait-btn{
  497. color: #9f9f9f;
  498. }
  499. }
  500. &:nth-child(6) {
  501. .bind-tip {
  502. border-bottom: none;
  503. }
  504. }
  505. &:nth-child(3) {
  506. .bind-tip {
  507. padding-bottom: .8rem;
  508. }
  509. }
  510. }
  511. }
  512. /* 管理员*/
  513. .enterprise-bottom{
  514. padding: 0 .3rem;
  515. width: 100%;
  516. .enterprise{
  517. padding: .35rem 0 .3rem 0;
  518. height: 1.75rem;
  519. overflow: hidden;
  520. border-bottom: 1px solid #ddd;
  521. &:nth-child(6){
  522. border-bottom: none;
  523. }
  524. .bind-info{
  525. float: left;
  526. text-align: left;
  527. span{
  528. font-size: .26rem;
  529. color: #000;
  530. }
  531. div{
  532. margin-top: .3rem;
  533. width: 5rem;
  534. white-space: nowrap;
  535. text-overflow: ellipsis;
  536. overflow: hidden;
  537. text-align: left;
  538. font-size: .26rem;
  539. color: #b4b4b4;
  540. }
  541. }
  542. .bind-detail{
  543. float: right;
  544. margin-top: .3rem;
  545. a{
  546. font-size: .26rem;
  547. color: #0076ad;
  548. }
  549. i{
  550. font-size: .26rem;
  551. font-style: normal;
  552. color: #0076ad;
  553. }
  554. }
  555. }
  556. }
  557. }
  558. }
  559. </style>