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.

recharge-record.vue 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class='content'>
  3. <view class='search_wrap'>
  4. <input type="text" v-model='state.value' placeholder='请搜索银行卡号' @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. 'accountTransactionType': 0
  36. },
  37. method: "POST",
  38. showLoading: true,
  39. };
  40. request(transactionRecord, options).then((res) => {
  41. const data = stringToJson(res.bizContent);
  42. state.list = data.qtkCorporateAccountDetails;
  43. for (var i = 0; i < state.list.length; i++) {
  44. state.list[i].tradeConfirmTime = state.list[i].tradeConfirmTime.replace("T", " ");
  45. }
  46. state.newList = state.list;
  47. console.log("交易记录", data)
  48. })
  49. }
  50. const search = () => {
  51. state.newList = [];
  52. for (var i = 0; i < state.list.length; i++) {
  53. if (state.list[i].bankCardId.indexOf(state.value) >= 0) {
  54. state.newList.push(state.list[i]);
  55. }
  56. }
  57. console.log("state.newList", state.newList)
  58. }
  59. const doSearch = () => {
  60. search();
  61. }
  62. </script>
  63. <style scoped>
  64. .content {
  65. background-color: #EEF7F7;
  66. min-height: 100vh;
  67. padding: 0 30rpx;
  68. overflow: hidden;
  69. font-size: 32rpx;
  70. padding-top: 100rpx;
  71. }
  72. .search_wrap {
  73. display: flex;
  74. position: fixed;
  75. left: 0;
  76. top: 0;
  77. background-color: #EEF7F7;
  78. width: 100%;
  79. padding: 20rpx;
  80. box-sizing: border-box;
  81. }
  82. .search_wrap>input {
  83. background-color: white;
  84. width: 76%;
  85. height: 40rpx;
  86. line-height: 40rpx;
  87. padding: 10rpx 10rpx;
  88. border-radius: 10rpx 0 0 10rpx;
  89. }
  90. .item {
  91. width: 100%;
  92. border-radius: 10rpx;
  93. box-sizing: border-box;
  94. padding: 30rpx 20rpx;
  95. margin-top: 30rpx;
  96. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  97. color: white;
  98. }
  99. .time {
  100. display: flex;
  101. margin-bottom: 16rpx;
  102. justify-content: space-between;
  103. }
  104. </style>