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.

consumption-record.vue 2.4KB

2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
1 年之前
2 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class='content'>
  3. <view class='search_wrap'>
  4. <input type="text" v-model='state.value' placeholder='搜索ETC卡号' @confirm="doSearch" /><button size='mini'
  5. @click='search()'>搜索</button>
  6. </view>
  7. <view class='item' v-for="(item,index) in state.newList">
  8. <view class='time'><text>时间:{{item.tradeConfirmTime}}</text><text>¥{{item.fee/100}}</text></view>
  9. <view>银行卡号:{{item.bankCardId}}</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script lang="ts" setup>
  14. import { reactive } from "vue";
  15. import { request } from "@/utils/network/request.js";
  16. import { transactionRecord } from "@/utils/network/api.js";
  17. import { stringToJson } from "@/utils/network/encryption.js";
  18. import { onLoad } from "@dcloudio/uni-app";
  19. const state = reactive({
  20. list: '', //所有数据
  21. newList: '', //最终展示的
  22. name: '',
  23. value: '',//input框里的值
  24. })
  25. onLoad((option : any) => {
  26. console.log("option", option)
  27. state.name = option.name;
  28. getList();
  29. })
  30. const getList = () => {
  31. const options = {
  32. type: 2,
  33. data: {
  34. 'accountId': state.name
  35. },
  36. method: "POST",
  37. showLoading: true,
  38. };
  39. request(transactionRecord, options).then((res) => {
  40. const data = stringToJson(res.bizContent);
  41. state.list = data.qtkCorporateAccountDetails;
  42. for (var i = 0; i < state.list.length; i++) {
  43. state.list[i].tradeConfirmTime = state.list[i].tradeConfirmTime.split('T').join(' ');
  44. }
  45. state.newList = state.list;
  46. console.log("交易记录", data)
  47. })
  48. }
  49. const search = () => {
  50. state.newList = [];
  51. for (var i = 0; i < state.list.length; i++) {
  52. if (state.list[i].cardId.indexOf(state.value) >= 0) {
  53. state.newList.push(state.list[i]);
  54. }
  55. }
  56. }
  57. const doSearch = () => {
  58. search();
  59. }
  60. </script>
  61. <style scoped>
  62. .content {
  63. background-color: #EEF7F7;
  64. min-height: 100vh;
  65. padding: 0 30rpx;
  66. overflow: hidden;
  67. font-size: 32rpx;
  68. }
  69. .search_wrap {
  70. display: flex;
  71. margin: 20rpx 0;
  72. }
  73. .search_wrap>input {
  74. background-color: white;
  75. width: 76%;
  76. height: 40rpx;
  77. line-height: 40rpx;
  78. padding: 10rpx 10rpx;
  79. border-radius: 10rpx 0 0 10rpx;
  80. }
  81. .item {
  82. width: 100%;
  83. border-radius: 10rpx;
  84. box-sizing: border-box;
  85. padding: 30rpx 20rpx;
  86. margin-top: 30rpx;
  87. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  88. color: white;
  89. }
  90. .time {
  91. display: flex;
  92. margin-bottom: 16rpx;
  93. justify-content: space-between;
  94. }
  95. </style>