Bladeren bron

分润调整

zhengkaixin 3 jaren geleden
bovenliggende
commit
1f4af08ba8

+ 2 - 2
.env.dev.js

@@ -5,8 +5,8 @@ const UNI_APP = {
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",//测试用openId  
 	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
-	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
-	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
+	openId:"1000",
+	//openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
 	//小鹏管家appid
 	VUE_APP_WXAPPID:"wx7e70eb62a8459869"
 }  

+ 52 - 0
apis/finance.js

@@ -109,3 +109,55 @@ export function withdrawRecord(data) {
 		url: url
 	})
 }
+
+export function devicesByStation(data) {
+	var url='/mobile/dataDictionary/devicesByStation';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function stationList(data) {
+	var url='/mobile/dataDictionary/stationList';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+export function logout(data) {
+	var url='/mobile/merchantUser/logout';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'get',
+		data: data,
+		url: url
+	})
+}
+
+
+export function spIncomeStatistics (bl,data) {
+	 
+	return request({
+		method: 'post',
+		jp_identity:"merchantUser",// 分润接口
+		data:data ,
+		url: '/mobile/roleSharing/'+(bl?"costIncomeStatistics":"spIncomeStatistics")
+	})
+} 
+
+export function helpList (data) {
+	 
+	return request({
+		method: 'post',
+		jp_identity:"merchantUser",// 分润接口
+		data:data ,
+		url: '/mobile/roleSharing/helpList'
+	})
+} 
+
+

+ 10 - 1
pages.json

@@ -145,7 +145,16 @@
 			
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
-		},
+		},
+		{
+			"name":"申请结果",
+			"path": "pagesFinance/user/chargingDetails",
+			"style": {
+			
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		
 		{
 			"name":"帮助中心",
 			"path": "pagesFinance/user/help",

+ 5 - 1
pages/login/index.vue

@@ -124,7 +124,9 @@
 				}).then((response) => {
 					var token = response ? response.data.token : '';
 					this.carhelp.setToken(token);
-					this.carhelp.setPersonInfo(response.data.regUser);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					this.carhelp.setPersonInfoPlus(response.data.data  )
+					
 					//this.gotoUrl("pages/user/index")
 					uni.redirectTo({
 						url: '/pages/index/index'
@@ -211,6 +213,8 @@
 					this.carhelp.setToken(token);
 					this.carhelp.setPersonInfo(response.data.regUser);
 					//this.gotoUrl("pages/user/index")
+					this.carhelp.setPersonInfoPlus(response.data.data  )
+					
 					uni.redirectTo({
 						url: '/pages/index/index'
 					})

+ 2 - 0
pages/user/index.vue

@@ -117,6 +117,8 @@
 					this.carhelp.setToken("");
 					this.carhelp.set("token_tdate","")
 					this.carhelp.setPersonInfo("");
+					this.carhelp.setPersonInfoPlus(""  )
+					
 					uni.reLaunch({
 						url:"/pages/login/index?phone="+this.detail.regUser.phone
 					})

+ 38 - 12
pagesFinance/detailed/details.vue

@@ -1,30 +1,30 @@
 <template>
 	<view>
-		<u-navbar title="收益详情"></u-navbar>
+		<u-navbar :title="title"></u-navbar>
 		<view class="details">
 			<view class="details-head">
 				<u-icon name="charging-pile-fill" custom-prefix="custom-icon" color="#27B148" size="48"></u-icon>
-				<h4>{{detail.deviceName}}/{{detail.deviceNo}}</h4>
+				<h4>{{detail.stationName}}/{{detail.deviceNo}}</h4>
 			</view>
 			<view class="details-main">
 				<view class="details-price">
-					<span>¥</span><h3>{{detail.shareProfitAmount}}</h3><span>元</span>
+					<span>¥</span><h3>{{iswuye?detail.costAmount:detail.shareProfitAmount}}</h3><span>元</span>
 				</view>
 				<p>本单收益</p>
 			</view>
-			<view class="details-row"><p>电费(元)</p><span>¥400.00</span></view>
-			<view class="details-row"><p>服务费(元)</p><span>¥100.00</span></view>
-			<view class="details-row"><p>桩号</p><span>A0001</span></view>
-			<view class="details-row"><p>分润标准</p><span>15%</span></view>
+			<view class="details-row" v-if="!iswuye" ><p>电费(元)</p><span>¥{{detail.costAmount}}</span></view>
+			<view class="details-row" v-if="!iswuye"><p>服务费(元)</p><span>¥{{detail.surplusAmount}}</span></view>
+			<view class="details-row" v-if="!iswuye"><p>桩号</p><span>{{detail.deviceNo}}</span></view>
+			<view class="details-row" v-if="!iswuye"><p>分润标准</p><span>{{detail.disProportion}}%</span></view>
 		</view>
 		<view class="details">
 			<view class="details-title">
 				<h4>充电详情</h4>
 			</view>
-			<view class="details-row"><p>电费(元)</p><span>¥400.00</span></view>
-			<view class="details-row"><p>服务费(元)</p><span>¥100.00</span></view>
-			<view class="details-row"><p>桩号</p><span>A0001</span></view>
-			<view class="details-row"><p>分润标准</p><span>15%</span></view>
+			<view class="details-row"><p>消费电量(kW-h)</p><span>{{detail.electricQuantity/10000}}</span></view>
+			<view class="details-row"><p>开始时间</p><span>{{detail.startTime}}</span></view>
+			<view class="details-row"><p>结束时间</p><span>{{detail.endTime}}</span></view>
+			<view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
 		</view>
 		<view class="detailsBtn">
 			<u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
@@ -39,16 +39,42 @@
 		data() {
 			return {
 				id:'',
+				
 				detail:{
 					
-				}
+				},
+				title:"",
+				iswuye:false
 			}
 		},
 		onLoad(op){
+			
+			this.title="收益详情"
+			var obj=this.carhelp.getPersonInfoPlus("merchantUser");
+			if(obj&&obj.role){
+				var  role=obj.role;
+				if(role.id=="4"){
+					this.title="电费详情"
+					this.iswuye=true;
+				}
+			}
+			
 			this.id=op.id;
 			this.getInfo()
 		},
 		methods: {
+			getPercent(estimateMinute) {
+				var value="";
+				 
+				var ms =estimateMinute
+				if (ms > 0) {
+					var Hour = parseInt(Math.floor(ms / 60 ));
+					var Fen = parseInt(Math.floor(ms % 60 ));	
+					value = Hour + "小时"  + Fen+"分钟"
+				}
+			
+				return value;
+			},
 			back(){
 				uni.navigateBack({
 					

+ 178 - 38
pagesFinance/detailed/index.vue

@@ -2,7 +2,7 @@
 	<view>
 		<u-navbar :is-back="false">
 			<view class="navbar">
-				<view class="navbar-tit">收益明细</view>
+				<view class="navbar-tit" v-text="title" >收益明细</view>
 				<view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
 			</view>
 		</u-navbar>
@@ -12,64 +12,110 @@
 					<view class="screen-item">
 						<view class="screen-head">查询日期</view>
 						<view class="screen-main">
-							<u-input v-model="value" :type="type" :border="border" @click="show = true" />
+							
+							<u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
+							
+							<u-input :value="startTime?startTime+'至'+endTime:'选择时间筛选'" :type="type" :border="border" @click="showdate = true" />
+						<!-- 	
 							<u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
-						</view>
+						 --></view>
 					</view>
 					<view class="screen-item">
 						<view class="screen-head">充电桩类型</view>
 						<view class="screen-main">
-							<view class="screen-entry active">全部</view>
-							<view class="screen-entry">自行车充电</view>
-							<view class="screen-entry">交流慢充</view>
-							<view class="screen-entry">直流快充</view>
+							<view 
+							:class="{
+								active:selecttype==''
+							}" @click="selecttype=''"
+							class="screen-entry ">全部</view>
+							<view 
+							:class="{
+								active:selecttype=='0'
+							}" @click="selecttype='0'"
+							
+							class="screen-entry type1">自行车充电</view>
+							<view 
+							:class="{
+								active:selecttype=='2'
+							}" @click="selecttype='2'"
+							class="screen-entry type3">交流慢充</view>
+							<view 
+							:class="{
+								active:selecttype=='1'
+							}" @click="selecttype='1'"
+							class="screen-entry type2">直流快充</view>
 						</view>
 					</view>
 					<view class="screen-item">
 						<view class="screen-head">站点</view>
 						<view class="screen-main">
-							<view class="screen-entry active">全部</view>
-							<view class="screen-entry">荆鹏</view>
-							<view class="screen-entry">长大</view>
+							<view class="screen-entry  "
+							:class="{
+								active:selectstationId==''
+							}"
+							 @click="selectstationId=''"
+							>全部</view>
+							<view 
+							v-for="(item,i) in stationList" :key="i"
+							:class="{
+								active:selectstationId==item.id
+							}"
+							 @click="selectstationId=item.id,selectdeviceNo=''"
+							class="screen-entry" >{{item.name}}</view>
+						
 						</view>
 					</view>
 					<view class="screen-item">
 						<view class="screen-head">桩号</view>
 						<view class="screen-main">
-							<view class="screen-entry active">全部</view>
-							<view class="screen-entry">A0001</view>
-							<view class="screen-entry">B0001</view>
-							<view class="screen-entry">A0003</view>
+							 
+							<view class="screen-entry  "
+							:class="{
+								active:selectdeviceNo==''
+							}"
+							 @click="selectdeviceNo=''"
+							>全部</view>
+							<view 
+							v-for="(item,i) in stationListSon" :key="i"
+							v-show="selectstationId?(selectstationId==item.stationId):true"
+							:class="{
+								active:selectdeviceNo==item.id
+							}"
+							
+							 @click="selectdeviceNo=item.id"
+							class="screen-entry" >{{item.name}}</view>
 						</view>
 					</view>
 				</view>
 				<view class="screen-foot">
