Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

consumption-record.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.tradeTime}}</text><text>¥{{item.fee/100}}</text></view>
  9. <view>对公账户:{{item.corporateAccountId}}</view>
  10. <!-- item.status 1 圈存成功 0 半条 -->
  11. <!-- <view class="but-wrap" v-if="item.status ==0">
  12. <text @click="toTrap(item.fee)">修复</text>
  13. </view> -->
  14. </view>
  15. </view>
  16. </template>
  17. <script lang="ts" setup>
  18. import { reactive } from "vue";
  19. import { request } from "@/utils/network/request.js";
  20. import { transactionRecord } from "@/utils/network/api.js";
  21. import { stringToJson } from "@/utils/network/encryption.js";
  22. import { onLoad } from "@dcloudio/uni-app";
  23. import { getCodeName } from "@/datas/queryKey.js";
  24. const state = reactive({
  25. list: '', //所有数据
  26. newList: '', //最终展示的
  27. name: '',
  28. value: '',//input框里的值
  29. })
  30. onLoad((option : any) => {
  31. console.log("option", option)
  32. state.name = option.name;
  33. getList();
  34. })
  35. const getList = () => {
  36. const options = {
  37. type: 2,
  38. data: {
  39. 'accountId': state.name,
  40. 'accountTransactionType': 1
  41. },
  42. method: "POST",
  43. showLoading: true,
  44. };
  45. request(transactionRecord, options).then((res) => {
  46. const data = stringToJson(res.bizContent);
  47. state.list = data.qtkCorporateAccountDetails;
  48. state.newList = state.list;
  49. console.log("交易记录", data)
  50. })
  51. }
  52. const search = () => {
  53. state.newList = [];
  54. for (var i = 0; i < state.list.length; i++) {
  55. if (state.list[i].cardId.indexOf(state.value) >= 0) {
  56. state.newList.push(state.list[i]);
  57. }
  58. }
  59. }
  60. const doSearch = () => {
  61. search();
  62. }
  63. const toTrap = (rechargeMoney) => {
  64. uni.navigateTo({
  65. url: `/subpackage/personal-center/trapping-and-repairing-account/recharge-pay?rechargeMoney=${rechargeMoney}&&payMoney=0`
  66. })
  67. }
  68. </script>
  69. <style scoped>
  70. .content {
  71. background-color: #EEF7F7;
  72. min-height: 100vh;
  73. padding: 0 30rpx;
  74. overflow: hidden;
  75. font-size: 32rpx;
  76. }
  77. .search_wrap {
  78. display: flex;
  79. margin: 20rpx 0;
  80. }
  81. .search_wrap>input {
  82. background-color: white;
  83. width: 76%;
  84. height: 40rpx;
  85. line-height: 40rpx;
  86. padding: 10rpx 10rpx;
  87. border-radius: 10rpx 0 0 10rpx;
  88. }
  89. .item {
  90. width: 100%;
  91. border-radius: 10rpx;
  92. box-sizing: border-box;
  93. padding: 30rpx 20rpx;
  94. margin-top: 30rpx;
  95. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  96. color: white;
  97. }
  98. .time {
  99. display: flex;
  100. margin-bottom: 16rpx;
  101. justify-content: space-between;
  102. }
  103. .but-wrap {
  104. display: flex;
  105. justify-content: flex-end;
  106. margin-top: 10rpx;
  107. }
  108. .but-wrap>text {
  109. border: 1px solid white;
  110. color: white;
  111. height: 50rpx;
  112. line-height: 50rpx;
  113. border-radius: 30rpx;
  114. padding: 0 24rpx;
  115. font-size: 28rpx;
  116. box-sizing: border-box;
  117. margin-left: 12rpx;
  118. }
  119. </style>