concatItem.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="concat-item" @click="handleToUser">
  3. <view class="concat-item-body">
  4. <wk-avatar :name="concatData.realname" :avatar="concatData.img" class="avatar" />
  5. <view class="box">
  6. <view class="name">
  7. {{ concatData.realname }}
  8. </view>
  9. <view class="position">
  10. {{ concatData.post || '--' }}
  11. </view>
  12. </view>
  13. <button class="call" @click.stop="makePhoneCall(concatData.mobile)">
  14. <image
  15. :src="$static('images/icon/call_voice.png')"
  16. alt=""
  17. class="phone-icon" />
  18. </button>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'ConcatItem',
  25. props: {
  26. concatData: {
  27. type: Object,
  28. default: () => {}
  29. }
  30. },
  31. methods: {
  32. makePhoneCall(mobile) {
  33. if (this.$isEmpty(mobile)) {
  34. this.$toast('暂无电话!')
  35. return
  36. }
  37. uni.makePhoneCall({
  38. phoneNumber: mobile
  39. })
  40. },
  41. handleToUser() {
  42. this.$Router.navigateTo({
  43. url: '/pages_personal/user',
  44. query: {
  45. id: this.concatData.userId
  46. }
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .concat-item {
  54. background-color: white;
  55. padding: 0 50rpx;
  56. .concat-item-body {
  57. width: 100%;
  58. padding: 23rpx 0;
  59. border-bottom: 1rpx solid $border-color;
  60. @include left;
  61. .avatar {
  62. width: 70rpx;
  63. height: 70rpx;
  64. margin-right: 26rpx;
  65. }
  66. .box {
  67. flex: 1;
  68. .name {
  69. font-size: 32rpx;
  70. line-height: 42rpx;
  71. color: $dark;
  72. }
  73. .position {
  74. font-size: 26rpx;
  75. line-height: 32rpx;
  76. color: $light;
  77. margin-top: 12rpx;
  78. }
  79. }
  80. .call {
  81. padding: 10rpx 20rpx;
  82. @include center;
  83. .phone-icon {
  84. width: 46rpx;
  85. height: 46rpx;
  86. }
  87. }
  88. }
  89. }
  90. </style>