people.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="people">
  3. <div class="people-content">
  4. <!-- <van-radio-group v-model="radio"> -->
  5. <div class="people-item" v-for="item in people.peopleList" :key="item.id" @click="contactPeople(item)">
  6. <div class="people-item-left">
  7. <img :src="item.avatar" alt="">
  8. <div>
  9. <div class="flex a-i-c">
  10. <div class="people-item-nickName">{{item.repairName}}</div>
  11. <div class="people-item-city"><van-icon name="location" />{{item.location}}</div>
  12. </div>
  13. <div class="skills">范围:{{item.repairScope}}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. // import wx from 'weixin-js-sdk'
  22. export default {
  23. data () {
  24. return {
  25. people: {
  26. peopleList: []
  27. }
  28. }
  29. },
  30. methods: {
  31. /**
  32. * 查询维修人员列表
  33. */
  34. // async getRepairMan () {
  35. // let {list} = await this.postHttps('manage/emp/queryRepairMan',{reqdata:{type:1}})
  36. // this.$set(this.people,'peopleList',list)
  37. // },
  38. getRepairMan () {
  39. this.postHttps('manage/emp/queryRepairMan', { reqdata: { type: 1 } }).then(r => {
  40. this.$set(this.people, 'peopleList', r.list)
  41. })
  42. },
  43. /**
  44. * 打开用户名片
  45. * @param item 用户信息
  46. */
  47. contactPeople ({ repairWxUserId }) {
  48. alert(repairWxUserId)
  49. alert(JSON.stringify(window.wx))
  50. window.wx.invoke('openUserProfile', {
  51. 'type': 1, // 1表示该userid是企业成员,2表示该userid是外部联系人
  52. 'userid': repairWxUserId // 可以是企业成员,也可以是外部联系人
  53. }, (res) => {
  54. alert(JSON.stringify(res))
  55. if (res.err_msg !== 'openUserProfile:ok') {
  56. // 错误处理
  57. this.Toast({
  58. message: '无此联系人!'
  59. })
  60. }
  61. })
  62. }
  63. },
  64. created () {
  65. this.getRepairMan()
  66. }
  67. }
  68. </script>