dangerarearesidentfamilylist.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. <uni-card v-if="item.isHouseholder" title="户主" :is-shadow="false">
  22. <view class="list-item-block">
  23. <view class="line">
  24. <uni-icons class="input-uni-icon" type="person" size="18" color="orangered" />
  25. <text class="content">{{item.personName}}</text>
  26. </view>
  27. <view class="line">
  28. <uni-icons class="input-uni-icon" type="phone" size="18" color="orangered" />
  29. <text class="content">{{item.personId}}</text>
  30. </view>
  31. </view>
  32. </uni-card>
  33. <uni-card v-else title="家庭成员" :is-shadow="false">
  34. <view class="list-item-block">
  35. <view class="line">
  36. <uni-icons class="input-uni-icon" type="person" size="18" color="orangered" />
  37. <text class="content">{{item.personName}}</text>
  38. </view>
  39. <view class="line">
  40. <uni-icons class="input-uni-icon" type="phone" size="18" color="orangered" />
  41. <text class="content">{{item.personId}}</text>
  42. </view>
  43. </view>
  44. </uni-card>
  45. </template>
  46. </uni-list-item>
  47. </uni-list>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import http from '@/http/api.js';
  53. export default {
  54. components: {},
  55. onLoad(option) {
  56. this.query = {};
  57. this.query['personId'] = option.personId;
  58. this.getList();
  59. },
  60. data() {
  61. return {
  62. title: '家庭成员表',
  63. list: [],
  64. query: {},
  65. }
  66. },
  67. computed: {},
  68. onShow() {},
  69. methods: {
  70. toBack() {
  71. uni.navigateBack({
  72. delta: 1
  73. })
  74. },
  75. getList(params = {}) {
  76. let postData = Object.assign(params, this.query);
  77. let that = this;
  78. http.request({
  79. url: '/galaxy-business/yj/resident/family/list',
  80. method: 'GET',
  81. data: postData,
  82. }).then(res => {
  83. if (res.data != null) {
  84. that.list = res.data;
  85. // that.list = res.data.map(item => {
  86. // let id = item.personId.replace(/^(\d{6})\d+(\d{4})$/, '$1******$2')
  87. // return {
  88. // 'id': item.id,
  89. // 'isHouseholder':item.isHouseholder,
  90. // 'personName':item.personName,
  91. // 'personId':id
  92. // }
  93. // })
  94. }
  95. }).catch(err => {
  96. console.log(err)
  97. })
  98. },
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. </style>