gf-tel.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="gf-tel">
  3. <u-popup v-model="showchatlist" mode="center" border-radius="20" :closeable="true">
  4. <view class="chat-list">
  5. <view class="worker-hrader">
  6. <text>隐私电话</text>
  7. </view>
  8. <scroll-view scroll-y="true" style="height: 60vh;" v-if="worker_list.length > 0">
  9. <view class="worker-item u-flex" v-for="(item,index) in worker_list" :key="index" @click="totel(item)">
  10. <image :src="item.headimg" class="img1" mode=""></image>
  11. <text class="text1 u-flex-1">{{item.name}}</text>
  12. <u-icon name="phone-fill" color="#1677FF" size="40"></u-icon>
  13. </view>
  14. </scroll-view>
  15. <view v-else style="height: 60vh;">
  16. <u-empty text="暂无数据" mode="list"></u-empty>
  17. </view>
  18. </view>
  19. </u-popup>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. id: '',
  27. showchatlist: false,
  28. worker_list: []
  29. }
  30. },
  31. created() {
  32. },
  33. methods: {
  34. totel(item) {
  35. uni.showLoading({
  36. mask: true,
  37. title: "请稍后"
  38. })
  39. this.$u.post('/api/Member/bind_worker', {
  40. worker_id: item.id
  41. }).then(res => {
  42. if (res.code == 1) {
  43. this.showchatlist = false
  44. this.$emit('over')
  45. this.$u.post('/api/Member/member_info').then(res => {
  46. uni.makePhoneCall({
  47. phoneNumber: res.data.worker_phone
  48. })
  49. })
  50. } else {
  51. this.$u.toast(res.msg)
  52. }
  53. })
  54. },
  55. getdata(type) {
  56. if (type == 2) {
  57. // 福利
  58. this.$u.post('/api/welfare/welfare_detail', {
  59. id: this.id
  60. }).then(res => {
  61. this.worker_list = res.data.worker_info
  62. this.showchatlist = true
  63. })
  64. } else {
  65. // 楼盘
  66. this.$u.post('/api/Property/property_detail', {
  67. id: this.id
  68. }).then(res => {
  69. this.worker_list = res.data.worker_info
  70. this.showchatlist = true
  71. })
  72. }
  73. },
  74. open(id, type) {
  75. this.id = id
  76. uni.showLoading({
  77. mask: true,
  78. title: "请稍后"
  79. })
  80. this.getdata(type)
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .gf-tel {
  87. .chat-list {
  88. width: 650rpx;
  89. background: #FFFFFF;
  90. padding: 1rpx 0;
  91. .worker-hrader {
  92. line-height: 88rpx;
  93. border-bottom: 2rpx solid #E5E5E5;
  94. padding: 0 24rpx;
  95. font-size: 28rpx;
  96. font-family: PingFangSC-Regular, PingFang SC;
  97. font-weight: 400;
  98. color: #333333;
  99. }
  100. .worker-item {
  101. margin: 24rpx auto;
  102. width: 602rpx;
  103. height: 140rpx;
  104. background: #F2F2F2;
  105. border-radius: 20rpx;
  106. padding: 0 20rpx;
  107. .img1 {
  108. width: 100rpx;
  109. height: 100rpx;
  110. border-radius: 100rpx;
  111. }
  112. .text1 {
  113. font-size: 28rpx;
  114. font-family: PingFangSC-Medium, PingFang SC;
  115. font-weight: 500;
  116. color: #333333;
  117. margin: 0 20rpx;
  118. }
  119. }
  120. }
  121. }
  122. </style>