contact.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="wrap">
  3. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  4. @clickLeft="toBack">
  5. <view class="nav-title">
  6. <text>{{title}}</text>
  7. </view>
  8. </uni-nav-bar>
  9. <view class="container">
  10. <view v-for="(item,index) in list" :key="item.id">
  11. <uni-group :title="item.orgName" margin-top="20">
  12. <uni-table ref="order_table" border stripe type="" emptyText="暂无更多数据">
  13. <uni-tr>
  14. <uni-th width="180" align="center">
  15. <view style="text-align: center;color: black;">姓名</view>
  16. </uni-th>
  17. <uni-th align="center">
  18. <view style="text-align: center;color: black;">联系电话</view>
  19. </uni-th>
  20. </uni-tr>
  21. <uni-tr v-for="person in item.servicePersonVOList" :key="person.id">
  22. <uni-td>
  23. <view style="text-align: center;">{{ person.personName }}</view>
  24. </uni-td>
  25. <uni-td align="center">
  26. <view style="text-align: center;color: cornflowerblue;text-decoration:underline;"
  27. @click="call(person.contactPhone)">{{ person.contactPhone }}</view>
  28. </uni-td>
  29. </uni-tr>
  30. </uni-table>
  31. </uni-group>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import http from '@/http/api.js';
  39. export default {
  40. components: {},
  41. onLoad(option) {
  42. this.getContact();
  43. },
  44. data() {
  45. return {
  46. list: [],
  47. title: '人员通讯录',
  48. desc: '',
  49. tableData: [],
  50. equipmentInspectionTableData: [],
  51. pageSize: 10,
  52. // 当前页
  53. pageCurrent: 1,
  54. // 数据总量
  55. total: 0,
  56. orgId: '',
  57. projectId: '',
  58. projectTree: [],
  59. selectedTreeNode: '',
  60. searchVal: '',
  61. }
  62. },
  63. computed: {},
  64. onShow() {},
  65. methods: {
  66. toBack() {
  67. uni.navigateBack({
  68. delta: 1
  69. })
  70. },
  71. getContact() {
  72. var that = this;
  73. http.request({
  74. url: '/galaxy-business/serviceperson/contact',
  75. method: 'GET',
  76. }).then(res => {
  77. if (res.data != null) {
  78. console.log(JSON.stringify(res.data))
  79. that.list = res.data;
  80. }
  81. }).catch(err => {
  82. console.log(err)
  83. })
  84. },
  85. call(phone) {
  86. console.log(phone)
  87. uni.showModal({
  88. content: '是否需要拨打[' + phone + ']?',
  89. showCancel: true,
  90. success(res) {
  91. if (res.confirm) {
  92. uni.makePhoneCall({
  93. phoneNumber: phone
  94. });
  95. }
  96. }
  97. });
  98. }
  99. }
  100. }
  101. </script>
  102. <style>
  103. </style>
  104. <style lang="scss" scoped>
  105. </style>