zhengkaixin 3 éve
szülő
commit
44473b57ce

+ 1 - 1
.env.js

@@ -1,5 +1,5 @@
 (function() {  
-    const NODE_ENV = 'test'; // dev:开发环境 | test:测试环境  
+    const NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境  
     let ENV_VAR = null;  
 	 
 	var NODE_NAME=  process.env['NODE_NAME']

+ 2 - 1
.env.prod.js

@@ -1,4 +1,5 @@
-const UNI_APP = {  	
+const UNI_APP = {
+  	
     BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
 	NODE_ENV :"prod",
 	SIMPLE_RUN:false,

+ 6 - 4
.env.test.js

@@ -1,7 +1,8 @@
 const UNI_APP = {  
+
     // BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
-	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
-    //BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
+	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+    BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
    
 
 	NODE_ENV :"test",
@@ -11,9 +12,10 @@ const UNI_APP = {
 	//小鹏管家appid
 	VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	//zkx的测试openId
-	//openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
+	//openId:"oHjCawsJ5blME36lHaSpSVfEhleU",
+	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
 	//zq的测试openId
-	openId:"oHjCawsxTJkxixR74OVp7aCKahj8",
+	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",
 }  
 
 module.exports = UNI_APP;

+ 74 - 10
apis/finance.js

@@ -3,14 +3,6 @@ import requestWhite from '../utils/requestWhite.js';
 
 import Qs from 'qs';
 
-export function merchantUser(data) {
-	return requestWhite({
-		jp_identity:"merchantUser",// 分润接口
-		method: 'post',
-		data: Qs.stringify(data),
-		url: '/mobile/merchantUser'
-	})
-}
 
 export function findByOpenId(data) {
 	var url='/mobile/merchantUser/findByOpenId';
@@ -28,7 +20,7 @@ export function validateCode(data) {
 	 
 	return requestWhite({
 		method: 'post',
-			jp_identity:"merchantUser",// 分润接口
+		jp_identity:"merchantUser",// 分润接口
 		data:data ,
 		url: '/mobile/merchantUser/validateCode'
 	})
@@ -44,4 +36,76 @@ export function getVerifyCode(tel) {
 		} ,
 		url: '/mobile/merchantUser/getVerifyCode'
 	})
-} 
+} 
+
+
+
+export function applyWithdraw(data) {
+	var url='/mobile/roleSharing/applyWithdraw';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function deviceDetail(data) {
+	var url='/mobile/roleSharing/deviceDetail';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function devicesList(data) {
+	var url='/mobile/roleSharing/devicesList';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function homePage(data) {
+	var url='/mobile/roleSharing/homePage';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function incomeDetails(data) {
+	var url='/mobile/roleSharing/incomeDetails';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function incomeList(data) {
+	var url='/mobile/roleSharing/incomeList';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function withdrawRecord(data) {
+	var url='/mobile/roleSharing/withdrawRecord';
+	return request({
+		jp_identity:"merchantUser",// 分润接口
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 86 - 0
components/TabbarFinance.vue

@@ -0,0 +1,86 @@
+<template >
+	<view>
+		<u-tabbar v-model="myCurrent" :list="tabbarList" 
+		:before-switch="beforeSwitch"
+		 active-color="#1677ff"></u-tabbar>
+		
+	</view>
+</template>
+
+<script>
+ 	
+ 	export default {
+		name:"tabbarJob",
+		props:{
+			current: 0
+			
+		},
+		data() {
+			return {
+				activeColor:"#5098FF",
+				oldindex:this.current,
+				 myCurrent:this.current,
+				 tabbarList: [{
+				 		iconPath: "bar-chart-box-fill",
+				 		selectedIconPath: "bar-chart-box-fill",
+				 		text: '统计',
+				 		count: 0,
+				 		isDot: true,
+				 		customIcon: true,
+						pagePath2:"/pagesFinance/statistics/index",
+						
+				 	},
+				 	{
+				 		iconPath: "article-fill",
+				 		selectedIconPath: "article-fill",
+				 		text: '明细',
+				 		midButton: true,
+				 		customIcon: true,
+						pagePath2:"/pagesFinance/detailed/index",
+						
+				 	},
+				 	{
+				 		iconPath: "account-pin-box-fill",
+				 		selectedIconPath: "account-pin-box-fill",
+				 		text: '我的',
+				 		count: 0,
+				 		isDot: false,
+				 		customIcon: true,
+						pagePath2:"/pagesFinance/user/index",
+						
+				 	}
+				 ], 
+			};
+			
+		},methods:{
+			beforeSwitch(index){
+			
+				
+				if(index==this.current){
+					return false
+				}
+				var url =this.tabbarList[index].pagePath2;
+				
+				uni.navigateTo({
+					url: url
+				})
+				if(index==1){
+					this.myCurrent=this.oldindex;
+					return false;
+				}else{
+					return true;
+				}
+				
+			},
+			
+		},mounted(){
+			
+		},destroyed(){
+		}
+		
+	}
+</script>
+
+<style>
+	 
+</style>

+ 6 - 2
pages/charge/index.vue

@@ -193,7 +193,11 @@
 				this.carhelp.set("qr-default-id",op.id);
 			}else{
 				//用于支付后返回系统  -- 点金计划
-				this.id =this.carhelp.get("qr-default-id");
+				var  id=this.carhelp.get("qr-default-id")
+				if(id){
+					this.id =this.carhelp.get("qr-default-id");
+					
+				}
 			}
 			
 			
@@ -205,7 +209,7 @@
 			switchCharge(){
 			
 				uni.redirectTo({
-					url:'/pages/charge/switchCharge?id='+this.detail.id
+					url:'/pages/charge/switchCharge?id='+this.id
 				})
 			},
 			init(){

+ 2 - 2
pages/charge/switchCharge.vue

@@ -3,10 +3,10 @@
 		<u-navbar title="切换充电桩"
 		    :autoBack="false"
 			:custom-back="selectBtn">
-			<view class="slot-wrap">
+		<!-- 	<view class="slot-wrap">
 				<view class="navbar-left"></view>				
 				<view class="navbar-right" @click="selectBtn"><span>确定</span></view>
-			</view>
+			</view> -->
 		</u-navbar>
 		<view class="chargeList">
 			<template v-for="(item,i) in list">

+ 36 - 8
pagesFinance/detailed/details.vue

@@ -4,11 +4,11 @@
 		<view class="details">
 			<view class="details-head">
 				<u-icon name="charging-pile-fill" custom-prefix="custom-icon" color="#27B148" size="48"></u-icon>
-				<h4>荆鹏软件园充电站/A0001</h4>
+				<h4>{{detail.deviceName}}/{{detail.deviceNo}}</h4>
 			</view>
 			<view class="details-main">
 				<view class="details-price">
-					<span>¥</span><h3>15.00</h3><span>元</span>
+					<span>¥</span><h3>{{detail.shareProfitAmount}}</h3><span>元</span>
 				</view>
 				<p>本单收益</p>
 			</view>
@@ -27,23 +27,51 @@
 			<view class="details-row"><p>分润标准</p><span>15%</span></view>
 		</view>
 		<view class="detailsBtn">
-			<u-button class="detailsBtn-btn" type="primary" plain>返回</u-button>
+			<u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {
-				form: {
-					name: '',
-					intro: '',
-				},
+				id:'',
+				detail:{
+					
+				}
 			}
 		},
+		onLoad(op){
+			this.id=op.id;
+			this.getInfo()
+		},
 		methods: {
-
+			back(){
+				uni.navigateBack({
+					
+				})
+			},
+			getInfo(){
+				uni.showLoading({
+					title:"加载中",mask:true,
+				})
+				API.incomeDetails({
+					detailId:this.id
+				}).then((res) => {
+					this.detail=res.data.detail	 
+					
+					uni.hideLoading()
+					 
+				}).catch(error => {
+						uni.showToast({
+							
+							title:error
+						})
+				})
+			}
 		}
 	}
 </script>

+ 83 - 71
pagesFinance/detailed/index.vue

@@ -50,87 +50,47 @@
 			</view>
 		</u-popup>
 		<view class="detailed">
-			<view class="detailed-time">
-				<p>2020年5月1日</p>
-				<p>共收入 178.00</p>
-			</view>
-			<view class="detailed-list">
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					</view>
-				</view>
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					</view>
-				</view>
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					</view>
-				</view>
-			</view>
-			<view class="detailed-time">
-				<p>2020年5月1日</p>
-				<p>共收入 178.00</p>
-			</view>
-			<view class="detailed-list">
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					</view>
-				</view>
-				<view class="detailed-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					</view>
+			<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-item">
-					<view class="detailed-item-name">
-						<h4>荆鹏软件园充电站/A0001</h4>
-						<p>05-01 12:00</p>
-					</view>
-					<view class="detailed-item-num">
-						<h2>61.50</h2>
-						<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
+				<view class="detailed-list" 
+				@click="gotoUrl('pagesFinance/detailed/details?id='+item.id)"
+				:key="item.id">
+					<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>
+							<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
+						</view>
 					</view>
 				</view>
-			</view>	
+			</template>
+			 
 		</view>
-		<u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
-	</view>
+		<Tabbar :current="1"></Tabbar>
+ 	</view>
 </template>
 
 <script>
+	import Tabbar from '@/components/TabbarFinance.vue'
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {
+				form:{
+					
+				},
+				startDate:'',
+				endDate:'',
+				pageIndex: 1,
+				recordsTotal: 0,
+				list: [],
 				popupShow: false,
 				tabbarList: [{
 						iconPath: "bar-chart-box-fill",
@@ -174,7 +134,59 @@
 				],
 			}
 		},
+		components: {
+			Tabbar
+		
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {
+				this.myLoadmore();
+			}
+		},
+		onReady() {
+			// this.startDate=parseUnixTime(beforeTimeStamp(5),"{y}-{m}-{d}")
+			// this.endDate=parseUnixTime(new Date(),"{y}-{m}-{d}")
+			
+			this.getList()
+			
+		},
 		methods: {
+			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.incomeList(data).then((res) => {
+					
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error
+					})
+				})
+			},
+			myLoadmore() {
+					
+				this.pageIndex += 1;
+				this.getList()
+			},
 			// 点击actionSheet回调
 			actionSheetCallback(index) {
 				this.value = this.actionSheetList[index].text;

+ 196 - 7
pagesFinance/login/index.vue

@@ -10,38 +10,227 @@
 				<view class="login-form-row">
 					<u-icon name="user-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="40"></u-icon>
 					<u-line color="#d9e0ec" length="20" direction="col" margin="10px"/>
-					<u-form-item label="" prop="name"  :border-bottom="false">
-						<u-input v-model="form.name" />
+					<u-form-item label="" prop="phone"  :border-bottom="false">
+						<u-input  v-model="form.phone" placeholder="请输入手机号"  />
 					</u-form-item>
 				</view>
 				<view class="login-form-row">
 					<u-icon name="message-3-fill" custom-prefix="custom-icon" color="#b0b8c8" size="40"></u-icon>
 					<u-line color="#d9e0ec" length="20" direction="col" margin="10px"/>
-					<u-form-item label="" prop="intro"  :border-bottom="false">
-						<u-input v-model="form.intro" />
+					<u-form-item label="" prop="code"  :border-bottom="false">
+						<u-input v-model="form.code"  placeholder="请输入验证码" />
 					</u-form-item>
 				</view>
-				<view class="login-code">
+				<view class="login-code"  @click="getCode">
 					<span>获取验证码</span>
 				</view>
 			</u-form>
-			<u-button class="login-btn" @click="submit">提交</u-button>
+			<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
+			</u-verification-code>
+			<u-button class="login-btn" @click="finish">提交</u-button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	import {
+		checkPhone
+	} from '@/utils'
 	export default {
 		data() {
 			return {
 				form: {
 					name: '',
 					intro: '',
+				
+					phone: '',
+					code: '',
 				},
+				backUrl: "",
+				message: "",
+				codeTips: '',
+				isSendMsgIng: false,
+				sendMsgSecond: 60 * 2,
+				customStyle: {
+					background: '#1677ff'
+				}
 			}
 		},
+		onLoad(op) {
+		
+			this.message = op.message;
+			this.backUrl = op.back;
+			if (op.phone) {
+				this.form.phone = op.phone;
+			}
+		
+		},
 		methods: {
-
+		codeChange(text) {
+				this.codeTips = text;
+			},
+			//倒计时
+		
+			end() {
+				this.sendMsgSecond = 2 * 60;
+				this.isSendMsgIng = false;
+			},
+			finish() {
+		
+				if (!this.carhelp.getOpenId()) {
+					uni.showToast({
+						title: "请使用“微信”访问本系统登录"
+					})
+					return
+				}
+				if (!this.form.phone) {
+					uni.showToast({
+						title: "请输入手机号"
+					})
+					return
+				}
+				if (!this.form.code) {
+					uni.showToast({
+						title: "请输入验证码"
+					})
+					return
+				}
+		
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var headImg = "";
+				var userInfo = this.carhelp.get("xpgj_wx_user_info")
+				if (userInfo) {
+		
+					headImg = userInfo.headimgurl;
+				}
+		
+		
+				API.validateCode({
+					verifyCode: this.form.code,
+					telephone: this.form.phone,
+					openId: this.carhelp.getOpenId(),
+					headImg: headImg
+				}).then((response) => {
+					this.loginset(response)
+		
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			start() {
+				if (!this.isSendMsgIng) {
+		
+		
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					API.getVerifyCode(this.form.phone).then((response) => {
+		
+		
+						uni.hideLoading();
+						this.carhelp.set("getvcodetime", new Date().getTime());
+		
+						if (!"") {
+							//倒计时
+							uni.showToast({
+								title: "发送成功"
+							})
+						} else {
+							uni.showToast({
+								title: "您的验证码已经发送[5分钟有效],请勿重复点击"
+							})
+						}
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+		
+		
+				}
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {
+		
+				} else {
+		
+					uni.showToast({
+						title: '倒计时结束后再发送',
+						icon: "none"
+					})
+					return
+				}
+		
+				var checkPhoneResult = checkPhone(this.form.phone);
+		
+				if (false && checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+		
+					})
+					return;
+				}
+				this.$refs.uCode.start();
+			},
+			loginset(response){
+				var token = response ? response.data.token : '';
+				this.carhelp.setToken(token,"merchantUser");
+				this.carhelp.setPersonInfo(response.data.regUser,"merchantUser");
+				//this.gotoUrl("pages/user/index")
+				uni.redirectTo({
+					url: '/pagesFinance/statistics/index'
+				})
+			},
+			query(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.findByOpenId({
+					
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					this.loginset(response)
+					
+				
+				}).catch(error => {
+					uni.hideLoading();
+					if (!this.carhelp.getOpenId()) {
+						uni.showToast({
+							title: "请使用“微信”访问本系统登录"
+						})
+						return
+					}
+					var time = this.carhelp.get("getvcodetime");
+					if (time) {
+						//this.$refs.uCode.start();
+						var nowtime = new Date().getTime()
+						var differ = (nowtime - time) / 1000
+						if (differ < 2 * 60) {
+							this.sendMsgSecond = 2 * 60 - parseInt(differ)
+							this.isSendMsgIng = true;
+							this.$refs.uCode.start();
+						}
+					}
+					
+				})
+			}
+		},
+		onReady() {
+			this.query()
+			
 		}
 	}
 </script>

+ 300 - 245
pagesFinance/statistics/index.vue

@@ -1,249 +1,304 @@
-<template>
-	<view>
-		<u-navbar :is-back="false" :border-bottom="false" :background="background"><view class="navbar-tit">收益统计</view></u-navbar>
-		<view class="statisticsData">
-			<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>
-				<view class="statisticsData-main">
-					<h2>1141.00</h2>
-				</view>
-				<view class="statisticsData-foot">
-					<p>昨日收益</p><h4>1024.00</h4>
-				</view>
-			</view>
-			<view class="statisticsData-item">
-				<view class="statisticsData-head">
-					<p>今日充电单量(笔)</p>
-				</view>
-				<view class="statisticsData-main">
-					<h2>230</h2>
-				</view>
-				<view class="statisticsData-foot">
-					<p>累计收益</p><h4>10691.00</h4>
-				</view>
-			</view>
+<template>
+	<view>
+		<u-navbar :is-back="false" :border-bottom="false" :background="background">
+			<view class="navbar-tit">收益统计</view>
+		</u-navbar>
+		<view class="statisticsData">
+			<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>
+				<view class="statisticsData-main">
+					<h2>1141.00</h2>
+				</view>
+				<view class="statisticsData-foot">
+					<p>昨日收益</p>
+					<h4>1024.00</h4>
+				</view>
+			</view>
+			<view class="statisticsData-item">
+				<view class="statisticsData-head">
+					<p>今日充电单量(笔)</p>
+				</view>
+				<view class="statisticsData-main">
+					<h2>230</h2>
+				</view>
+				<view class="statisticsData-foot">
+					<p>累计收益</p>
+					<h4>10691.00</h4>
+				</view>
+			</view>
+		</view>
+		<view class="statisticsChart">
+			<view class="statisticsChart-head">
+				<h4>充电桩收益占比</h4>
+				<view class="statisticsChart-time">
+					<u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
+					<p @click="showdate = true">{{startTime}} 至 {{endTime}}</p>
+					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
+
+				</view>
+			</view>
+			<view class="statisticsChart-main">
+				<u-subsection :list="subsection" @change="changedate" :current="1" button-color="#2E7Dff"
+					active-color="#fff"></u-subsection>
+				<view id="pieEcharts" style="min-height:250px;">
+
+				</view>
+			</view>
 		</view>
-		<view class="statisticsChart">
-			<view class="statisticsChart-head">
-				<h4>充电桩收益占比</h4>
-				<view class="statisticsChart-time">
-					<u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
-					<p @click="showdate = true" >{{startTime}} 至 {{endTime}}</p>
-					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="36"></u-icon>
-					
-				</view>
-			</view>
-			<view class="statisticsChart-main">
-				<u-subsection :list="subsection"  @change="changedate" :current="1" button-color="#2E7Dff" active-color="#fff"></u-subsection>
-				<view  id="pieEcharts" style="min-height:250px;" >
-					
-				</view>
-			</view>
-		</view>
-		<u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
-	</view>
-</template>
-
+			<Tabbar :current="0"></Tabbar>
+<!-- 		<u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
+ -->	</view>
+</template>
+
 <script>
-	import * as echarts from "echarts";
-	import {
-			beforeTimeStamp	,
-			currentTimeStamp,
-			parseUnixTime
-		} from '@/utils'
-	export default {
-		data() {
-			return {
-				showdate:false,
-				startTime:"",
-				myChart:null,
-				endTime:"",
-				subsection: [
-					{
-						name: '金额'
-					}, 
-					{
-						name: '单量'
-					}
-				],
-				tabbarList: [{
-						iconPath: "bar-chart-box-fill",
-						selectedIconPath: "bar-chart-box-fill",
-						text: '统计',
-						count: 0,
-						isDot: true,
-						customIcon: true,
-					},
-					{
-						iconPath: "article-fill",
-						selectedIconPath: "article-fill",
-						text: '明细',
-						midButton: true,
-						customIcon: true,
-					},
-					
-					{
-						iconPath: "account-pin-box-fill",
-						selectedIconPath: "account-pin-box-fill",
-						text: '我的',
-						count: 0,
-						isDot: false,
-						customIcon: true,
-					},
-				],
-				current: 0,
-				background:{
-					background: 'none'
-				},
-			}
-		},
-		onLoad() {
-			
-		},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' }
-      ])
+	import Tabbar from '@/components/TabbarFinance.vue'
+	import * as API from '@/apis/finance.js'
+	
+	import * as echarts from "echarts";
+	import {
+		beforeTimeStamp,
+		currentTimeStamp,
+		parseUnixTime
+	} from '@/utils'
+	export default {
+		data() {
+			return {
+				showdate: false,
+				startTime: "",
+				myChart: null,
+				endTime: "",
+				subsection: [{
+						name: '金额'
+					},
+					{
+						name: '单量'
+					}
+				],
+				tabbarList: [{
+						iconPath: "bar-chart-box-fill",
+						selectedIconPath: "bar-chart-box-fill",
+						text: '统计',
+						count: 0,
+						isDot: true,
+						customIcon: true,
+					},
+					{
+						iconPath: "article-fill",
+						selectedIconPath: "article-fill",
+						text: '明细',
+						midButton: true,
+						customIcon: true,
+					},
+
+					{
+						iconPath: "account-pin-box-fill",
+						selectedIconPath: "account-pin-box-fill",
+						text: '我的',
+						count: 0,
+						isDot: false,
+						customIcon: true,
+					},
+				],
+				current: 0,
+				background: {
+					background: 'none'
+				},
+			}
+		},
+		onLoad() {
+
 		},
-		methods: {
-			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' }
-				])
-			},
-			getPie(getData){
-				if(!this.myChart){
-					this.myChart = echarts.init(document.getElementById('pieEcharts'));
-					
-				}
-				// 指定图表的配置项和数据
-				var option =   {
-
-  tooltip: {
-    trigger: 'item'
-  },
-  legend: {
-  
-	 bottom: '0%',
-	    left: 'center'
-  },
-  series: [
-    {
-      name: 'Access From',
-      type: 'pie',
-      radius: '50%',
-      data:getData,
-      emphasis: {
-        itemStyle: {
-          shadowBlur: 10,
-          shadowOffsetX: 0,
-          shadowColor: 'rgba(0, 0, 0, 0.5)'
-        }
-      }
-    }
-  ]
-};
-				
-				// 使用刚指定的配置项和数据显示图表。
-				this.myChart.setOption(option);
-			}
-		}
-	}
-</script>
-<style>
-	page{
-		background:url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
-		background-size: 100%;
-	}
-</style>
-<style lang="scss" scoped>
-	.navbar-tit{
-		color:#fff;
-		font-size: 20px;
-		padding-left: 15px;
-	}
-	.statisticsData{
-		background-color: #fff;
-		margin: 16px;
-		padding: 16px;
-		border-radius: 8px;
-		display: flex;
-		margin-top:80px;
-	}
-	.statisticsData-item{
-		flex: 1;
-		.statisticsData-head{
-			display: flex;
-			align-items: center;
-			p{
-				color:#637AA2;
-				font-size: 12px;
-			}
-		}
-		.statisticsData-main{
-			margin-top: 4px;
-			font-size: 20px;
-		}
-		.statisticsData-foot{
-			display: flex;
-			align-items: center;
-			margin-top: 16px;
-			p{
-				color:#637AA2;
-			}
-			h4{
-				margin-left: 8px;
-			}
-		}
-	}
-	.statisticsChart{
-		margin: 16px;
-		.statisticsChart-head{
-			margin-bottom: 5px;
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			h4{
-				font-weight: normal;
-				font-size: 16px;
-				position: relative;
-				padding-left:10px;
-				&::after{
-					content: '';
-					position: absolute;
-					height: 12px;
-					width: 4px;
-					background-color: #4E8DF6;
-					left: 0;
-					top:5px;
-				}
-			}
-			.statisticsChart-time{
-				display: flex;
-				align-items: center;
-				p{
-					color:#666;
-				}
-			}
-		}
-		.statisticsChart-main{
-			background-color: #fff;
-			padding: 16px;
-			border-radius: 8px;
-		}
-	}
+		components: {
+			Tabbar
+		
+		},
+		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'
+				}
+			])
+		},
+		methods: {
+			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'
+					}
+				])
+			},
+			getPie(getData) {
+				if (!this.myChart) {
+					this.myChart = echarts.init(document.getElementById('pieEcharts'));
+
+				}
+				// 指定图表的配置项和数据
+				var option = {
+
+					tooltip: {
+						trigger: 'item'
+					},
+					legend: {
+
+						bottom: '0%',
+						left: 'center'
+					},
+					series: [{
+						name: 'Access From',
+						type: 'pie',
+						radius: '50%',
+						data: getData,
+						emphasis: {
+							itemStyle: {
+								shadowBlur: 10,
+								shadowOffsetX: 0,
+								shadowColor: 'rgba(0, 0, 0, 0.5)'
+							}
+						}
+					}]
+				};
+
+				// 使用刚指定的配置项和数据显示图表。
+				this.myChart.setOption(option);
+			}
+		}
+	}
+</script>
+<style>
+	page {
+		background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
+		background-size: 100%;
+	}
+</style>
+<style lang="scss" scoped>
+	.navbar-tit {
+		color: #fff;
+		font-size: 20px;
+		padding-left: 15px;
+	}
+
+	.statisticsData {
+		background-color: #fff;
+		margin: 16px;
+		padding: 16px;
+		border-radius: 8px;
+		display: flex;
+		margin-top: 80px;
+	}
+
+	.statisticsData-item {
+		flex: 1;
+
+		.statisticsData-head {
+			display: flex;
+			align-items: center;
+
+			p {
+				color: #637AA2;
+				font-size: 12px;
+			}
+		}
+
+		.statisticsData-main {
+			margin-top: 4px;
+			font-size: 20px;
+		}
+
+		.statisticsData-foot {
+			display: flex;
+			align-items: center;
+			margin-top: 16px;
+
+			p {
+				color: #637AA2;
+			}
+
+			h4 {
+				margin-left: 8px;
+			}
+		}
+	}
+
+	.statisticsChart {
+		margin: 16px;
+
+		.statisticsChart-head {
+			margin-bottom: 5px;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+
+			h4 {
+				font-weight: normal;
+				font-size: 16px;
+				position: relative;
+				padding-left: 10px;
+
+				&::after {
+					content: '';
+					position: absolute;
+					height: 12px;
+					width: 4px;
+					background-color: #4E8DF6;
+					left: 0;
+					top: 5px;
+				}
+			}
+
+			.statisticsChart-time {
+				display: flex;
+				align-items: center;
+
+				p {
+					color: #666;
+				}
+			}
+		}
+
+		.statisticsChart-main {
+			background-color: #fff;
+			padding: 16px;
+			border-radius: 8px;
+		}
+	}
 </style>

