shxxList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view>
  3. <uni-card>
  4. <uni-search-bar :radius="100" @confirm="search" placeholder="请输入证件号或手机号搜索" v-model="form.lrZjhm"></uni-search-bar>
  5. <uni-list>
  6. <uni-list-item v-for="(item,index) in dataList" :key="index" :title="item.lrXm"
  7. :thumb="item.lrTx?config.baseUrl+item.lrTx:config.baseUrl + config.head" :note="item.sqyy" thumbSize="lg" :showArrow="false">
  8. <template v-slot:footer>
  9. <view v-if="item.spjg == '0'" class="item-right">
  10. <text>{{item.sqsj.substring(0,8) }}</text>
  11. <image class="item-img" src="@/static/images/tongguo.png" mode=""></image>
  12. </view>
  13. <view v-else-if="item.spjg == '1'" class="item-right">
  14. <text>{{item.sqsj.substring(0,8) }}</text>
  15. <image class="item-img" src="@/static/images/jujue.png" mode=""></image>
  16. </view>
  17. <view v-else class="item-right">
  18. <text>{{item.sqsj.substring(0,8) }}</text>
  19. <image class="item-img" src="@/static/images/daishenhe.png" mode=""></image>
  20. </view>
  21. </template>
  22. </uni-list-item>
  23. </uni-list>
  24. <uni-load-more status="status" @clickLoadMore="clickLoadMore"></uni-load-more>
  25. </uni-card>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. getToken,
  31. getUser
  32. } from '@/common/auth.js'
  33. import {
  34. ListKhjbxx,
  35. ListKhShxx
  36. } from '@/api/kh.js'
  37. import {
  38. decryptRowData_ECB
  39. } from '@/common/sm4.js'
  40. export default {
  41. components: {},
  42. data() {
  43. return {
  44. status: 'more',
  45. form: {
  46. pageNum: 1,
  47. pageSize: 10,
  48. lrId: ''
  49. },
  50. dataList: [],
  51. total: 0,
  52. }
  53. },
  54. mounted() {
  55. this.userInfo = getUser()
  56. // if (this.userInfo.userType == '07') {
  57. // this.info(this.userInfo.userId)
  58. // } else {
  59. // this.form.createUserId = this.userInfo.userId
  60. // }
  61. if(this.userInfo.userType !== '00'){
  62. this.form.createUserId = this.userInfo.userId
  63. }
  64. this.getList()
  65. },
  66. created() {},
  67. onLoad: function(options) {
  68. this.form.lrId = options.lrId
  69. },
  70. onPullDownRefresh() {
  71. this.dataList = []
  72. this.form.pageNum = 1
  73. this.form.pageSize = 10
  74. this.getList()
  75. },
  76. onReachBottom() {
  77. if (this.dataList.length < this.total) {
  78. this.form.pageNum += 1
  79. this.getList()
  80. }
  81. },
  82. methods: {
  83. search() {
  84. this.dataList = []
  85. this.form.pageNum = 1
  86. this.form.pageSize = 10
  87. this.getList()
  88. },
  89. clickLoadMore(e) {
  90. this.status = 'loading'
  91. if (this.dataList.length < this.total) {
  92. this.form.pageNum += 1
  93. this.getList()
  94. } else {
  95. this.status = 'no-more'
  96. }
  97. },
  98. getList() {
  99. ListKhShxx(this.form).then(res => {
  100. if (res.code == 200) {
  101. this.total = res.total
  102. // let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  103. // "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  104. // "yhzh", "khmc"
  105. // ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  106. let list = res.rows
  107. this.dataList.push(...list)
  108. uni.stopPullDownRefresh();
  109. if (this.dataList.length < this.total) {
  110. this.status = 'more'
  111. } else if (this.dataList.length == this.total) {
  112. this.status = 'no-more'
  113. }
  114. }
  115. })
  116. }
  117. },
  118. watch: {},
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .item-right {
  123. width: 60px;
  124. display: flex;
  125. flex-direction: column;
  126. background-position: left;
  127. background-size: 58px 58px;
  128. background-repeat: no-repeat;
  129. position: relative;
  130. font-size: 14px;
  131. .item-img {
  132. position: absolute;
  133. right: -5px;
  134. bottom: -10px;
  135. height: 40px;
  136. width: 40px;
  137. }
  138. }
  139. </style>