您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

consumption-record.vue 3.3KB

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