Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

list.vue 3.1KB

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