123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <template>
- <view>
- <ujp-navbar title="充值记录">
- <view class="slot-wrap">
- <span class="navBtn " @click="toRefundList">退余额</span>
- </view>
- </ujp-navbar>
- <view class="rechargeTime" @click="show = true">
- <u-picker mode="time" v-model="show" :params="params"
- :default-time="dateMonth"
- @confirm="confirmTime" @cancel="cancelTime"></u-picker>
- <span>{{month}}月</span>
- <u-icon name="arrow-down-s-fill" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
- </view>
- <view style="text-align: center;margin-top: 100px" v-if="!accountList.length">
-
- <img src="@/assets/img/blankpage.png">
- <p>暂无充值记录</p>
- </view>
- <!-- <view class="carNone" v-if="accountList.length == 0">
- <img src="static/img/暂无数据-缺省页.png" alt="">
- <p>暂无充值记录</p>
- </view> -->
- <view class="rechargeList" v-if="accountList.length > 0">
- <view class="rechargeList-item" v-for="(item,index) in accountList" :key="item.id" @click="gotoUrl('pages/user/finance/rechargeDet?id=' + item.id)">
- <view class="rechargeList-row"><span>充值金额</span><h4>{{item.amount}}元</h4></view>
- <view class="rechargeList-row"><p>{{item.payNameStr}}</p><p>{{item.createTime}}</p></view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/index.js'
-
- export default {
- data() {
- return {
- userId: '',
- params: {
- year: true,
- month: true,
- day: false,
- hour: false,
- minute: false,
- second: false,
- timestamp: true,
- },
- show: false,
- month: '',
- dateMonth: '',
- accountList: [],
- }
- },
- onReady() {
- if(this.carhelp.getPersonInfo()) {
- this.userId = this.carhelp.getPersonInfo().id;
- }
-
- var date = new Date();
- this.month = date.getMonth() + 1;
-
- var year = date.getFullYear();
- var monthN = this.month;
- if(monthN >= 1 && monthN <= 9) {
- monthN = "0" + monthN;
- }
- this.dateMonth = year + '-' + monthN + '-01';
-
- this.getAccountRecordData();
- },
- methods: {
- toRefundList() {
- uni.navigateTo({
- url: '/pages/user/refundList'
- })
- },
- getAccountRecordData() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.accountRecordData({
- queryDate: this.dateMonth,
- }).then((res) => {
- uni.hideLoading();
-
- this.accountList = res.data.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- confirmTime(params) {
- this.dateMonth = params.year + '-' + params.month + '-01';
- if(params.month.slice(0,1) == '0') {
- this.month = params.month.slice(1);
- } else {
- this.month = params.month;
- }
- this.getAccountRecordData();
- this.show = false;
- },
- cancelTime() {
- this.show = false;
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .slot-wrap{
- flex: 1;
- }
- .navBtn{
- float: right;
- margin-right: 15px;
- color:#3fbd70;
- }
- .carNone{
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- img{
- width: 100%;
- height: 100%;
- }
- p{
- margin-top: -60px;
- }
- }
- .rechargeTime{
- background-color: #fff;
- height: 44px;
- display: flex;
- align-items: center;
- padding: 12px 16px;
- border-bottom: 1px solid #f7f7f7;
- span{
- margin-right: 4px;
- }
- }
- .rechargeList{
- background-color: #fff;
- padding-left: 16px;
- .rechargeList-item{
- padding: 12px 16px 12px 0;
- border-bottom: 1px solid #f7f7f7;
- &:last-child{
- border-bottom: none;
- }
- }
- .rechargeList-row{
- display: flex;
- align-items: center;
- justify-content: space-between;
- h4{
- font-size: 16px;
- }
- p{
- font-size: 12px;
- margin-top: 4px;
- color:#888;
- }
- }
- }
- </style>
|