-					<view class="screen-btn-l">重置</view>
-					<view class="screen-btn-r">确定</view>
+					<view class="screen-btn-l" @click="resetBtn" >重置</view>
+					<view class="screen-btn-r" @click="okbtn" >确定</view>
 				</view>
 			</view>
 		</u-popup>
 		<view class="detailed">
-			<template v-for="(item ,index) in list" >
-				<view class="detailed-time" :key="item.id" v-if="false">
-					<p>2020年5月1日</p>
-					<p>共收入 178.00</p>
-				</view>
-				<view class="detailed-list" 
+			
+				
+				<view class="detailed-list" v-for="(item ,index) in list"
 				@click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
-				:key="item.id">
+				:key="index">
+				<view class="detailed-time"    v-if="item.show">
+					<p>{{item.showtime}}</p>
+					<p>共收入 {{showMap.get(item.showtime)}}</p>
+				</view>
+				
 					<view class="detailed-item">
 						<view class="detailed-item-name">
 							<h4>{{item.stationName}}/{{item.deviceNo}}</h4>
 							<p>{{item.createTime}}</p>
 						</view>
 						<view class="detailed-item-num">
-							<h2>{{item.shareProfitAmount}}</h2>
+							<h2>{{iswuye?item.costAmount:item.shareProfitAmount}}</h2>
 							<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
 						</view>
 					</view>
 				</view>
-			</template>
+			
 			 
 		</view>
 		<Tabbar :current="1"></Tabbar>
@@ -79,15 +125,28 @@
 <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,
+				startTime: "",
+							
+				endTime: "",
+				selecttype:"",
+				selectstationId:"",
+				selectdeviceNo:"",
+				title:"",
+				iswuye:false,
 				form:{
 					
 				},
-				startDate:'',
-				endDate:'',
+				 
 				pageIndex: 1,
 				recordsTotal: 0,
 				list: [],
@@ -116,11 +175,14 @@
 						customIcon: true,
 					},
 				],
+				showMap:null,
 				current: 0,
 				value: '',
 				type: 'select',
 				show: false,
 				border: true,
+				stationList:[],
+				stationListSon:[],
 				actionSheetList: [
 					{
 						text: '男'
@@ -143,35 +205,98 @@
 				this.myLoadmore();
 			}
 		},
