index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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" @click="showLevel">账号安全等级</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 || user.user.passwordLevel === 3" 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.userspace.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. }
  240. }
  241. }
  242. </script>
  243. <style scoped type="text/scss" lang="scss">
  244. .info{
  245. padding:50px 0 112px 30px;
  246. background:#eee;
  247. }
  248. .w-over-box .basic-nav{
  249. margin: 0 auto 15px;
  250. padding: 0 245px;
  251. width: 1200px;
  252. height: 70px;
  253. line-height: 70px;
  254. text-align: center;
  255. background: #fff;
  256. span{
  257. position: relative;
  258. font-size: 20px;
  259. color: #8c8c8c;
  260. cursor: pointer;
  261. &:nth-child(1){
  262. float: left;
  263. }
  264. &:nth-child(2){
  265. float: right;
  266. }
  267. em{
  268. &:after{
  269. content: '';
  270. position: absolute;
  271. bottom: 0;
  272. left: 30px;
  273. width: 52px;
  274. height: 6px;
  275. background: transparent ;
  276. }
  277. }
  278. &:hover,&.active{
  279. color: #000;
  280. em {
  281. &:after{
  282. background: #0076ad;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .w-over-box .basic-info i.man{
  289. display:inline-block;
  290. position:relative;
  291. top:5px;
  292. width:30px;
  293. height:20px;
  294. background: url('/img/over_account/man.png') no-repeat;
  295. }
  296. .w-over-box .basic-info i.enterprise-img{
  297. display:inline-block;
  298. position:relative;
  299. top:5px;
  300. width:30px;
  301. height:20px;
  302. background: url('/img/over_account/enter.png') no-repeat;
  303. }
  304. .w-over-box .basic-info p{
  305. font-weight: bold;
  306. font-size: 14px;
  307. color:#000;
  308. margin:0;
  309. }
  310. .w-over-box .basic-info span{
  311. font-size: 14px;
  312. color:#787878;
  313. }
  314. .w-over-box .basic-info{
  315. width: 1200px;
  316. background: #fff;
  317. b.angle{
  318. margin: 0 10px;
  319. font-weight: normal;
  320. color: #000;
  321. }
  322. .new {
  323. color: #2ab300 !important ;
  324. }
  325. .basic-top{
  326. padding: 0 40px;
  327. width: 100%;
  328. height: 70px;
  329. line-height: 70px;
  330. div.line{
  331. overflow: hidden;
  332. border-bottom: 2px solid #e5e5e5;
  333. div.people{
  334. float: left;
  335. margin-right: 30px;
  336. }
  337. div.time{
  338. float: left;
  339. }
  340. }
  341. em{
  342. font-style: normal;
  343. font-size: 18px;
  344. color: #000;
  345. }
  346. em.new{
  347. color: #2ab300;
  348. }
  349. }
  350. .basic-bottom{
  351. width: 100%;
  352. padding: 20px 0;
  353. .item{
  354. height: 60px;
  355. line-height: 60px;
  356. .item-list{
  357. padding: 0 37px;
  358. width: 100%;
  359. overflow: hidden;
  360. .pwd-level{
  361. float: left;
  362. margin: 16px 19px 0 0;
  363. width: 120px;
  364. height: 28px;
  365. line-height: 28px;
  366. text-align: center;
  367. font-size: 14px;
  368. color: #797979;
  369. background: #eee;
  370. }
  371. .pwd{
  372. float: left;
  373. em{
  374. display: inline-block;
  375. margin: 0 8px 2px 0;
  376. width: 24px;
  377. height: 6px;
  378. &:first-child{
  379. margin-left: 10px;
  380. }
  381. }
  382. span{
  383. margin-left: 10px;
  384. font-size: 13px;
  385. }
  386. }
  387. .pwd.sm{
  388. color: #8c8c8c;
  389. em {
  390. background: #bfbfbf;
  391. &:first-child{
  392. background: #ff4e00;
  393. }
  394. }
  395. span{
  396. color: #ff4e00;
  397. }
  398. }
  399. .pwd.md{
  400. color: #8c8c8c;
  401. em {
  402. background: #22ac38;
  403. &:nth-child(3){
  404. background: #bfbfbf;
  405. }
  406. }
  407. span{
  408. color: #22ac38;
  409. }
  410. }
  411. .pwd.lar{
  412. color: #8c8c8c;
  413. em {
  414. background: #00a0e9;
  415. }
  416. span{
  417. color: #00a0e9;
  418. }
  419. }
  420. }
  421. }
  422. .items{
  423. &:hover{
  424. background: #eaf4f9;
  425. }
  426. .bind-name{
  427. float: left;
  428. margin-right: 55px;
  429. img{
  430. margin-right: 15px;
  431. width: 20px;
  432. height: 18px;
  433. }
  434. span{
  435. font-size: 14px;
  436. color: #000;
  437. }
  438. }
  439. .bind-tip{
  440. float: left;
  441. font-size: 14px;
  442. color: #787878;
  443. }
  444. .bind-btn {
  445. float: right;
  446. display: inline-block;
  447. width: 86px;
  448. text-align: center;
  449. font-size: 14px;
  450. color: #0076ad;
  451. }
  452. .go-btn{
  453. margin-top: 15px;
  454. float: right;
  455. display: inline-block;
  456. width: 86px;
  457. text-align: center;
  458. height: 30px;
  459. line-height: 30px;
  460. font-size: 14px;
  461. color: #fff;
  462. background: #0076ad;
  463. }
  464. .wait-btn{
  465. margin-top: 15px;
  466. float: right;
  467. display: inline-block;
  468. width: 86px;
  469. text-align: center;
  470. height: 30px;
  471. line-height: 30px;
  472. font-size: 14px;
  473. color: #8c8c8c;
  474. }
  475. }
  476. }
  477. .enterprise-bottom{
  478. width: 100%;
  479. padding: 38px 0 50px 0;
  480. .enterprise{
  481. margin-bottom: 45px;
  482. padding: 0 37px;
  483. height: 20px;
  484. overflow: hidden;
  485. &:last-child {
  486. margin-bottom: 0;
  487. }
  488. .bind-info{
  489. float: left;
  490. margin-right: 50px;
  491. width: 100px;
  492. font-size: 14px;
  493. color: #000;
  494. }
  495. .bind-detail{
  496. float: left;
  497. font-size: 14px;
  498. color: #787878;
  499. em{
  500. font-style: normal;
  501. font-size: 14px;
  502. color: #787878;
  503. }
  504. a{
  505. margin-left: 25px;
  506. font-size: 14px;
  507. color: #0076ad;
  508. }
  509. span{
  510. font-size: 14px;
  511. color: #0076ad;
  512. }
  513. i{
  514. margin-left: 12px;
  515. font-size: 18px;
  516. color: #000;
  517. cursor: pointer;
  518. }
  519. }
  520. }
  521. }
  522. }
  523. </style>