|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <template>
- <view class='content'>
- <!-- <view class='search_wrap'>
- <input type="text" v-model='state.value' placeholder='搜索ETC卡号' @confirm="doSearch"/><button size='mini' @click='search()'>搜索</button>
- </view> -->
- <view class='item' v-for="(item,index) in state.newList">
- <view>ETC卡号:{{item.cardId}}<text class="payStatus">{{item.payStatusC}}</text></view>
- <view>充值金额:¥{{item.rechargeMoney/100}}</view>
- <view>申请时间:{{item.insertTime}}</view>
- <!-- <view class='time'><text>时间:{{item.tradeConfirmTime}}</text><text>¥{{item.fee}}</text></view> -->
- </view>
- </view>
- <view style="text-align: center;margin: 20rpx;" v-if="state.flags">我是有底线的</view>
- </template>
-
- <script lang="ts" setup>
- import { reactive } from "vue";
- import {request} from "@/utils/network/request.js";
- import {queryCardRecord} from "@/utils/network/api.js";
- import {stringToJson} from "@/utils/network/encryption.js";
- import { onLoad,onReachBottom} from "@dcloudio/uni-app";
- import {getItem} from "@/utils/storage";
- import {getCodeName} from "@/datas/queryKey.js";
- const state = reactive({
- list:'', //所有数据
- newList:'', //最终展示的
- cardId:'',
- value:'',//input框里的值
- pageNo:1,
- pageSize: 16,
- flags:false,
- })
- onLoad((option : any) => {
- console.log("option",option)
- state.cardId=option.cardId;
- getList();
- })
- const getList=()=>{
- const options = {
- type: 2,
- data: {
- 'cardId': state.cardId,
- 'openId': getItem('openId'),
- 'pageNo': state.pageNo,
- 'pageSize': state.pageSize
- },
- method: "POST",
- showLoading: true,
- };
- request(queryCardRecord, options).then((res) => {
- state.newList=[...stringToJson(res.bizContent).data,...state.newList]
- // getCodeName('VCR_ORDER_PAY_STATUS',payStatus)
- for(var i=0;i<state.newList.length;i++){
- console.log("getCodeName",getCodeName('VCR_ORDER_STATUS',state.newList[i]['status']))
- state.newList[i]['payStatusC']=getCodeName('VCR_ORDER_PAY_STATUS',state.newList[i]['payStatus'])
- // if(getCodeName('VCR_ORDER_PAY_STATUS',state.newList[i]['payStatus']))
- }
- console.log("交易记录",state.newList)
- })
- }
- // 触底加载
- onReachBottom(()=>{
- if(state.newList.length<state.pageNo*16) return state.flags = true
- console.log("触底了")
- state.pageNo++
- getList()
- })
- // const search=()=>{
- // state.newList=[];
- // for (var i = 0; i < state.list.length; i++) {
- // if (state.list[i].cardId.indexOf(state.value) >= 0) {
- // state.newList.push(state.list[i]);
- // }
- // }
- // console.log("state.newList",state.newList)
- // }
- // const doSearch=()=>{
- // search();
- // }
- </script>
-
- <style scoped>
- .content{
- background-color: #EEF7F7;
- min-height:100vh;
- padding: 0 30rpx;
- overflow: hidden;
- font-size: 32rpx;
- }
- .search_wrap{
- display:flex;
- margin:20rpx 0;
- }
- .search_wrap>input{
- background-color:white;
- width: 76%;
- height: 40rpx;
- line-height: 40rpx;
- padding: 10rpx 10rpx;
- border-radius: 10rpx 0 0 10rpx;
- }
- .item{
- width:100%;
- border-radius:10rpx;
- box-sizing: border-box;
- padding: 30rpx 20rpx;
- margin-top:30rpx;
- /* background:linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%); */
- background:white;
- color:black;
- }
- .time{
- display:flex;
- margin-bottom: 16rpx;
- justify-content: space-between;
- }
- .payStatus{
- color: red;
- float: right;
- }
- </style>
|