index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.organizeName}}</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.telePhone || '未填写'" :arrow="false" :title-style="titleStyle">
  28. </u-cell-item>
  29. <u-cell-item title="邮箱" :value="userData.email || '未填写'" :arrow="false" :title-style="titleStyle">
  30. </u-cell-item>
  31. <u-cell-item title="岗位" :value="userData.positionName || '未填写'" :arrow="false"
  32. :title-style="titleStyle">
  33. </u-cell-item>
  34. </u-cell-group>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. getUesrDetail
  41. } from '@/api/common.js'
  42. export default {
  43. data() {
  44. return {
  45. userData: {},
  46. titleStyle: {
  47. color: '#303133'
  48. },
  49. userDetal: {}
  50. }
  51. },
  52. computed: {
  53. baseURL() {
  54. return this.define.baseURL
  55. }
  56. },
  57. onLoad(option) {
  58. let userId = option.userId;
  59. this.getUserDetail(userId)
  60. },
  61. methods: {
  62. getUserDetail(userId) {
  63. getUesrDetail(userId).then(res => {
  64. this.userData = res.data
  65. uni.setNavigationBarTitle({
  66. title: '联系人'
  67. });
  68. })
  69. },
  70. call() {
  71. if (!this.userData.mobilePhone) return
  72. uni.makePhoneCall({
  73. phoneNumber: this.userData.mobilePhone
  74. })
  75. },
  76. toIm() {
  77. const userData = this.userData
  78. const name = userData.realName + '/' + userData.account
  79. uni.$emit('updateMsgNum', userData.id)
  80. uni.navigateTo({
  81. url: '/pages/message/im/index?name=' + name + '&formUserId=' + userData.id + '&headIcon=' +
  82. userData.headIcon
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .userDetail-v {
  90. :deep(.u-cell) {
  91. height: 112rpx;
  92. padding: 0;
  93. .u-cell__value {
  94. color: #606266;
  95. }
  96. }
  97. .userDetail-hd {
  98. height: 482rpx;
  99. background-color: #f0f2f6;
  100. color: #FFFFFF;
  101. align-items: center;
  102. }
  103. .name {
  104. // font-weight: 700;
  105. color: #303133;
  106. }
  107. .positionName {
  108. color: #909399;
  109. }
  110. .userDetail-hd-btn {
  111. .btn {
  112. width: 84rpx;
  113. height: 84rpx;
  114. border: 2rpx solid #606266;
  115. border-radius: 50%;
  116. text-align: center;
  117. line-height: 80rpx;
  118. color: #606266;
  119. }
  120. }
  121. }
  122. </style>