index.vue 20 KB

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