+ 2 - 0
pagesFinance/user/about.vue

@@ -18,6 +18,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 0
pagesFinance/user/applyResult.vue

@@ -23,6 +23,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 0
pagesFinance/user/deviceDetails.vue

@@ -28,6 +28,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 0
pagesFinance/user/deviceList.vue

@@ -41,6 +41,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 0
pagesFinance/user/help.vue

@@ -12,6 +12,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 15 - 26
pagesFinance/user/index.vue

@@ -84,44 +84,33 @@
 			</view>
 		</view>
 		
-		<u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
-	</view>
+			<Tabbar :current="2"></Tabbar>
+ 	</view>
 </template>
 
 <script>
+	import Tabbar from '@/components/TabbarFinance.vue'
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {
-				tabbarList: [{
-						iconPath: "bar-chart-box-fill",
-						selectedIconPath: "bar-chart-box-fill",
-						text: '统计',
-						count: 0,
-						isDot: true,
-						customIcon: true,
-					},
-					{
-						iconPath: "article-fill",
-						selectedIconPath: "article-fill",
-						text: '明细',
-						midButton: true,
-						customIcon: true,
-					},
-					{
-						iconPath: "account-pin-box-fill",
-						selectedIconPath: "account-pin-box-fill",
-						text: '我的',
-						count: 0,
-						isDot: false,
-						customIcon: true,
-					},
-				],
+				info:{},
+				home:{},
 				current: 0,
 				background:{
 					background: 'none'
 				},
 			}
 		},
