list.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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-swipe-action>
  7. <!-- 刷脸激活:['0','3','4','6','9'];无刷脸激活:['1','2','5','7','8']-->
  8. <uni-swipe-action-item v-for="(item,index) in dataList" :key="index" :right-options="options"
  9. :disabled="['1','2','5','7','8'].includes(item.lzzt)" @click="swipeClick(item.id)">
  10. <uni-list-item :to="'/pages/lr/info?id='+ item.id" :title="item.lrXm"
  11. :thumb="item.lrTx ? config.baseUrl+item.lrTx : config.baseUrl+config.head" :note="item.lrCydh" thumbSize="lg" :showArrow="false">
  12. <template v-slot:footer>
  13. <view v-if="item.lzzt == '0'" class="item-right">
  14. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  15. <text v-else>{{item.createTime.substring(0,8) }}</text>
  16. <image class="item-img" src="@/static/images/caogao.png" mode=""></image>
  17. <!-- <text>{{item.lrSpyj || '无'}}</text> -->
  18. </view>
  19. <view v-else-if="['1','2','5','7','8'].includes(item.lzzt)" class="item-right">
  20. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  21. <text v-else>{{item.createTime.substring(0,8) }}</text>
  22. <image class="item-img" src="@/static/images/daishenhe.png" mode=""></image>
  23. </view>
  24. <view v-else-if="item.lzzt == '3'" class="item-right">
  25. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  26. <text v-else>{{item.createTime.substring(0,8) }}</text>
  27. <image class="item-img" src="@/static/images/tongguo.png" mode=""></image>
  28. </view>
  29. <view v-else-if="item.lzzt == '4' || item.lzzt == '9'" class="item-right">
  30. <text v-if="item.jssj">{{item.jssj.substring(0,8) }}</text>
  31. <text v-else>{{item.createTime.substring(0,8) }}</text>
  32. <image class="item-img" src="@/static/images/jujue.png" mode=""></image>
  33. </view>
  34. </template>
  35. </uni-list-item>
  36. </uni-swipe-action-item>
  37. </uni-swipe-action>
  38. </uni-list>
  39. <uni-load-more status="status" @clickLoadMore="clickLoadMore"></uni-load-more>
  40. </uni-card>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. getToken,
  46. getUser
  47. } from '@/common/auth.js'
  48. import { ListKhjbxx, GetUrl, CheckReturn } 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: 8,
  60. },
  61. dataList: [],
  62. options: [
  63. {
  64. text: '刷脸激活',
  65. style: {
  66. backgroundColor: '#28d87d'
  67. }
  68. }
  69. ],
  70. total: 0,
  71. }
  72. },
  73. onLoad: function(options) {
  74. if (options.id) {
  75. this.form.pageNum = 1
  76. this.form.pageSize = 8
  77. this.form.id = options.id
  78. }
  79. this.userInfo = getUser()
  80. if (['04', '07'].includes(this.userInfo.userType)) {
  81. this.form.createUserId = this.userInfo.userId
  82. }
  83. this.getList()
  84. },
  85. onPullDownRefresh() {
  86. this.dataList = []
  87. this.form.pageNum = 1
  88. this.form.pageSize = 10
  89. if (this.userInfo.userType != '07') {
  90. this.form.id = null
  91. } else {
  92. this.form.id = this.userInfo.userId
  93. }
  94. this.getList()
  95. },
  96. onReachBottom() {
  97. if (this.dataList.length < this.total) {
  98. this.form.pageNum += 1
  99. this.getList()
  100. }
  101. },
  102. methods: {
  103. swipeClick(id) {
  104. let param = {
  105. id: id,
  106. url: this.config.redirectUrl + id,
  107. }
  108. GetUrl(param).then(res => {
  109. if (res.code == 200) {
  110. window.open(res.data.url, '_self');
  111. } else {
  112. toast('该功能暂未开放')
  113. // uni.navigateBack()
  114. }
  115. })
  116. },
  117. search() {
  118. this.dataList = []
  119. this.form.pageNum = 1
  120. this.form.pageSize = 10
  121. this.getList()
  122. },
  123. clickLoadMore(e) {
  124. this.status = 'loading'
  125. if (this.dataList.length < this.total) {
  126. this.form.pageNum += 1
  127. this.getList()
  128. } else {
  129. this.status = 'no-more'
  130. }
  131. },
  132. getList() {
  133. console.log(this.form);
  134. ListKhjbxx(this.form).then(res => {
  135. if (res.code == 200) {
  136. this.total = res.total
  137. let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  138. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  139. "yhzh", "khmc"
  140. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  141. this.dataList.push(...list)
  142. uni.stopPullDownRefresh();
  143. if (this.dataList.length < this.total) {
  144. this.status = 'more'
  145. } else if (this.dataList.length == this.total) {
  146. this.status = 'no-more'
  147. }
  148. }
  149. })
  150. }
  151. },
  152. watch: {},
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .item-right {
  157. width: 60px;
  158. display: flex;
  159. flex-direction: column;
  160. background-position: left;
  161. background-size: 58px 58px;
  162. background-repeat: no-repeat;
  163. position: relative;
  164. font-size: 14px;
  165. .item-img {
  166. position: absolute;
  167. right: -5px;
  168. bottom: -10px;
  169. height: 40px;
  170. width: 40px;
  171. }
  172. }
  173. </style>