瀏覽代碼

充值明细

zhengkaixin 5 天之前
父節點
當前提交
03e11526f3
共有 6 個文件被更改,包括 332 次插入8 次删除
  1. 3 3
      .env.dev.js
  2. 11 0
      apis/finance.js
  3. 19 1
      apis/role.js
  4. 10 4
      components/TabbarFinance.vue
  5. 7 0
      pages.json
  6. 282 0
      pagesFinance/statistics/recharge.vue

+ 3 - 3
.env.dev.js

@@ -2,7 +2,7 @@ const UNI_APP = {
 	
 	BASE_URL: 'https://youdian-test.hbjp.com.cn/charging-station-test/',
 	
-	//BASE_URL: 'https://youdian.hbjp.com.cn/charging-station-server/',
+	BASE_URL: 'https://youdian.hbjp.com.cn/charging-station-server/',
 	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	
@@ -15,8 +15,8 @@ const UNI_APP = {
 	//openId:"oSruR6bebprt9L6EebBQq4KzArYQ",//提现
 	//openId:"oSruR6dZcmSM4ATuweZ5fjHGQsiA", //杨所
 	//openId:"oK9Wr56yEh-TbCvUg3s9LYQSL8tM",
-	//openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
-	openId:"oSruR6dsG6wrbiQCwyftfgnp5690",//舒展, 物业
+	openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
+	//openId:"oSruR6dsG6wrbiQCwyftfgnp5690",//舒展, 物业
 	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",
 	
 	//openId:"oSruR6bq1mtXtMdVy3EWlf6y_7oI",//f++

+ 11 - 0
apis/finance.js

@@ -15,6 +15,17 @@ export function findByOpenId(data) {
 }
 
 
+
+export function rechargeList(data) {
+	var url='/mobile/roleSharing/rechargeList';
+	return requestWhite({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
  export function homeChargingSingleCarStatusDetail(data) {
  	var url='/mobile/roleSharing/homeChargingSingleCarStatusDetail';
  	return request({

+ 19 - 1
apis/role.js

@@ -20,6 +20,18 @@ var list = [{
 		pagePath2: "/pagesFinance/detailed/index",
 		role:[0,1],
 
+	},
+	{
+		current: 1,
+		iconPath: "file-text-fill",
+		selectedIconPath: "file-text-fill",
+		text: '充值',
+		midButton: true,
+		customIcon: false,
+		pagePath2: "/pagesFinance/statistics/recharge",
+		role:[],
+		accountType:true,
+	
 	},
 	{
 		current: 2,
@@ -83,7 +95,13 @@ function role(info) {
 	for (var i in list) {
 		var item = list[i]
 		var sz =item.role;
-		if(item.only){
+		if(item.accountType){
+			
+			if(info.accountType==1){
+				relist.push(item)
+			}
+			
+		}else if(item.only){
 			if(accountTopics==sz[0]){
 				relist.push(item)
 			}

+ 10 - 4
components/TabbarFinance.vue

@@ -29,9 +29,15 @@
 		},computed:{
 				currentNum(){
 					
+					const pages = getCurrentPages();
+					// 获取当前页面实例
+					const currentPage = pages[pages.length - 1];
+					// 获取当前路由路径(格式如 /pages/index/index)
+					const currentRoute = currentPage.route;
+					
 					for(var i in this.tabbarList){
 						var item=this.tabbarList[i]
-						if(item.current==this.current){
+						if(item.pagePath2.indexOf(currentRoute)!=-1){
 							return i;
 						}
 					}
@@ -44,9 +50,9 @@
 				this.myCurrent=this.currentNum;
 			},
 			setcount(){
-				// console.log("currentNum")
-				// console.log(this.currentNum)
-				this.myCurrent=this.currentNum;
+				
+				// console.log(index)
+				this.myCurrentt=this.currentNum;
 			},
 			beforeSwitch(index){
 				

+ 7 - 0
pages.json

@@ -594,6 +594,13 @@
         	{
         		"navigationBarTitleText" : ""
         	}
+        },
+        {
+        	"path" : "pagesFinance/statistics/recharge",
+        	"style" : 
+        	{
+        		"navigationBarTitleText" : ""
+        	}
         }
     ],
 	"globalStyle": {

+ 282 - 0
pagesFinance/statistics/recharge.vue

@@ -0,0 +1,282 @@
+<template>
+	<view>
+		<ujp-navbar :is-back="false" title="充值明细">
+
+			<view class="navbar-screen" slot="right" @click="showdate = true"><span>筛选</span>
+				<u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
+			</view>
+		</ujp-navbar>
+		<u-calendar v-model="showdate" mode="date" @change="changedate"></u-calendar>
+
+
+<view class="topBodyMain" v-if="list.length">
+				<view class="topBody1">
+					<view>{{form.startDate}}</view>
+					<view>充值人次:{{recordsTotal}}</view>
+				</view>
+
+				<view class="topBody2">
+					<view>充值:{{topBody.totalFee}}元</view>
+					<view>退款:{{topBody.refundFee}}元</view>
+					<view>汇总:{{topBody.sumFee}}元</view>
+				</view>
+
+			</view>
+		<view class="detailed">
+			<view style="text-align: center;margin-top: 100px" v-if="!list.length">
+				<img src="@/assets/img/blankpage.png">
+				<view>查询为空</view>
+			</view>
+			
+			<view class="detailed-list" v-for="(item ,index) in list" :key="index">
+
+				<view class="detailed-item detailed-item-body">
+					<view class="nickNameBody">
+
+						<view class="line1">
+
+							<view class="span nickName">{{item.nickName}} </view>
+							<view class="span">{{item.phone}} </view>
+						</view>
+						<view class="line2">
+							<view class="span">充值:{{item.totalFee}}</view>
+							<view class="span" :class="{
+								refundFee:item.refundFee
+							}">退款:{{item.refundFee}}</view>
+						</view>
+
+						<view class="line3">
+							<view class="span">
+								<u-icon name="clock"></u-icon>{{item.payTime?item.payTime.slice(11):''}}
+							</view>
+							<view class="span">
+								{{item.outOrderNo}}
+							</view>
+						</view>
+
+
+					</view>
+					<view class="totalFee" :class="{
+								refundFee:item.refundFee
+							}">
+						{{item.showFee?item.showFee.toFixed(2):0}}元
+					</view>
+				</view>
+
+			</view>
+
+			<u-divider v-if="list.length&&list.length == recordsTotal" color="#B6BDC3" style="margin-top:20px;"
+				bg-color="#f7f7f7">已经到底了</u-divider>
+
+
+		</view>
+
+
+		<Tabbar :current="2" ref="tabbarMain"></Tabbar>
+	</view>
+</template>
+
+<script>
+	import Tabbar from '@/components/TabbarFinance.vue'
+	import * as API from '@/apis/finance.js'
+	import {
+		beforeTimeStamp,
+		currentTimeStamp,
+		parseUnixTime
+	} from '@/utils'
+
+	export default {
+		data() {
+			return {
+				showdate: false,
+
+				form: {
+
+				},
+
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
+				topBody: {
+					totalFee: 0,
+					refundFee: 0,
+					sumFee: 0
+				}
+
+			}
+		},
+		components: {
+			Tabbar
+
+		},
+		onReachBottom() {
+
+			this.myLoadmore();
+
+		},
+		onShow() {
+			if (this.$refs.tabbarMain) {
+				this.$refs.tabbarMain.setcount(1);
+			}
+		},
+		onLoad() {
+
+		},
+		onReady() {
+			this.info = this.carhelp.getPersonInfo()
+			this.form.startDate = parseUnixTime(new Date(), '{y}-{m}-{d}')
+			this.form.endDate = parseUnixTime(new Date(), '{y}-{m}-{d}')
+
+			this.getList()
+
+			//this.getStation()
+
+		},
+		methods: {
+
+			changedate(e) {
+				//	this.queryDate = e.result
+				this.form.startDate = e.result
+				this.form.endDate = e.result
+				this.getList()
+			},
+
+
+			getList() {
+
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				this.form.pageIndex = this.pageIndex
+				this.form.pageSize = 999
+
+				API.rechargeList(this.form).then((res) => {
+
+
+
+
+					this.list = res.data.data;
+					this.topBody.totalFee = 0
+					this.topBody.refundFee = 0
+
+					this.list.forEach(item => {
+						item.showFee = item.totalFee - item.refundFee
+						this.topBody.totalFee += item.totalFee
+						this.topBody.refundFee += item.refundFee
+
+					})
+					this.topBody.totalFee = this.topBody.totalFee.toFixed(2)
+					this.topBody.refundFee = this.topBody.refundFee.toFixed(2)
+					this.topBody.sumFee = this.topBody.totalFee - this.topBody.refundFee;
+					this.topBody.sumFee = this.topBody.sumFee.toFixed(2)
+
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+
+				}).catch(error => {
+					uni.showToast({
+
+						title: error
+					})
+				})
+			},
+
+
+			myLoadmore() {
+				if (this.list.length < this.recordsTotal) {
+					this.pageIndex += 1;
+					this.getList()
+				}
+
+
+			},
+
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #F7F7F7;
+	}
+</style>
+<style lang="scss" scoped>
+	.topBodyMain {
+		padding: 20rpx 40rpx;
+		display: flex;
+		justify-content: space-between;
+
+		position: fixed;
+		top: 90rpx;
+		
+		width: 100%;
+	
+		background: #dbd9d9;
+		z-index: 999;
+	}
+
+	.detailed {
+		padding-top:  160rpx;
+		.detailed-list {
+			padding: 20rpx 40rpx;
+			border-bottom: 1px solid #d6c0c0;
+			background-color: #fff;
+
+			.detailed-item-body {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.refundFee {
+					color: #fd8008;
+				}
+
+				.nickNameBody {
+
+					.line1,
+					.line2 {
+						display: flex;
+						font-size: 32rpx;
+
+						.span {
+							margin-right: 20rpx;
+						}
+
+					}
+
+					.line1 {
+						color: #777777
+					}
+
+					.line2 {
+						margin: 8rpx 0;
+					}
+
+					.line3 {
+						display: flex;
+						color: #777777;
+						.span {
+							margin-right: 20rpx;
+						}
+					}
+
+					.nickName {
+						width: 200rpx;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						white-space: nowrap;
+					}
+
+				}
+
+				.totalFee {
+					font-weight: bold;
+					font-size: 48rpx;
+					white-space: pre;
+					// margin-left: 40rpx;
+				}
+
+			}
+		}
+	}
+</style>