index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="userDetail-v">
  3. <view class="userDetail-hd u-flex-col">
  4. <view class="u-m-t-60">
  5. <u-avatar :src="define.baseURL+userData.headIcon" size="120"></u-avatar>
  6. </view>
  7. <view class="u-m-t-32 u-font-32 name">
  8. <text>{{userData.realName}}/{{userData.account}}</text>
  9. </view>
  10. <view class="u-m-t-20 u-font-24 positionName">
  11. <text>{{userData.organize}}</text>
  12. </view>
  13. <view class="u-m-t-32 u-flex userDetail-hd-btn">
  14. <view class="u-m-r-40 btn" @click="call()">
  15. <text class="ym-custom ym-custom-phone u-font-40" />
  16. </view>
  17. <view class="u-m-l-40 btn" @click="toIm()">
  18. <text class="ym-custom ym-custom-comment u-font-40" />
  19. </view>
  20. </view>
  21. </view>
  22. <view class="u-p-l-20 u-p-r-20">
  23. <u-cell-group>
  24. <u-cell-item title="手机号" :value="userData.mobilePhone || '未填写'" :arrow="false"
  25. :title-style="titleStyle">
  26. </u-cell-item>
  27. <u-cell-item title="邮箱" :value="userData.email || '未填写'" :arrow="false" :title-style="titleStyle">
  28. </u-cell-item>
  29. <u-cell-item title="岗位" :value="userData.position || '未填写'" :arrow="false" :title-style="titleStyle">
  30. </u-cell-item>
  31. </u-cell-group>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. getUesrDetail
  38. } from '@/api/common.js'
  39. export default {
  40. data() {
  41. return {
  42. userData: {},
  43. titleStyle: {
  44. color: '#303133'
  45. },
  46. }
  47. },
  48. computed: {
  49. baseURL() {
  50. return this.define.baseURL
  51. }
  52. },
  53. onLoad(e) {
  54. this.userData = JSON.parse(decodeURIComponent(e.data))
  55. },
  56. methods: {
  57. call() {
  58. if (!this.userData.mobilePhone) return
  59. uni.makePhoneCall({
  60. phoneNumber: this.userData.mobilePhone
  61. })
  62. },
  63. toIm() {
  64. const userData = this.userData
  65. const name = userData.realName + '/' + userData.account
  66. uni.$emit('updateMsgNum', userData.id)
  67. uni.navigateTo({
  68. url: '/pages/message/im/index?name=' + name + '&formUserId=' + userData.id + '&headIcon=' +
  69. userData.headIcon
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style lang="scss">
  76. .userDetail-v {
  77. :deep(.u-cell) {
  78. height: 112rpx;
  79. .u-cell__value {
  80. color: #606266;
  81. white-space: nowrap;
  82. width: 400rpx;
  83. overflow-x: auto;
  84. }
  85. }
  86. :deep(uni-text) {
  87. white-space: nowrap !important;
  88. }
  89. .userDetail-hd {
  90. height: 482rpx;
  91. background-color: #f0f2f6;
  92. color: #FFFFFF;
  93. align-items: center;
  94. }
  95. .name {
  96. // font-weight: 700;
  97. color: #303133;
  98. }
  99. .positionName {
  100. color: #909399;
  101. width: 400rpx;
  102. text-align: center;
  103. white-space: nowrap !important;
  104. overflow: hidden;
  105. text-overflow: ellipsis;
  106. }
  107. .userDetail-hd-btn {
  108. .btn {
  109. width: 84rpx;
  110. height: 84rpx;
  111. border: 2rpx solid #606266;
  112. border-radius: 50%;
  113. text-align: center;
  114. line-height: 80rpx;
  115. color: #606266;
  116. }
  117. }
  118. }
  119. </style>