From 0ed8e370659ad4e0582301ae31cfa155da114590 Mon Sep 17 00:00:00 2001 From: Liuyi <candymxq888@outlook.com> Date: 星期二, 12 十一月 2024 17:28:54 +0800 Subject: [PATCH] 添加柜台充值,修改扫码取水支付方式 --- pages/functionList/rechargeRecord/index.vue | 64 +++++++++++++++++++++++++------- 1 files changed, 50 insertions(+), 14 deletions(-) diff --git a/pages/functionList/rechargeRecord/index.vue b/pages/functionList/rechargeRecord/index.vue index 0f20179..3b64d18 100644 --- a/pages/functionList/rechargeRecord/index.vue +++ b/pages/functionList/rechargeRecord/index.vue @@ -1,6 +1,6 @@ <script setup> import { onMounted, ref } from 'vue' - import { rechargeChangeApi } from '../../../api/index.js' + import { rechargeChangeApi,balanceStatisticsApi} from '../../../api/index.js' //返回 function navBackTo(){ uni.navigateBack() @@ -30,10 +30,19 @@ //获取消费变动列表 const banlanceList = ref([]) async function getBalanceList(val){ - await rechargeChangeApi(val).then((res) =>{ + await rechargeChangeApi(val).then(async(res) =>{ if(res.code == 200){ banlanceList.value = res.data } + await getStatistics(val) + }) + } + + //获取用户资金变动统计 + const rechargeSta = ref() + async function getStatistics(val){ + await balanceStatisticsApi(val).then((res) =>{ + rechargeSta.value = res.data.rechargeAmount }) } onMounted(async() =>{ @@ -48,26 +57,31 @@ <view class="picker"> <picker mode="date" :value="datePay" :fields="'month'" @change="bindDateChange"> <view class="date-text"> - <text class="uni-input">{{datePay}}</text> - <image src="../../../static/images/other/more.png" alt=''></image> + <text class="uni-input">日期:{{datePay}}</text> + <image src="../../../static/images/other/expand.png" alt=''></image> </view> </picker> </view> + <view class="rechargeAll">充值:{{rechargeSta}}元</view> </view> - <view class="main"> + <view class="main" v-if="banlanceList.length > 0"> <block v-for="(item,index) in banlanceList"> <view class="item"> <view class="item-left"> - <text>购水</text> - <text class="methods">消费方式:{{item.consumptionTypeView}}</text> - <text>{{item.payTime}}</text> + <!-- <text>充值</text> --> + <text class="methods">水卡充值</text> + <text>{{item.createTimeView}}</text> </view> <view class="item-right"> - <text class="money">{{item.paymentAmount}}</text> + <text class="money">{{item.rechargeAmount}}</text> <text>元</text> </view> </view> </block> + </view> + <view v-else class="nodata"> + <image src="../../../static/images/other/nodata.png" alt=""></image> + <text>该月暂无记录</text> </view> </view> </template> @@ -83,7 +97,7 @@ display: flex; padding: 0 36rpx; box-sizing: border-box; - justify-content:flex-start; + justify-content:space-between; align-items: center; .picker{ .date-text{ @@ -93,7 +107,7 @@ text{ font-weight: 300; font-size: 32rpx; - color: #000000; + color: #5487f4; margin-right:10rpx; } image{ @@ -104,10 +118,15 @@ } } } + .rechargeAll{ + font-weight: 300; + font-size: 26rpx; + color: #3368bd; + } } .main{ width:99%; - height: calc(100vh - 84rpx - 176rpx - 70rpx); + height:1200rpx; background: #fff; border-radius:20rpx; margin: 0 auto; @@ -117,11 +136,11 @@ // background: #7E7E7E; .item{ width:100%; - height:184rpx; + height:140rpx; // background:rgba(170, 216, 255, 0.2); border-bottom:1rpx solid #D8D8D8; box-sizing:border-box; - padding-bottom:38rpx; + padding-bottom:20rpx; justify-content:space-between; align-items: flex-end; display: flex; @@ -166,5 +185,22 @@ } } } + .nodata{ + width:100%; + height:1200rpx; + display: flex; + justify-content: center; + align-items: center; + padding-bottom:400rpx; + box-sizing: border-box; + flex-direction: column; + image{ + width:496rpx; + height:488rpx; + } + text{ + color:#bed2fd; + } + } } </style> -- Gitblit v1.9.3