list.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. :to="'/pages/lr/info?id='+ item.id"
  8. :thumb="item.lrTx?config.baseUrl+item.lrTx:config.baseUrl + config.head" :note="item.lrCydh" thumbSize="lg" :showArrow="false">
  9. <template v-slot:footer>
  10. <view v-if="item.lzzt == '0'"
  11. style="width: 60px;display: flex;flex-direction: column;background-image: url('../../static/images/caogao.png');background-position: left;background-size:58px 58px;background-repeat: no-repeat;">
  12. <text v-if="item.updateTime">{{item.updateTime.substring(0,8) }}</text>
  13. <text v-else>{{item.createTime.substring(0,8) }}</text>
  14. <text>{{item.lrSpyj || '无'}}</text>
  15. </view>
  16. <view v-else-if="item.lzzt == '1' || item.lzzt == '2' || item.lzzt == '5'|| item.lzzt == '7'"
  17. style="width: 60px;display: flex;flex-direction: column;background-image: url('../../static/images/daishenhe.png');background-position: left;background-size:58px 58px;background-repeat: no-repeat;">
  18. <text v-if="item.updateTime">{{item.updateTime.substring(0,8) }}</text>
  19. <text v-else>{{item.createTime.substring(0,8) }}</text>
  20. <text>{{item.lrSpyj || '无'}}</text>
  21. </view>
  22. <view v-else-if="item.lzzt == '3'"
  23. style="width: 60px;display: flex;flex-direction: column;background-image: url('../../static/images/tongguo.png');background-position: left;background-size:58px 58px;background-repeat: no-repeat;">
  24. <text v-if="item.updateTime">{{item.updateTime.substring(0,8) }}</text>
  25. <text v-else>{{item.createTime.substring(0,8) }}</text>
  26. <text>{{item.lrSpyj || '无'}}</text>
  27. </view>
  28. <view v-else-if="item.lzzt == '4'"
  29. style="width: 60px;display: flex;flex-direction: column;background-image: url('../../static/images/jujue.png');background-position: left;background-size:58px 58px;background-repeat: no-repeat;">
  30. <text v-if="item.updateTime">{{item.updateTime.substring(0,8) }}</text>
  31. <text v-else>{{item.createTime.substring(0,8) }}</text>
  32. <text>{{item.lrSpyj || '无'}}</text>
  33. </view>
  34. </template>
  35. </uni-list-item>
  36. </uni-list>
  37. <uni-load-more status="status" @clickLoadMore="clickLoadMore"></uni-load-more>
  38. </uni-card>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. getToken,
  44. getUser
  45. } from '@/common/auth.js'
  46. import {
  47. ListKhjbxx
  48. } from '@/api/kh.js'
  49. import {
  50. decryptRowData_ECB
  51. } from '@/common/sm4.js'
  52. export default {
  53. components: {},
  54. data() {
  55. return {
  56. status: 'more',
  57. form: {
  58. pageNum: 1,
  59. pageSize: 10,
  60. // createUserId: ''
  61. },
  62. dataList: [],
  63. total: 0,
  64. }
  65. },
  66. mounted() {
  67. this.userInfo = getUser()
  68. if (this.userInfo.userType != '07') {
  69. // this.form.createUserId = this.userInfo.userId
  70. }
  71. this.getList()
  72. },
  73. created() {},
  74. onLoad: function(options) {
  75. // setTimeout(function() {
  76. // console.log('start pulldown');
  77. // }, 1000);
  78. // uni.startPullDownRefresh();
  79. },
  80. onPullDownRefresh() {
  81. this.dataList = []
  82. this.form.pageNum = 1
  83. this.form.pageSize = 10
  84. this.getList()
  85. },
  86. onReachBottom() {
  87. if (this.dataList.length < this.total) {
  88. this.form.pageNum += 1
  89. this.getList()
  90. }
  91. },
  92. methods: {
  93. search() {
  94. this.dataList = []
  95. this.form.pageNum = 1
  96. this.form.pageSize = 10
  97. this.getList()
  98. },
  99. clickLoadMore(e) {
  100. this.status = 'loading'
  101. if (this.dataList.length < this.total) {
  102. this.form.pageNum += 1
  103. this.getList()
  104. } else {
  105. this.status = 'no-more'
  106. }
  107. },
  108. getList() {
  109. ListKhjbxx(this.form).then(res => {
  110. if (res.code == 200) {
  111. this.total = res.total
  112. let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  113. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  114. "yhzh", "khmc"
  115. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  116. this.dataList.push(...list)
  117. uni.stopPullDownRefresh();
  118. if (this.dataList.length < this.total) {
  119. this.status = 'more'
  120. } else if (this.dataList.length == this.total) {
  121. this.status = 'no-more'
  122. }
  123. }
  124. })
  125. }
  126. },
  127. watch: {},
  128. }
  129. </script>
  130. <style>
  131. </style>