+		onLoad() {
+			this.title="收益明细"
+			var obj=this.carhelp.getPersonInfoPlus("merchantUser");
+			if(obj&&obj.role){
+				var  role=obj.role;
+				if(role.id=="4"){
+					this.title="电费明细"
+					this.iswuye=true;
+				}
+			}
+		},
 		onReady() {
 			// this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
 			// this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
 			
 			this.getList()
+			this.getStation()
 			
 		},
 		methods: {
-			getList(bl) {
+			changedate(e) {
+				this.startTime = e.startDate
+				this.endTime = e.endDate
+				
+			},
+			resetBtn(){
+				this.startTime=""
+				this.endTime=""
+				this.selecttype=""
+				this.selectstationId=""
+				this.selectdeviceNo=""
+				this.pageIndex = 1;
+				this.form = {
+					startDate:"",
+					endDate:"",
+					pageIndex: this.pageIndex,
+					type:this.selecttype,
+					stationId:this.selectstationId,
+					deviceNo:this.selectdeviceNo,
+				};
+				this.popupShow=false;
+				this.list = [];
+				this.getList()
+				
+			},
+			okbtn(){
+				this.popupShow=false;
+				this.pageIndex = 1;
+				
+				this.form = {
+					startDate:this.startTime,
+					endDate:this.endTime,
+					pageIndex: this.pageIndex,
+					type:this.selecttype,
+					stationId:this.selectstationId,
+					deviceNo:this.selectdeviceNo,
+				};
+				this.list = [];
+				this.getList()
+			},
+			getList() {
 				
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				if (bl) {
-					this.list = [];
-					this.pageIndex = 1;
-				}
-				var data = {
-					// startDate:this.startDate,
-					// endDate:this.endDate,
-					pageIndex: this.pageIndex
-				};
-				API.incomeList(data).then((res) => {
+				this.form.pageIndex=this.pageIndex
+				
+				API.incomeList(this.form).then((res) => {
 					
 					this.list = [
 						...this.list,
 						...res.data.data
 					];
+					var showMap=new Map()
+					this.list.forEach(item=>{
+						var ktime=item.createTime.split(" ")[0]
+						if(showMap.has(ktime)){
+							item.show=false;
+						
+							
+						}else{
+							var Amount=this.iswuye?item.todayCostAmount:item.todaySPAmount
+							
+							showMap.set(ktime,Amount)
+							
+							item.show=true;
+							item.showtime=ktime;
+						}
+					})
+					
+					this.showMap=showMap;
 					this.recordsTotal = res.data.recordsTotal
 					uni.hideLoading()
 					
@@ -182,10 +307,25 @@
 					})
 				})
 			},
+		
+			getStation(bl) {
+				
+				API.stationList().then((res) => {
+					
+					this.stationList = res.data.stationList
+					this.stationListSon=res.data.deviceList	
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error
+					})
+				})
+			},
 			myLoadmore() {
 					
 				this.pageIndex += 1;
 				this.getList()
+				
 			},
 			// 点击actionSheet回调
 			actionSheetCallback(index) {

+ 2 - 1
pagesFinance/login/index.vue

@@ -185,7 +185,8 @@
 			loginset(response){
 				var token = response ? response.data.token : '';
 				this.carhelp.setToken(token,"merchantUser");
-				this.carhelp.setPersonInfo(response.data.regUser,"merchantUser");
+				this.carhelp.setPersonInfo(response.data.user,"merchantUser");
+				this.carhelp.setPersonInfoPlus(response.data, "merchantUser")
 				//this.gotoUrl("pages/user/index")
 				uni.redirectTo({
 					url: '/pagesFinance/statistics/index'

+ 104 - 63
pagesFinance/statistics/index.vue

@@ -1,20 +1,21 @@
 <template>
 	<view>
 		<u-navbar :is-back="false" :border-bottom="false" :background="background">
-			<view class="navbar-tit">收益统计</view>
+			<view class="navbar-tit">{{title}}</view>
 		</u-navbar>
-		<view class="statisticsData">
+		<view class="statisticsData" v-if="!iswuye">
 			<view class="statisticsData-item">
-				<view class="statisticsData-head">
-					<p>今日充电收益(元)</p>
-					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
+				<view class="statisticsData-head" @click="gotoUrl('pagesFinance/detailed/index')">
+					<p>今日充电收益(元)</p>
+					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="24"></u-icon>
+					
 				</view>
 				<view class="statisticsData-main">
-					<h2>1141.00</h2>
+					<h2>{{indexData.todayAmount}}</h2>
 				</view>
 				<view class="statisticsData-foot">
 					<p>昨日收益</p>
-					<h4>1024.00</h4>
+					<h4>{{indexData.yesterdayAmount}}</h4>
 				</view>
 			</view>
 			<view class="statisticsData-item">
@@ -22,17 +23,47 @@
 					<p>今日充电单量(笔)</p>
 				</view>
 				<view class="statisticsData-main">
-					<h2>230</h2>
+					<h2>{{indexData.todayNum}}</h2>
 				</view>
 				<view class="statisticsData-foot">
 					<p>累计收益</p>
-					<h4>10691.00</h4>
+					<h4>{{indexData.withdrawnAmount}}</h4>
 				</view>
 			</view>
-		</view>
+		</view>
+		
+		<view class="statisticsData" v-if="iswuye">
+			<view class="statisticsData-item">
+				<view class="statisticsData-head"  @click="gotoUrl('pagesFinance/detailed/index')" >
+					<p>今日充电电费(元)</p>
+					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="24"></u-icon>
+				</view>
+				<view class="statisticsData-main">
+					<h2>{{indexData.todayCost}}</h2>
+				</view>
+				<view class="statisticsData-foot">
+					<p>昨日电费</p>
+					<h4>{{indexData.yesterdayCost}}</h4>
+				</view>
+			</view>
+			<view class="statisticsData-item">
+				<view class="statisticsData-head">
+					<p>今日充电度数(kW/h)</p>
+				</view>
+				<view class="statisticsData-main">
+					<h2>{{indexData.todayElectricity/10000}}</h2>
+				</view>
+				<view class="statisticsData-foot">
+					<p>累计收益</p>
+					<h4>{{indexData.withdrawnAmount}}</h4>
+				</view>
+			</view>
+		</view>
+		
 		<view class="statisticsChart">
 			<view class="statisticsChart-head">
-				<h4>充电桩收益占比</h4>
+				<h4 v-if="!iswuye">充电桩收益占比</h4>
+				<h4 v-if="iswuye">充电桩电费占比</h4>
 				<view class="statisticsChart-time">
 					<u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
 					<p @click="showdate = true">{{startTime}} 至 {{endTime}}</p>
@@ -41,7 +72,7 @@
 				</view>
 			</view>
 			<view class="statisticsChart-main">
-				<u-subsection :list="subsection" @change="changedate" :current="1" button-color="#2E7Dff"
+				<u-subsection :list="subsection" @change="changesub" :current="current" button-color="#2E7Dff"
 					active-color="#fff"></u-subsection>
 				<view id="pieEcharts" style="min-height:250px;">
 
@@ -65,11 +96,13 @@
 	} from '@/utils'
 	export default {
 		data() {
-			return {
+			return {
+				title:"",
 				showdate: false,
 				startTime: "",
+				indexData:{},
+				endTime: "",
 				myChart: null,
-				endTime: "",
 				subsection: [{
 						name: '金额'
 					},
@@ -105,11 +138,20 @@
 				current: 0,
 				background: {
 					background: 'none'
-				},
+				},
+				iswuye:false,
 			}
 		},
-		onLoad() {
-
+		onLoad() {
+			this.title="收益统计"
+			var obj=this.carhelp.getPersonInfoPlus("merchantUser");
+			if(obj&&obj.role){
+				var  role=obj.role;
+				if(role.id=="4"){
+					this.title="电费统计"
+					this.iswuye=true;
+				}
+			}
 		},
 		components: {
 			Tabbar
@@ -118,56 +160,55 @@
 		onReady() {
 			this.startTime = parseUnixTime(beforeTimeStamp(7), '{y}-{m}-{d}')
 			this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
-			this.getPie([{
-					value: 1048,
-					name: '数据1'
-				},
-				{
-					value: 735,
-					name: '数据2'
-				},
-				{
-					value: 580,
-					name: '数据3'
-				},
-				{
-					value: 484,
-					name: '数据4'
-				},
-				{
-					value: 300,
-					name: '数据5'
-				}
-			])
+			this.getData()
 		},
-		methods: {
+		methods: {
+			getData(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				//this.form.pageIndex=this.pageIndex
+				
+				API.spIncomeStatistics(this.iswuye,{
+					startDate:this.startTime,
+					endDate:this.endTime 
+				}).then((res) => {
+					
+					this.indexData = res.data
+					this.getPie()
+					
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error
+					})
+				})
+			},
+			changesub(e){
+				console.log(e)
+				this.current=e
+				this.getPie()
+			},
 			changedate(e) {
 				this.startTime = e.startDate
 				this.endTime = e.endDate
-
-				this.getPie([{
-						value: 48,
-						name: '数据1'
-					},
-					{
-						value: 35,
-						name: '数据2'
-					},
-					{
-						value: 80,
-						name: '数据3'
-					},
-					{
-						value: 84,
-						name: '数据4'
-					},
-					{
-						value: 100,
-						name: '数据5'
-					}
-				])
+				this.getData()
+				 
 			},
-			getPie(getData) {
+			getPie() {
+				var list=this.indexData.pieChart;
+				var getData=[];
+				list.forEach(item=>{
+					 var value=(this.iswuye?(item.electricity/10000):item.amountNums)
+					getData.push({
+						value: this.current?value:item.amount,
+						name: item.deviceName
+					})
+				})
+				
 				if (!this.myChart) {
 					this.myChart = echarts.init(document.getElementById('pieEcharts'));
 
@@ -184,7 +225,7 @@
 						left: 'center'
 					},
 					series: [{
-						name: 'Access From',
+						//name: 'Access From',
 						type: 'pie',
 						radius: '50%',
 						data: getData,

+ 10 - 3
pagesFinance/user/applyResult.vue

@@ -4,7 +4,7 @@
 		<view class="applyResult">
 			<u-icon name="chenggong" custom-prefix="custom-icon" color="#27B148" size="150"></u-icon>
 			<h3>申请成功</h3>
-			<p>申请提现 ¥1000.00元</p>
+			<p v-if="value">申请提现 ¥{{value}}元</p>
 		</view>
 		<view class="applySpeed">
 			<view class="applySpeed-item">
@@ -17,7 +17,7 @@
 			</view>
 		</view>
 		<view class="applyBtn">
-			<u-button class="applyBtn-btn" type="primary">完成</u-button>
+			<u-button class="applyBtn-btn" type="primary" @click="back">完成</u-button>
 		</view>
 	</view>
 </template>
@@ -28,14 +28,21 @@
 	export default {
 		data() {
 			return {
+				value:0,
 				form: {
 					name: '',
 					intro: '',
 				},
 			}
+		},onLoad(op) {
+			if(op.value){
+				this.value=op.value
+			}
 		},
 		methods: {
-
+			back(){
+				uni.navigateBack()
+			}
 		}
 	}
 </script>

+ 299 - 0
pagesFinance/user/chargingDetails.vue

@@ -0,0 +1,299 @@
+<template>
+	<view >
+		<u-navbar title="充电价格详情"></u-navbar>
+		
+ <!-- 主体 -->
+<!-- 充电桩信息 -->
+       <view class="main">
+		   
+	    <!-- 收费标准 -->
+		<view class="rates">
+			<view class="rates-title">
+				<view class="title-left">
+					收费标准
+				</view>
+				<view class="title-right">
+					峰谷平电价计费
+				</view>
+				
+			</view>
+			<!-- 时段分类 -->
+		<view class="time-rates">
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						00:00-07:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						00:70-09:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						09:00-15:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						15:00-20:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						20:00-22:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						22:00-23:00
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			<view class="time-part">
+				<view class="part-top">
+					<view class="time">
+						23:00-23:59
+					</view>
+					<view class="price">
+						
+						<text class="price-number">1.2500</text>
+						<text class="price-unit">元/度</text>
+					</view>
+				</view>
+				<view class="part-bottom">
+					<view class="unitPrice-servicePrice">
+						充电单价:¥1.0000 | 服务费:¥0.2500
+					</view>
+				</view>
+			</view>
+			
+			
+		</view>
+
+		</view >
+			
+		 
+	   </view>
+<!-- 底部按钮 -->
+ 
+	</view>
+	
+	
+</template>
+<script>
+	export default {
+		data() {
+		return{
+			
+			description: '温馨提示:充电前请确保您的车辆已与充电桩连接!并关闭车内电源。'
+		}
+		}
+	}
+</script>
+
+
+<style lang="scss">
+	// 头部
+	.title {
+		width: 100%;
+		line-height: 44px;
+		background-color: rgba(255, 255, 255, 100);
+		text-align: center;
+		border: 1px solid rgba(242, 242, 242, 100);
+		position: fixed;
+		top: 0;
+		
+	}
+	
+	// 主体
+	.main{
+		width: 100%;
+		margin-top: 44px;
+		// margin-bottom: 64px;
+		//padding-bottom: 234px;
+		.main-detail{
+			display: flex;
+			justify-content: space-between;
+			padding: 14px 16px 0 0;
+			height: 48px;
+			line-height: 48px;
+			background-color: #fff;
+			border-bottom: 1px solid rgba(242, 242, 242, 100);
+			.detail-name{
+               margin-left: 16px;
+				height: 20px;
+				line-height: 23px;
+				color: rgba(102, 102, 102, 100);
+				font-size: 14px;
+				
+			}
+			.detail-content{
+				height: 23px;
+				line-height: 23px;
+				color: rgba(51, 51, 51, 100);
+				font-size: 14px;
+				
+			}
+		}
+		// 收费标准
+	   .rates{
+		   width: 100%;
+		   background-color: #fff;
+		   margin-top: 12px;
+		   .rates-title{
+			   display: flex;
+			   justify-content: space-between;
+			   height: 48px;
+			   line-height: 48px;
+			   padding: 0px 16px 0 ;
+			   border-bottom: 1px solid rgba(242, 242, 242, 100);
+		   }
+		   .time-part{
+			   width: 100%;
+			   .part-top{
+				   display: flex;
+				   justify-content: space-between;
+				   padding: 16px;
+				   .time{
+					   color: rgba(16, 16, 16, 100);
+					   font-size: 16px;
+				   }
+				   .price{
+					   .price-number{
+						   color: rgba(255, 61, 0, 100);
+						   font-size: 18px;
+						   text-align: right;
+						   font-family: Roboto-regular;
+						   display: inline-block;
+						   height: 20px;
+						   font-weight: 600;
+					   }
+					   .price-unit{
+						   color: rgba(102, 102, 102, 100);
+						   font-size: 14px;
+						   text-align: right;
+						   margin-left: 4px;
+						   display: inline-block;
+						   height: 20px;
+					   }
+				   }
+			   }
+			   .part-bottom{
+				   .unitPrice-servicePrice{
+					   eight: 18px;
+					   color: rgba(136, 136, 136, 100);
+					   font-size: 12px;
+					   text-align: right;
+					   padding-right: 16px;
+					   padding-bottom: 18px;
+				   }
+			   }
+		   }
+	   }
+	 .tips{
+		
+		 font-size: 12px;
+		 margin-top: 24px;
+		 /deep/.u-alert-desc[data-v-4d234687]{
+		 			 font-size: 12px
+		 }
+	 }
+	}
+	
+	// 尾部
+	.bottom{
+		background-color: #fff;;
+		width: 100%;
+		height: 64px;
+		line-height: 64px;
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		z-index:999;
+		padding: 12px 16px;
+		.botton{
+			width: 343px;
+			height: 40px;
+			line-height: 40px;
+			border-radius: 50px;
+			background-color: rgba(0, 185, 98, 100);
+			color: rgba(255, 255, 255, 100);
+			font-size: 16px;
+			text-align: center;
+			margin: 0 auto;
+		}
+		
+	}
+</style>

+ 63 - 11
pagesFinance/user/deviceDetails.vue

@@ -5,24 +5,30 @@
 			<view class="details-title">
 				<h4>充电桩分润信息</h4>
 			</view>
-			<view class="details-row"><p>所属站点</p><span>荆鹏软件园充电站</span></view>
-			<view class="details-row"><p>桩号</p><span>A0001</span></view>
-			<view class="details-row"><p>充电桩类型</p><span>直流快充</span></view>
-			<view class="details-row"><p>设备状态</p><span>正常运行</span></view>
-			<view class="details-row"><p>我的身份</p><span>市场服务</span></view>
-			<view class="details-row"><p>分润标准</p><span>15%</span></view>
+			<view class="details-row"><p>所属站点</p><span>{{detail.stationName}}</span></view>
+			<view class="details-row"><p>桩号</p><span>{{detail.deviceNo}}</span></view>
+			<view class="details-row"><p>充电桩类型</p><span v-if="detail.type">{{options0[detail.type].label}}</span></view>
+			<view class="details-row"><p>设备状态</p><span>{{detail.online?'在线':'离线'}}</span></view>
+			<view class="details-row"><p>我的身份</p><span>{{detail.roleName}}</span></view>
+			<view class="details-row"><p>分润标准</p><span>{{detail.disProportion}}%</span></view>
+		<view class="details-row"><p>收费标准(元/度)</p><span
+		 style="
+		     color: #5a8eef;
+		 "
+		 @click="gotoUrl('pagesFinance/user/chargingDetails?id='+id)" >查看详情</span></view>
+		
+		
 		</view>
-		<view class="details">
+		<!-- <view class="details">
 			<view class="details-title">
 				<h4>设备相关信息</h4>
 			</view>
 			<view class="details-row"><p>设备型号</p><span>HCD0001-A</span></view>
 			<view class="details-row"><p>初次安装时间</p><span>2022-05-01</span></view>
-			<view class="details-row"><p>收费标准(元/度)</p><span>1.5</span></view>
 			<view class="details-row"><p>输出功率范围(瓦)</p><span>100-400</span></view>
-		</view>
+		</view> -->
 		<view class="detailsBtn">
-			<u-button class="detailsBtn-btn" type="primary" plain>返回</u-button>
+			<u-button class="detailsBtn-btn" type="primary" @click="back" plain>返回</u-button>
 		</view>
 	</view>
 </template>
@@ -33,14 +39,60 @@
 	export default {
 		data() {
 			return {
+				id:'',
+				
+				detail:{
+					
+				},
+				options0: [
+					
+					{
+						label: '自行车充电',
+						value: 0,
+					},
+					
+					{
+						label: '直流快充',
+						value: 1,
+					},
+					{
+						label: '交流慢充',
+						value: 2,
+					},
+				],
 				form: {
 					name: '',
 					intro: '',
 				},
 			}
 		},
+		onLoad(op){
+			
+			this.id=op.id;
+			this.getInfo()
+		},
 		methods: {
-
+			back(){
+				uni.navigateBack()
+			},
+			getInfo(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				API.deviceDetail({
+					deviceId:this.id
+				}).then((res) => {
+					this.detail=res.data.device	 
+					
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
 		}
 	}
 </script>

+ 156 - 30
pagesFinance/user/deviceList.vue

@@ -3,22 +3,34 @@
 		<u-navbar title="我的设备"></u-navbar>
 		<view class="deviceDropdown">
 			<u-dropdown>
-				<u-dropdown-item v-model="value1" title="充电桩类型" :options="options1"></u-dropdown-item>
-				<u-dropdown-item v-model="value2" title="所属站点" :options="options2"></u-dropdown-item>
-				<u-dropdown-item v-model="value3" title="运行状态" :options="options3"></u-dropdown-item>
+				<u-dropdown-item v-model="value1" @change="change1" title="充电桩类型" :options="options1"></u-dropdown-item>
+				<u-dropdown-item v-model="value2" @change="change2" title="所属站点" :options="options2"></u-dropdown-item>
+				<u-dropdown-item v-model="value3" @change="change3" title="运行状态" :options="options3"></u-dropdown-item>
 			</u-dropdown>
 		</view>
-		<view class="deviceList">
-			<view class="deviceList-item deviceList-bg1">
-				<view class="deviceList-head">荆鹏软件园充电站</view>
-				<view class="deviceList-main">A0001</view>
+		<view class="deviceList"
+		
+		>
+			<view v-for="(item ,index) in list" :key="item.id"
+			@click="gotoUrl('pagesFinance/user/deviceDetails?id='+item.id)"
+			:class="{
+				'deviceList-bg1':item.type==1,
+				'deviceList-bg2':item.type==2,
+				'deviceList-bg3':item.type==0
+				
+			}"
+			class="deviceList-item " >
+				<view class="deviceList-head">{{item.name}}</view>
+				<view class="deviceList-main">{{item.deviceNo}}</view>
 				<view class="deviceList-foot">
-					<view class="deviceList-label">直流快充</view>
-					<view class="deviceList-label">正常运行</view>
-					<view class="deviceList-label">市场服务 70%</view>
+					<view class="deviceList-label">{{ options0[item.type].label}}</view>
+					<view class="deviceList-label" 
+					:style="item.online?'':'color:red'"
+					>{{item.online?'在线':'离线'}}</view>
+					<view class="deviceList-label">{{item.roleName}}</view>
 				</view>
 			</view>
-			<view class="deviceList-item deviceList-bg2">
+		<!-- 	<view class="deviceList-item deviceList-bg2">
 				<view class="deviceList-head">荆鹏软件园充电站</view>
 				<view class="deviceList-main">A0001</view>
 				<view class="deviceList-foot">
@@ -35,7 +47,7 @@
 					<view class="deviceList-label">正常运行</view>
 					<view class="deviceList-label">市场服务 70%</view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 	</view>
 </template>
@@ -46,44 +58,158 @@
 	export default {
 		data() {
 			return {
-				value1: 1,
-				value2: 2,
-				value3: 3,
-				options1: [{
-						label: '默认排序',
-						value: 1,
+				form: {
+				
+				},
+				startDate:'',
+				endDate:'',
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
+				value1: -1,
+				value2: -1,
+				value3: -1,
+				stationList:[],
+				options0: [
+					{
+							label: '全部',
+							value: -1,
+						},
+					{
+						label: '自行车充电',
+						value: 0,
 					},
 					{
-						label: '距离优先',
+						label: '交流慢充',
 						value: 2,
 					},
 					{
-						label: '价格优先',
-						value: 3,
+						label: '直流快充',
+						value: 1,
 					}
 				],
-				options2: [{
-						label: '去冰',
-						value: 1,
+				options1: [{
+						label: '全部',
+						value: '-1',
 					},
 					{
-						label: '加冰',
+						label: '自行车充电',
+						value: 0,
+					},
+					{
+						label: '交流慢充',
 						value: 2,
 					},
+					{
+						label: '直流快充',
+						value: 1,
+					}
 				],
-				options3: [{
-						label: '去冰',
+				options2: [
+				],
+				options3: [
+					{
+						label: '全部',
+						value: -1,
+					},
+					{
+						label: '在线',
 						value: 1,
 					},
 					{
-						label: '加冰',
-						value: 2,
+						label: '离线',
+						value: 0,
 					},
 				],
 			}
 		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
 		methods: {
-
+			change1(e){
+				this.form.type=e
+				if(e==-1){
+					this.form.type=""
+				}
+				this.getList(true)
+			},
+			change2(e){
+				this.form.stationId=e
+				if(e==-1){
+					this.form.stationId=""
+				}
+				this.getList(true)
+			},
+			change3(e){
+				this.form.onlineStatus=e
+				if(e==-1){
+					this.form.onlineStatus=""
+				}
+				this.getList(true)
+			},
+			getStation() {
+				
+				API.stationList().then((res) => {
+					this.options2.push({
+						label: '全部',
+						value:-1,
+					})
+					this.stationList = res.data.stationList
+					this.stationList.forEach(item=>{
+						this.options2.push({
+							label: item.name,
+							value: item.id,
+						})
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error
+					})
+				})
+			},
+		myLoadmore() {
+
+				this.pageIndex += 1;
+				this.getList()
+			},
+			getList(bl) {
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.list = [];
+					this.pageIndex = 1;
+				}
+				this.form.pageIndex= this.pageIndex
+				
+				API.devicesList(this.form).then((res) => {
+
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+
+				}).catch(error => {
+					uni.showToast({
+
+						title: error
+					})
+				})
+			},
+			onReady() {
+				this.getStation()
+				this.getList()
+				
+			}
 		}
 	}
 </script>

+ 24 - 18
pagesFinance/user/help.vue

@@ -2,9 +2,9 @@
 	<view>
 		<u-navbar title="帮助中心"></u-navbar>
 		<view class="collapse">
-			<u-collapse>
-				<u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index">
-					{{item.body}}
+			<u-collapse v-if="itemList.length">
+				<u-collapse-item :title="item.title" v-for="(item, index) in itemList" :key="index">
+					{{item.content}}
 				</u-collapse-item>
 			</u-collapse>
 		</view>
@@ -17,24 +17,30 @@
 	export default {
 		data() {
 			return {
-				itemList: [{
-					head: "赏识在于角度的转换",
-					body: "只要我们正确择取一个合适的参照物乃至稍降一格去看待他人,值得赏识的东西便会扑面而来",
-					open: true,
-					disabled: true
-				},{
-					head: "生活中不是缺少美,而是缺少发现美的眼睛",
-					body: "学会欣赏,实际是一种积极生活的态度,是生活的调味品,会在欣赏中发现生活的美",
-					open: false,
-				},{
-					head: "周围一些不起眼的人、事、物,或许都隐藏着不同凡响的智慧",
-					body: "但是据说雕刻大卫像所用的这块大理石,曾被多位雕刻家批评得一无是处,有些人认为这块大理石采凿得不好,有些人嫌它的纹路不够美",
-					open: false,
-				}],
+				itemList: [],
 			}
 		},
+		onReady() {
+			this.getHomePage()
+		},
 		methods: {
-
+		getHomePage(){
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					API.helpList().then((res) => {
+						this.itemList = res.data.helpList
+					
+					
+						uni.hideLoading()
+						
+					}).catch(error => {
+						uni.showToast({
+							title: error
+						})
+					})
+				}
 		}
 	}
 </script>

+ 116 - 22
pagesFinance/user/index.vue

@@ -5,77 +5,77 @@
 				<u-avatar src="../../assets/img/head.png" size="140"></u-avatar>
 			</view>
 			<view class="userHead-text">
-				<h3>张建军</h3>
+				<h3>{{info.realName}}</h3>
 				<view class="userHead-text-position">
 					<u-icon name="account-pin-box-fill" custom-prefix="custom-icon" color="#fff" size="32"></u-icon>
-					<p>市场服务</p>
+					<p>{{role.name}}</p>
 				</view>
 			</view>
 		</view>
 		<view class="userData">
 			<view class="userData-item">
-				<view class="userData-data">15</view>
-				<view class="userData-foot">我的充电桩</view>
+				<view class="userData-data">{{home.deviceNumbers}}</view>
+				<view class="userData-foot" @click="gotoUrl('pagesFinance/user/deviceList')" >我的充电桩</view>
 			</view>
 			<u-line color="#d9e0ec" length="60" direction="col" margin="10px"/>
 			<view class="userData-item">
-				<view class="userData-name">微信商家账户</view>
-				<view class="userData-foot">提现账户</view>
+				<view class="userData-name">银行账户</view>
+				<view class="userData-foot" @click="showModel"  >提现账户</view>
 			</view>
 		</view>
 		
 		<view class="userInfo">
 			<view class="userInfo-head"><p>可提现金额</p></view>
 			<view class="userInfo-main">
-				<h2>19854.14</h2>
-				<view class="userInfo-btn">帐户提现</view>
+				<h2>{{home.accountBalance}}</h2>
+				<view class="userInfo-btn" @click="gotoUrl('pagesFinance/user/withdraw')">帐户提现</view>
 			</view>
 			<view class="userInfo-foot">
-				<view class="userInfo-item">
+				<!-- <view class="userInfo-item">
 					<p>今日收益</p>
-					<h4>957.00</h4>
-				</view>
+					<h4>{{home.todayAmount}}</h4>
+				</view> -->
 				<view class="userInfo-item">
-					<p>累计收益</p>
-					<h4>11957.00</h4>
+					<p>冻结金额(提现中)</p>
+					<h4>{{home.waitingAmount}}</h4>
 				</view>
 				<view class="userInfo-item">
 					<p>已提现</p>
-					<h4>10000.00</h4>
+					<h4>{{home.withdrawnAmount}}</h4>
 				</view>
 			</view>
 		</view>
 		
 		<view class="userCell">
-			<view class="userCell-item">
+			<view class="userCell-item" @click="gotoUrl('pagesFinance/user/withdrawRecord')">
 				<view class="userCell-title">
 					<u-icon name="refund-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
 					<p>提现记录</p>
 				</view>
 				<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
 			</view>
-			<view class="userCell-item">
+			<view class="userCell-item" @click="gotoUrl('pagesFinance/user/help')" >
 				<view class="userCell-title">
 					<u-icon name="question-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
 					<p>帮助中心</p>
 				</view>
 				<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
 			</view>
-			<view class="userCell-item">
+			<view class="userCell-item"  @click="phone()" >
 				<view class="userCell-title">
 					<u-icon name="customer-service-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
 					<p>联系客服</p>
 				</view>
-				<span>0716-8123456</span>
+				<span>{{tel}}</span>
 			</view>
-			<view class="userCell-item">
+			<!-- <view class="userCell-item"  @click="gotoUrl('pagesFinance/user/about')">
 				<view class="userCell-title">
 					<u-icon name="information-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
 					<p>关于小鹏管家</p>
 				</view>
 				<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
-			</view>
-			<view class="userCell-item">
+			</view> -->
+			<view class="userCell-item" @click="logout" >
 				<view class="userCell-title">
 					<u-icon name="logout-box-r-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
 					<p>帐号登出</p>
@@ -91,10 +91,16 @@
 <script>
 	import Tabbar from '@/components/TabbarFinance.vue'
 	import * as API from '@/apis/finance.js'
+	import {
+		substrMb
+	} from '@/utils'
 	
 	export default {
 		data() {
 			return {
+				
+				tel:'400-8899-619',
+				role:{},
 				info:{},
 				home:{},
 				current: 0,
@@ -109,10 +115,98 @@
 		},
 		onLoad() {
 			this.info=this.carhelp.getPersonInfo("merchantUser")
+			var obj=this.carhelp.getPersonInfoPlus("merchantUser");
+			if(obj&&obj.role){
+				this.role=obj.role;
+			}
+			
+			
 			console.log(this.info)
 		},
+		onReady() {
+			this.getHomePage()
+		},
+		onShow() {
+			this.getHomePage()
+		},
 		methods: {
-
+			showModel(){
+				var bankCard="";
+				if(this.home.bankCard){
+					bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,8,4)
+				}
+				var code=this.home.bank+":"+bankCard;
+				if(this.home.bank==null&&this.home.bankCard==null){
+					code="未绑定"
+				}
+				uni.showModal({
+					showCancel:false,
+					content:code,
+					
+				})
+			},
+			logoutApi(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var data = {
+					
+				};
+				 
+				API.logout(data).then((res) => {
+					this.carhelp.setToken("","merchantUser");
+					this.carhelp.set("merchantUser_token_tdate","")
+					this.carhelp.setPersonInfo("","merchantUser");
+					this.carhelp.setPersonInfoPlus("" ,"merchantUser" )
+					
+					uni.reLaunch({
+						url:"/pagesFinance/login/index?phone="+this.info.phone
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			logout(){
+				uni.showModal({
+				    title: '提示',
+				    content: '确认是否退出?',
+				    success: res=> {
+				        if (res.confirm) {
+				           //付钱  改为组件
+				           this.logoutApi();
+				           
+				        } else if (res.cancel) {
+				            console.log('用户点击取消');
+				        }
+				    }
+				});
+			},
+			phone(){
+				uni.makePhoneCall({
+				    phoneNumber:this.tel //仅为示例
+				});
+			},
+			getHomePage(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.homePage().then((res) => {
+					this.home = res.data
+				
+				
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			}
 		}
 	}
 </script>

+ 71 - 7
pagesFinance/user/withdraw.vue

@@ -3,7 +3,7 @@
 		<u-navbar title="提现"></u-navbar>
 		<view class="withdraw">
 			<view class="withdraw-head">
-				<p>提现至</p><span>微信商家账户</span>
+				<p>提现至</p><span>{{code}}</span>
 			</view>
 			<view class="withdraw-main">
 				<p>申请提现金额(元)</p>
@@ -13,12 +13,12 @@
 				</view>
 			</view>
 			<view class="withdraw-foot">
-				<p>可提现余额 ¥1000</p>
-				<span>全部提现</span>
+				<p>可提现余额 ¥{{home.accountBalance}}</p>
+				<span @click="value=home.accountBalance">全部提现</span>
 			</view>
 		</view>
 		<view class="applyBtn">
-			<u-button class="applyBtn-btn" type="primary">申请提现,7日内到账</u-button>
+			<u-button class="applyBtn-btn" @click="submit()" type="primary">申请提现,7日内到账</u-button>
 		</view>
 		<view class="withdraw-tips">
 			<h4>提现说明:</h4>
@@ -29,16 +29,80 @@
 
 <script>
 	import * as API from '@/apis/finance.js'
-	
+	import {
+		substrMb
+	} from '@/utils'
 	export default {
 		data() {
 			return {
+				code:"",
 				value: '',
-				type: 'text',
+				type: 'number',
+					home:{
+						accountBalance:0
+					},
 			}
 		},
+		onReady() {
+			
+			this.getHomePage()
+		},
+		onShow(){
+			this.getHomePage()
+		},
 		methods: {
-
+			submit(){
+				if(this.value>0&&this.value<this.home.accountBalance){
+					
+				}else{
+					uni.showToast({
+						title: "请输入正确的金额"
+					})
+					return 
+				}
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.applyWithdraw({
+					amount:this.value
+				}).then((res) => {
+					
+						uni.redirectTo({
+							url:"/pagesFinance/user/applyResult?value="+this.value
+						})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			},
+			getHomePage(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.homePage().then((res) => {
+					this.home = res.data
+					var bankCard="";
+					if(this.home.bankCard){
+						bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,8,4)
+					}
+					this.code=this.home.bank+":"+bankCard;
+					if(this.home.bank==null&&this.home.bankCard==null){
+						this.code="未绑定"
+					}
+					
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			}
 		}
 	}
 </script>

+ 71 - 47
pagesFinance/user/withdrawRecord.vue

@@ -2,62 +2,31 @@
 	<view>
 		<u-navbar title="提现记录"></u-navbar>
 		<view class="detailed">
-			<view class="detailed-time">
-				<p>2020年5月1日</p>
-				<p>共提现 3000.00</p>
-			</view>
-			<view class="detailed-list">
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<view class="u-flex">
-							<h4>提现</h4> <span class="success">(提现成功)</span>
-						</view>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>1000.00</h2>
-					</view>
-				</view>
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<view class="u-flex">
-							<h4>提现</h4> <span class="error">(待转账)</span>
-						</view>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>2000.00</h2>
-					</view>
+		
+			<view class="detailed-list"  
+			:key="index" 
+			v-for="(item ,index) in list" >
+				<view class="detailed-time"  v-if="item.show">
+					<p>{{item.showtime}}</p>
+					<p>共提现 {{showMap.get(item.showtime)}}</p>
 				</view>
-			</view>
-			<view class="detailed-time">
-				<p>2020年5月1日</p>
-				<p>共提现 3000.00</p>
-			</view>
-			<view class="detailed-list">
 				<view class="detailed-item">
 					<view class="detailed-item-name">
 						<view class="u-flex">
-							<h4>提现</h4> <span class="success">(提现成功)</span>
+							<h4>提现</h4>
+							 <span v-if="item.status==1" class="success">(提现成功)</span>
+							 <span v-if="item.status==0" class="error">(待转账)</span>
 						</view>
-						<p>05-01 12:00</p>
+						<p>{{item.createTime}}</p>
 					</view>
 					<view class="detailed-item-num">
-						<h2>1000.00</h2>
-					</view>
-				</view>
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<view class="u-flex">
-							<h4>提现</h4> <span class="error">(待转账)</span>
-						</view>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>2000.00</h2>
+						<h2>{{item.applicationAmount}}</h2>
 					</view>
 				</view>
+			
 			</view>
+			
+		 
 		</view>
 	</view>
 </template>
@@ -68,14 +37,69 @@
 	export default {
 		data() {
 			return {
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
 				form: {
 					name: '',
 					intro: '',
 				},
+				showMap:null,
+			 
+			}
+		},
+		onReady() {
+			this.getList()
+		},
+		
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {
+				this.myLoadmore();
 			}
 		},
 		methods: {
-
+			getList() {
+			
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				
+				API.withdrawRecord({
+					pageIndex:this.pageIndex
+				}).then((res) => {
+					
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					
+					var showMap=new Map()
+					this.list.forEach(item=>{
+						var ktime=item.createTime.split(" ")[0]
+						if(showMap.has(ktime)){
+							item.show=false;
+							var m=showMap.get(ktime)+item.applicationAmount;
+							showMap.set(ktime,m)
+						}else{
+							showMap.set(ktime,item.applicationAmount)
+							
+							item.show=true;
+							item.showtime=ktime;
+						}
+					})
+					this.showMap=showMap;
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error
+					})
+				})
+			},
 		}
 	}
 </script>

+ 19 - 3
utils/mixin.js

@@ -7,7 +7,14 @@ var app = {
 
 	set : (key, value) => uni.setStorageSync(prefix + key, value),
 	remove: key =>  uni.removeStorageSync(prefix + key),
-	
+	getPersonInfoPlus : (jp_identity) => {
+		if(jp_identity){
+			 return uni.getStorageSync(prefix +jp_identity+ '_personInfoPlus')
+		}else{
+			 return uni.getStorageSync(prefix + 'personInfoPlus')
+		}
+		
+	},
 	getPersonInfo : (jp_identity) => {
 		if(jp_identity){
 			
@@ -22,7 +29,7 @@ var app = {
 	signOut:()=>  uni.removeStorageSync(prefix  + 'personInfo'),
 	getOpenId : () =>   uni.getStorageSync(prefix + 'wx_openId'),
 
-	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId', value),
+	setOpenId: (value) => uni.setStorageSync(prefix + 'wx_openId', value),
 	setPersonInfo : (value,jp_identity) =>{
 		
 		if(jp_identity){
@@ -33,7 +40,16 @@ var app = {
 			
 		}
 	},
-	
+	setPersonInfoPlus : (value,jp_identity) =>{
+		
+		if(jp_identity){
+			uni.setStorageSync(prefix + jp_identity+'_personInfoPlus', value)
+			
+		}else{
+			uni.setStorageSync(prefix + 'personInfoPlus', value)
+			
+		}
+	},
 	getToken : (options) => {
 		//不同权限 ,不同token
 		if(options&&options.jp_identity){

+ 13 - 3
utils/request.js

@@ -56,8 +56,14 @@ const request = (options) => {
 			if (res.data.code == 200&&res.data.result) {
 				
 				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser,options.jp_identity );
-				
+				 if(options&&options.jp_identity){
+					 carhelp.setPersonInfo(res.data.data.user ,options.jp_identity );
+					 
+				 }else{
+					 carhelp.setPersonInfo(res.data.data.regUser );
+					 
+				 }
+				 carhelp.setPersonInfoPlus(res.data.data ,options.jp_identity )
 				carhelp.setToken(token,options.jp_identity);
 				
 				options.token=token
@@ -74,7 +80,11 @@ const request = (options) => {
 					url="/pagesFinance/login/index"
 				}
 				
-				url+="?message=请登录&back="+ backurl+"&phone="+options.data.phone
+				url+="?message=请登录&back="+ backurl
+				if(options.data.phone){
+					url+="&phone="+options.data.phone
+					
+				}
 				carhelp.signOut()
 				uni.redirectTo({
 					url:url