You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list.vue 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="content">
  3. <view class="list-item" v-for="(item,index) in state.tableData">
  4. <view><text>卡号:</text><text>{{item.cardId}}</text></view>
  5. <view><text>反白时间:</text><text>{{item.createTime}}</text></view>
  6. <view><text>反白原因:</text><text>{{item.reasonOut}}</text></view>
  7. <view><text>下黑时间:</text><text>{{item.creationTime}}</text></view>
  8. <view><text>下黑原因:</text><text>{{item.reasonIn}}</text></view>
  9. <view><text>黑名单类型:</text><text>{{item.typeC}}</text></view>
  10. <view><text>状态:</text><text>{{item.status == '1'?'在黑':'已反白'}}</text></view>
  11. </view>
  12. <view class="no" v-if="state.tableData.length==0">暂无黑名单</view>
  13. </view>
  14. </template>
  15. <script setup lang="ts">
  16. import { reactive } from "vue";
  17. import { onLoad } from "@dcloudio/uni-app";
  18. import { blackApi } from "@/utils/network/api.js";
  19. import { request } from "@/utils/network/request.js";
  20. import { stringToJson } from "@/utils/network/encryption.js";
  21. import { getItem } from "@/utils/storage";
  22. const state = reactive({
  23. vehiclePlate: "",
  24. vehiclePlateColor: "",
  25. tableData: [],
  26. blackStatus: []
  27. });
  28. onLoad((option : any) => {
  29. console.log("option", option)
  30. let black = getItem('key')['BLACKLIST_TYPE'];
  31. for (var k = 0; k < black.length; k++) {
  32. let obj = {};
  33. obj['value'] = black[k]['code']
  34. obj['text'] = black[k]['name']
  35. state.blackStatus.push(obj)
  36. }
  37. console.log("black", state.blackStatus)
  38. state.vehiclePlate = option.vehiclePlate;
  39. state.vehiclePlateColor = option.vehiclePlateColor;
  40. list()
  41. })
  42. const list = () => {
  43. const options = {
  44. type: 2,
  45. data: {
  46. "vehiclePlate": state.vehiclePlate,
  47. "vehiclePlateColor": state.vehiclePlateColor
  48. },
  49. method: 'POST',
  50. showLoading: true,
  51. }
  52. request(blackApi, options).then((res) => {
  53. const data = stringToJson(res.bizContent);
  54. const getData = data.blackCards;
  55. const newData = []
  56. for (var i = 0; i < getData.length; i++) {
  57. if (getData[i]['status'] == '1') {
  58. newData.push(getData[i])
  59. }
  60. }
  61. for (var i = 0; i < newData.length; i++) {
  62. for (var m = 0; m < state.blackStatus.length; m++) {
  63. if (newData[i]['type'] == state.blackStatus[m]['value']) {
  64. newData[i]['typeC'] = state.blackStatus[m]['text']
  65. break;
  66. }
  67. }
  68. }
  69. state.tableData = newData
  70. console.log("圈存金额查询2", data)
  71. })
  72. }
  73. </script>
  74. <style scoped>
  75. .content {
  76. padding-bottom: 20rpx;
  77. background-color: #EEF7F7;
  78. padding-top: 20rpx;
  79. min-height: 100vh;
  80. }
  81. .list-item {
  82. width: 95%;
  83. border-radius: 10rpx;
  84. margin: 30rpx auto;
  85. font-size: 28rpx;
  86. border: 1rpx solid #ccc;
  87. padding: 12rpx;
  88. box-sizing: border-box;
  89. background-color: white;
  90. }
  91. .list-item>view {
  92. margin-bottom: 10rpx;
  93. width: 94%;
  94. }
  95. .no {
  96. text-align: center;
  97. padding-top: 100rpx;
  98. }
  99. </style>