You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
1.8 KiB

  1. <template>
  2. <view class="page">
  3. <view class="bg">
  4. <view class="info">
  5. <img :src="avatar" class="avatar" />
  6. <view class="infotext">
  7. <view class="text-xl">{{ currentUser.realName }}</view>
  8. <l-tag line="green">{{ userTag }}</l-tag>
  9. </view>
  10. </view>
  11. <view class="qrcode"><tki-qrcode :val="qrCodeValue" :size="550" loadMake /></view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. qrCodeValue: 'http://www.learun.cn/'
  20. }
  21. },
  22. computed: {
  23. // 当前用户对象
  24. currentUser() {
  25. return this.GET_GLOBAL('loginUser')
  26. },
  27. // 头像图片 url
  28. avatar() {
  29. return this.API + `/learun/adms/user/img?data=${this.currentUser.userId}`
  30. },
  31. // 用户公司部门 tag
  32. userTag() {
  33. const { companyId, departmentId } = this.currentUser
  34. if (!companyId) {
  35. return `总集团公司`
  36. }
  37. const company = this.GET_GLOBAL('company')
  38. const dep = this.GET_GLOBAL('department')
  39. const companyName = company[companyId].name
  40. if (!dep) {
  41. return companyName
  42. }
  43. return `${companyName} / ${dep[departmentId].name}`
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="less" scoped>
  49. .page {
  50. background-color: #2f2d2d;
  51. position: absolute;
  52. display: flex;
  53. justify-content: center;
  54. align-items: center;
  55. bottom: 0;
  56. top: 0;
  57. right: 0;
  58. left: 0;
  59. .bg {
  60. background: #ffffff;
  61. border-radius: 5px;
  62. padding: 20rpx;
  63. display: inline-block;
  64. .info {
  65. display: flex;
  66. align-items: center;
  67. margin-bottom: 10px;
  68. .avatar {
  69. width: 120rpx;
  70. height: 120rpx;
  71. margin-right: 15px;
  72. border-radius: 2px;
  73. }
  74. .infotext > view {
  75. margin-bottom: 10px;
  76. }
  77. }
  78. }
  79. }
  80. </style>