123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <template>
- <view>
- <u-navbar title="充值记录">
- </u-navbar>
- <view class="chargeScreen">
- <view class="chargeScreen-item">
- <p>
- <picker mode="date" :value="startDate" :end="endDate" @change="bindDateChange0">
- <view class="uni-input">{{startDate}}</view>
- </picker>
- </p>
- <u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
- </view>
- <span>至</span>
- <view class="chargeScreen-item">
- <p>
- <picker mode="date" :value="endDate" :start="startDate" @change="bindDateChange1">
- <view class="uni-input">{{endDate}}</view>
- </picker>
-
- </p>
- <u-icon name="arrow-down-fill" color="#999" size="24"></u-icon>
- </view>
- </view>
- <view class="chargeList">
- <view v-for="(item ,index) in list" :key="item.id"
- @click="gotoUrl('pages/user/rechargeDeatils?id='+item.id)"
- class="chargeList-item"
- >
- <view class="chargeList-text">
- <p>余额充值</p>
- <h4>{{item.payNameStr}}</h4>
- </view>
- <view class="chargeList-right">
- <span>{{item.amount}}元</span>
- <h4>{{item.createTime}}</h4>
- </view>
- </view>
-
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/index.js'
- import {parseUnixTime,beforeTimeStamp} from '@/utils/index.js'
- export default {
- data() {
- return {
- form: {
- },
- startDate:'',
- endDate:'',
- pageIndex: 1,
- recordsTotal: 0,
- list: [],
- }
- },
- onReachBottom() {
- if (this.list.length < this.recordsTotal) {
- this.myLoadmore();
- }
- },
- methods: {
- bindDateChange0: function(e) {
- this.startDate= e.target.value
-
-
- this.getList(true)
- },
- bindDateChange1: function(e) {
- this.endDate= e.target.value
-
- this.getList(true)
- },
- myLoadmore() {
- this.pageIndex += 1;
- this.getList()
- },
- getList(bl) {
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- if (bl) {
- this.list = [];
- this.pageIndex = 1;
- }
- var data = {
- startDate:this.startDate,
- endDate:this.endDate,
- pageIndex: this.pageIndex
- };
- API.accountRecordData(data).then((res) => {
- this.list = [
- ...this.list,
- ...res.data.data
- ];
- this.recordsTotal = res.data.recordsTotal
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- onReady() {
- this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
- this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
-
- this.getList()
-
- }
- }
- }
- </script>
- <style>
- page {
- background-color: #f7f7f7;
- }
- </style>
- <style lang="scss" scoped>
- .chargeScreen {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px 0;
- background-color: #fff;
- span {
- color: #777;
- }
- }
- .chargeScreen-item {
- display: flex;
- align-items: center;
- flex: 1;
- justify-content: center;
- p {
- color: #777;
- margin-right: 5px;
- }
- }
- .chargeList {
- margin-top: 10px;
- }
- .chargeList-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 15px;
- background-color: #fff;
- border-bottom: 1px solid #f7f7f7;
- h4 {
- font-weight: normal;
- color: #999;
- margin-top: 3px;
- font-size: 12px;
- }
- span {
- font-size: 14px;
- color: #1677FF;
- font-weight: bold;
- }
- }
- .chargeList-right {
- text-align: right;
- }
- </style>
|