+		components: {
+			Tabbar
+		
+		},
+		onLoad() {
+			this.info=this.carhelp.getPersonInfo("merchantUser")
+			console.log(this.info)
+		},
 		methods: {
 
 		}

+ 2 - 0
pagesFinance/user/withdraw.vue

@@ -28,6 +28,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 2 - 0
pagesFinance/user/withdrawRecord.vue

@@ -63,6 +63,8 @@
 </template>
 
 <script>
+	import * as API from '@/apis/finance.js'
+	
 	export default {
 		data() {
 			return {

+ 35 - 9
utils/mixin.js

@@ -8,14 +8,31 @@ var app = {
 	set : (key, value) => uni.setStorageSync(prefix + key, value),
 	remove: key =>  uni.removeStorageSync(prefix + key),
 	
-	getPersonInfo : () => {
-		 return uni.getStorageSync(prefix + 'personInfo')
+	getPersonInfo : (jp_identity) => {
+		if(jp_identity){
+			
+			 return uni.getStorageSync(prefix +jp_identity+ '_personInfo')
+			
+		}else{
+			 return uni.getStorageSync(prefix + 'personInfo')
+			
+		}
+		
 	},
 	signOut:()=>  uni.removeStorageSync(prefix  + 'personInfo'),
 	getOpenId : () =>   uni.getStorageSync(prefix + 'wx_openId'),
 
 	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId', value),
-	setPersonInfo : (value) => uni.setStorageSync(prefix + 'personInfo', value),
+	setPersonInfo : (value,jp_identity) =>{
+		
+		if(jp_identity){
+			uni.setStorageSync(prefix + jp_identity+'_personInfo', value)
+			
+		}else{
+			uni.setStorageSync(prefix + 'personInfo', value)
+			
+		}
+	},
 	
 	getToken : (options) => {
 		//不同权限 ,不同token
@@ -26,13 +43,22 @@ var app = {
 			
 		}
 	},
-	setToken : (value) => {
-		uni.setStorageSync(prefix + 'token', value)
-		
-		if(value){
-			var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
-			uni.setStorageSync(prefix + 'token_tdate', tdate)
+	setToken : (value,jp_identity) => {
+		if(jp_identity){
+			uni.setStorageSync(prefix +jp_identity + '_token', value)
+			if(value){
+				var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
+				uni.setStorageSync(prefix + jp_identity+'_token_tdate', tdate)
+			}
+		}else{
+			uni.setStorageSync(prefix + 'token', value)
+			if(value){
+				var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
+				uni.setStorageSync(prefix + 'token_tdate', tdate)
+			}
 		}
+		
+		
 	}
 	,
 	

+ 14 - 10
utils/request.js

@@ -6,7 +6,13 @@ import requestNum from './requestNum.js';
 const request = (options) => {
 	//记录请求次数和响应次数
 	var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")
-	var token_tdate=carhelp.get("token_tdate");//每10分钟存储一次token
+	var token_tdate=null//每10分钟存储一次token
+	if(options&&options.jp_identity){
+		token_tdate=carhelp.get(options.jp_identity+"_token_tdate");
+	}else{
+		token_tdate=carhelp.get("token_tdate");
+	}
+	
 	
 	var token=carhelp.getToken(options);
 	
@@ -50,9 +56,9 @@ const request = (options) => {
 			if (res.data.code == 200&&res.data.result) {
 				
 				var token = res ? res.data.data.token : '';
-				carhelp.setPersonInfo(res.data.data.regUser );
+				carhelp.setPersonInfo(res.data.data.regUser,options.jp_identity );
 				
-				carhelp.setToken(token);
+				carhelp.setToken(token,options.jp_identity);
 				
 				options.token=token
 				
@@ -62,18 +68,16 @@ const request = (options) => {
 				 
 			} else  if(res.data.code == 415||(res.data.code == 200&&!res.data.result)||res.data.code == 400){
 				
-				//var url=window.location.href.split("#")[1]
+				var backurl=window.location.href.split("#")[1]
+				var url="/pages/login/index"
 				if(options&&options.jp_identity){
-					
-				}else{
-					
-					
+					url="/pagesFinance/login/index"
 				}
 				
-				var url="/pages/login/index?message=请登录&back="+ url+"&phone="+options.data.phone
+				url+="?message=请登录&back="+ backurl+"&phone="+options.data.phone
 				carhelp.signOut()
 				uni.redirectTo({
-					url: '/pages/login/index'
+					url:url
 				})
 				
 			 

+ 16 - 7
utils/requestWhite.js

@@ -41,8 +41,17 @@ const request = (options) => {
 			
 			if (res.data.code == 415&&res.data.message=='请先注册信息') {
 				carhelp.signOut()
+			
+				var backurl=window.location.href.split("#")[1]
+				var url="/pages/login/index"
+				if(options&&options.jp_identity){
+					url="/pagesFinance/login/index"
+				}
+				
+				url+="?message=请登录&back="+ backurl+"&phone="+options.data.phone
+			
 				uni.redirectTo({
-					url: '/pages/login/index'
+					url:url
 				})
 				return;
 			}
@@ -50,12 +59,12 @@ const request = (options) => {
 			if (res.data.code != 200) {
 				reject(res.data.message)
 			} else {
-				if(!res.data.result){
-					uni.showToast({
-						title: res.data.message,
-						position:'bottom'
-					})
-				}
+				// if(!res.data.result){
+				// 	uni.showToast({
+				// 		title: res.data.message,
+				// 		position:'bottom'
+				// 	})
+				// }
 				resolve(res.data);
 			}
 		}).catch(error => {