dangerarearesidentfamilylist.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!--
  2. * @Title:
  3. * @Description: 家庭成员清单
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-list>
  19. <uni-list-item v-for="item in list" :key="item.id">
  20. <template v-slot:body>
  21. <view class="list-item-block">
  22. <view v-if="item.isHouseholder ===1" class="line">
  23. <text class="text" style="color: blue;">户主</text>
  24. </view>
  25. <view v-else class="line">
  26. <text class="text" style="color: blue;">家庭成员</text>
  27. </view>
  28. <view class="line">
  29. <text class="text text-ellipsis">姓名:{{item.personName}}</text>
  30. </view>
  31. <view class="line">
  32. <text class="text text-ellipsis">手机号:{{item.personId}}</text>
  33. </view>
  34. </view>
  35. </template>
  36. </uni-list-item>
  37. </uni-list>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import http from '@/http/api.js';
  43. export default {
  44. components: {},
  45. onLoad(option) {
  46. this.query = {};
  47. this.query['personId'] = option.personId;
  48. this.getList();
  49. },
  50. data() {
  51. return {
  52. title: '家庭成员表',
  53. list: [],
  54. query: {},
  55. }
  56. },
  57. computed: {},
  58. onShow() {},
  59. methods: {
  60. toBack() {
  61. uni.navigateBack({
  62. delta: 1
  63. })
  64. },
  65. getList(params = {}) {
  66. let postData = Object.assign(params, this.query);
  67. let that = this;
  68. http.request({
  69. url: '/galaxy-business/yj/resident/family/list',
  70. method: 'GET',
  71. data: postData,
  72. }).then(res => {
  73. if (res.data != null) {
  74. that.list = res.data;
  75. // that.list = res.data.map(item => {
  76. // let id = item.personId.replace(/^(\d{6})\d+(\d{4})$/, '$1******$2')
  77. // return {
  78. // 'id': item.id,
  79. // 'isHouseholder':item.isHouseholder,
  80. // 'personName':item.personName,
  81. // 'personId':id
  82. // }
  83. // })
  84. }
  85. }).catch(err => {
  86. console.log(err)
  87. })
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. </style>