index.vue 18 KB

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