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 3.3KB

1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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' @click='search()'>搜索</button>
  5. </view> -->
  6. <view class='item' v-for="(item,index) in state.newList">
  7. <view>ETC卡号:{{item.cardId}}<text class="payStatus">{{item.payStatusC}}</text></view>
  8. <view>充值金额:¥{{item.rechargeMoney/100}}</view>
  9. <view>申请时间:{{item.insertTime}}</view>
  10. <!-- <view class='time'><text>时间:{{item.tradeConfirmTime}}</text><text>¥{{item.fee}}</text></view> -->
  11. </view>
  12. </view>
  13. <view style="text-align: center;margin: 20rpx;" v-if="state.flags">我是有底线的</view>
  14. </template>
  15. <script lang="ts" setup>
  16. import { reactive } from "vue";
  17. import {request} from "@/utils/network/request.js";
  18. import {queryCardRecord} from "@/utils/network/api.js";
  19. import {stringToJson} from "@/utils/network/encryption.js";
  20. import { onLoad,onReachBottom} from "@dcloudio/uni-app";
  21. import {getItem} from "@/utils/storage";
  22. import {getCodeName} from "@/datas/queryKey.js";
  23. const state = reactive({
  24. list:'', //所有数据
  25. newList:'', //最终展示的
  26. cardId:'',
  27. value:'',//input框里的值
  28. pageNo:1,
  29. pageSize: 16,
  30. flags:false,
  31. })
  32. onLoad((option : any) => {
  33. console.log("option",option)
  34. state.cardId=option.cardId;
  35. getList();
  36. })
  37. const getList=()=>{
  38. const options = {
  39. type: 2,
  40. data: {
  41. 'cardId': state.cardId,
  42. 'openId': getItem('openId'),
  43. 'pageNo': state.pageNo,
  44. 'pageSize': state.pageSize
  45. },
  46. method: "POST",
  47. showLoading: true,
  48. };
  49. request(queryCardRecord, options).then((res) => {
  50. state.newList=[...stringToJson(res.bizContent).data,...state.newList]
  51. // getCodeName('VCR_ORDER_PAY_STATUS',payStatus)
  52. for(var i=0;i<state.newList.length;i++){
  53. console.log("getCodeName",getCodeName('VCR_ORDER_STATUS',state.newList[i]['status']))
  54. state.newList[i]['payStatusC']=getCodeName('VCR_ORDER_PAY_STATUS',state.newList[i]['payStatus'])
  55. // if(getCodeName('VCR_ORDER_PAY_STATUS',state.newList[i]['payStatus']))
  56. }
  57. console.log("交易记录",state.newList)
  58. })
  59. }
  60. // 触底加载
  61. onReachBottom(()=>{
  62. if(state.newList.length<state.pageNo*16) return state.flags = true
  63. console.log("触底了")
  64. state.pageNo++
  65. getList()
  66. })
  67. // const search=()=>{
  68. // state.newList=[];
  69. // for (var i = 0; i < state.list.length; i++) {
  70. // if (state.list[i].cardId.indexOf(state.value) >= 0) {
  71. // state.newList.push(state.list[i]);
  72. // }
  73. // }
  74. // console.log("state.newList",state.newList)
  75. // }
  76. // const doSearch=()=>{
  77. // search();
  78. // }
  79. </script>
  80. <style scoped>
  81. .content{
  82. background-color: #EEF7F7;
  83. min-height:100vh;
  84. padding: 0 30rpx;
  85. overflow: hidden;
  86. font-size: 32rpx;
  87. }
  88. .search_wrap{
  89. display:flex;
  90. margin:20rpx 0;
  91. }
  92. .search_wrap>input{
  93. background-color:white;
  94. width: 76%;
  95. height: 40rpx;
  96. line-height: 40rpx;
  97. padding: 10rpx 10rpx;
  98. border-radius: 10rpx 0 0 10rpx;
  99. }
  100. .item{
  101. width:100%;
  102. border-radius:10rpx;
  103. box-sizing: border-box;
  104. padding: 30rpx 20rpx;
  105. margin-top:30rpx;
  106. /* background:linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); */
  107. background:white;
  108. color:black;
  109. }
  110. .time{
  111. display:flex;
  112. margin-bottom: 16rpx;
  113. justify-content: space-between;
  114. }
  115. .payStatus{
  116. color: red;
  117. float: right;
  118. }
  119. </style>