空白格 3 سال پیش
والد
کامیت
d0db8254c4

+ 26 - 1
common/apiurl.js

@@ -1,3 +1,28 @@
 export const apiurl = {
 export const apiurl = {
-	loginUrl: '/login/login'
+	// 登录接口
+	loginUrl: '/operator/auth/login',
+	// 退出登录接口
+	logoutUrl: '/operator/auth/loginOut',
+	// 今日概况模块接口
+	todayOverview: {
+		// 获取今日概况接口
+		getTodayDataUrl: '/admin/overview/today',
+		// 获取路段概况接口
+		getRoadDataUrl: '/admin/overview/roadspacecount',
+		// 获取停车场概况接口
+		getParkingLotDataUrl: '/admin/overview/roadspacecount'
+	},
+	// 运营分析模块接口
+	operationalAnalysis: {
+		// 获取营收分析接口
+		getRevenueDataUrl: '/admin/statis/amt',
+		// 获取路段/停车场营收排行接口
+		getParkingLotRevenueDataUrl: '/admin/overview/roadtop',
+		// 获取车流量分析接口
+		getTrafficFlowDataUrl: '/admin/overview/vehicle',
+		// 获取收费员业绩排行接口
+		getTollCollectorPerformanceUrl: '/admin/overview/payeetop',
+		// 获取营收趋势统计接口
+		getRevenueTrendsDataUrl: '/admin/statis/roadamt'
+	}
 }
 }

+ 1 - 1
common/config.js

@@ -1,3 +1,3 @@
 export const config = {
 export const config = {
-	baseUrl: 'http://localhost:8080'
+	baseUrl: 'http://172.16.90.64:7000/'
 }
 }

+ 30 - 1
common/http.api.js

@@ -4,10 +4,39 @@ import {
 
 
 // vm指向this
 // vm指向this
 const install = (Vue, vm) => {
 const install = (Vue, vm) => {
+	// 登录
 	let loginApi = (params = {}) => vm.$u.http.post(apiurl.loginUrl, params);
 	let loginApi = (params = {}) => vm.$u.http.post(apiurl.loginUrl, params);
+	// 退出登录
+	let logoutApi = (params = {}) => vm.$u.http.get(apiurl.logoutUrl, params);
+	// 今日概况
+	let todayOverviewApi = {
+		// 获取今日概况
+		getTodayDataApi: (params = {}) => vm.$u.http.get(apiurl.todayOverview.getTodayDataUrl, params),
+		// 获取路段概况
+		getRoadDataApi: (params = {}) => vm.$u.http.get(apiurl.todayOverview.getRoadDataUrl, params),
+		// 获取停车场概况
+		getParkingLotDataApi: (params = {}) => vm.$u.http.get(apiurl.todayOverview.getParkingLotDataUrl, params)
+	};
+	// 运营分析
+	let operationalAnalysisApi = {
+		// 获取营收分析
+		getRevenueDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getRevenueDataUrl, { params }),
+		// 获取路段/停车场营收排行
+		getParkingLotRevenueDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getParkingLotRevenueDataUrl, { params }),
+		// 获取车流量分析
+		getTrafficFlowDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getTrafficFlowDataUrl, { params }),
+		// 获取收费员业绩排行
+		getTollCollectorPerformanceApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getTollCollectorPerformanceUrl, { params }),
+		// 获取营收趋势统计
+		getRevenueTrendsDataApi: (params = {}) => vm.$u.http.get(apiurl.operationalAnalysis.getRevenueTrendsDataUrl, { params })
+	}
+	
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 	vm.$u.api = {
-		loginApi
+		loginApi,
+		logoutApi,
+		todayOverviewApi,
+		operationalAnalysisApi
 	};
 	};
 }
 }
 export default {
 export default {

+ 45 - 43
common/http.interceptor.js

@@ -1,58 +1,60 @@
-import { config } from '@/common/config.js';
+import {
+	config
+} from '@/common/config.js';
 import store from '@/store/index.js'
 import store from '@/store/index.js'
 
 
+// let baseUrl = config.baseUrl
+let baseUrl = '/api'
+
 // vm指向this
 // vm指向this
 const install = (Vue, vm) => {
 const install = (Vue, vm) => {
-  uni.$u.http.setConfig({
-    baseURL: config.baseUrl,
-		dataType: 'json',// 设置为json,返回后会对数据进行一次JSON.parse()
-		showLoading: true, // 是否显示请求中的loading
-		loadingText: '请求中...', // 请求loading中的文字提示
-		loadingTime: 500, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
-		originalData: false, // 是否在拦截器中返回服务端的原始数据
-		loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
-		// 配置请求头信息
-		header: {
-			'content-type': 'application/json;charset=UTF-8'
+	uni.$u.http.setConfig((config) => {
+		config.baseURL = baseUrl
+		return config
+	});
+	// 请求拦截,配置Token等参数
+	uni.$u.http.interceptors.request.use((config) => {
+		if (vm.vuex_token) {
+			config.header.Authorization = `Bearer ${vm.vuex_token}`;
 		}
 		}
-  });
-  // 请求拦截,配置Token等参数
-  uni.$u.http.interceptor.request = (config) => {
-    if (vm.vuex_token) {
-      config.header.Authorization = `Bearer ${vm.vuex_token}`;
-    }
-    // url加时间戳
-    config.url = config.url + '?t=' + Date.now()
-    let noTokenList = ['/wechat/h5/user', '/client/auth/verifyCode'];
-    if (noTokenList.includes(config.url)) config.header.noToken = true;
-    return config;
-  }
-  // 响应拦截,判断状态码是否通过
-  uni.$u.http.interceptor.response = (res) => {
-    if (res.code == 200) {
-      return res;
-    } else if (res.msg == "令牌不能为空" || res.code == 401) {
-      const backUrl = location.href
-      const loginUrl = 'phoneLogin'
-      if (backUrl.indexOf(loginUrl) > 0) {} else {
-        localStorage.setItem('backUrl', location.href)
-        store.state.vuex_hasLogin = false;
-        alert('还未登录,即将跳转登录');
-        uni.navigateTo({
-          url: "/pages/phoneLogin/phoneLogin"
-        });
-        return;
-      }
-    } else {
+		// url加时间戳
+		config.url = config.url + '?t=' + Date.now()
+		return config;
+	}, config => {
+		return Promise.reject(config)
+	})
+	// 响应拦截,判断状态码是否通过
+	uni.$u.http.interceptors.response.use((response) => {
+		let res = response.data
+		if (res.code == 200) {
+			return res;
+		} else if (res.msg == "令牌不能为空" || res.code == 401) {
+			uni.showModal({
+				title: '提示',
+				content: '登录信息已失效, 请重新登录',
+				showCancel: false,
+				success: function(res) {
+					if (res.confirm) {
+						store.state.vuex_isLogin = false;
+						uni.navigateTo({
+							url: "/pages/login/login"
+						})
+					}
+				}
+			});
+			return;
+		} else {
 			uni.showToast({
 			uni.showToast({
 				title: res.msg,
 				title: res.msg,
 				icon: 'none',
 				icon: 'none',
 				duration: 2000
 				duration: 2000
 			})
 			})
 		}
 		}
-  }
+	}, (response) => {
+		return Promise.reject(response)
+	})
 }
 }
 
 
 export default {
 export default {
-  install
+	install
 }
 }

+ 1 - 1
components/columnChart.vue

@@ -56,7 +56,7 @@
 		background-color: #fff;
 		background-color: #fff;
 		border-radius: 5px;
 		border-radius: 5px;
 		padding: 18px 15px;
 		padding: 18px 15px;
-		
+
 		&-title {
 		&-title {
 			text-align: center;
 			text-align: center;
 			margin-bottom: 10px;
 			margin-bottom: 10px;

+ 52 - 0
components/pieChart.vue

@@ -0,0 +1,52 @@
+<!-- 饼图 -->
+<template>
+	<view class="charts-box">
+		<view class="charts-box-title">{{ title }}</view>
+		<qiun-data-charts type="pie" :chartData="chartData" :opts="opts" />
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			chartData: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			title: {
+				type: [String, Number],
+				default: ''
+			},
+			opts: {
+				type: Object,
+				default: () => {
+					return {
+						dataLabel: false,
+						legend: {
+							position: 'right',
+							lineHeight: 20
+						}
+					}
+				}
+			}
+		},
+		data() {
+			return {}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.charts-box {
+		background-color: #fff;
+		border-radius: 5px;
+		padding: 18px 15px;
+
+		&-title {
+			text-align: center;
+			margin-bottom: 10px;
+		}
+	}
+</style>

+ 6 - 1
components/tableRanking.vue

@@ -19,7 +19,7 @@
 				</uni-table>
 				</uni-table>
 			</view>
 			</view>
 			<view class="table-pagination" v-if="tableData.total > 0">
 			<view class="table-pagination" v-if="tableData.total > 0">
-				<uni-pagination show-icon="true" :total="tableData.total" :current="tableData.current"></uni-pagination>
+				<uni-pagination show-icon="true" :total="tableData.total" :current="tableData.current" @change="pageChange"></uni-pagination>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
@@ -54,6 +54,11 @@
 					}
 					}
 				}
 				}
 			}
 			}
+		},
+		methods: {
+			pageChange(e) {
+				this.$emit('pageChange', e.current)
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 3 - 2
main.js

@@ -22,8 +22,9 @@ const app = new Vue({
 	...App
 	...App
 })
 })
 
 
-// 引入请求封装
-require('./utils/request/index')(app)
+// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
+import httpInterceptor from '@/common/http.interceptor.js';
+Vue.use(httpInterceptor, app);
 
 
 // http接口API抽离,免于写url或者一些固定的参数
 // http接口API抽离,免于写url或者一些固定的参数
 import httpApi from '@/common/http.api.js';
 import httpApi from '@/common/http.api.js';

+ 75 - 72
manifest.json

@@ -1,74 +1,77 @@
 {
 {
-    "name" : "智慧停车运营端",
-    "appid" : "__UNI__EC952D7",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
-    /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
-        },
-        /* 模块配置 */
-        "modules" : {},
-        /* 应用发布信息 */
-        "distribute" : {
-            /* android打包配置 */
-            "android" : {
-                "permissions" : [
-                    "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-                    "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-feature android:name=\"android.hardware.camera\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-                ]
-            },
-            /* ios打包配置 */
-            "ios" : {},
-            /* SDK配置 */
-            "sdkConfigs" : {
-                "ad" : {}
-            }
-        }
-    },
-    /* 快应用特有相关 */
-    "quickapp" : {},
-    /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "",
-        "setting" : {
-            "urlCheck" : false
-        },
-        "usingComponents" : true
-    },
-    "mp-alipay" : {
-        "usingComponents" : true
-    },
-    "mp-baidu" : {
-        "usingComponents" : true
-    },
-    "mp-toutiao" : {
-        "usingComponents" : true
-    },
-    "uniStatistics" : {
-        "enable" : false
-    },
-    "vueVersion" : "2"
+	"name": "智慧停车运营端",
+	"appid": "__UNI__EC952D7",
+	"description": "",
+	"versionName": "1.0.0",
+	"versionCode": "100",
+	"transformPx": false,
+	/* 5+App特有相关 */
+	"app-plus": {
+		"usingComponents": true,
+		"nvueStyleCompiler": "uni-app",
+		"compilerVersion": 3,
+		"splashscreen": {
+			"alwaysShowBeforeRender": true,
+			"waiting": true,
+			"autoclose": true,
+			"delay": 0
+		},
+		/* 模块配置 */
+		"modules": {},
+		/* 应用发布信息 */
+		"distribute": {
+			/* android打包配置 */
+			"android": {
+				"permissions": [
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
+					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+					"<uses-feature android:name=\"android.hardware.camera\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			/* ios打包配置 */
+			"ios": {},
+			/* SDK配置 */
+			"sdkConfigs": {
+				"ad": {}
+			}
+		}
+	},
+	/* 快应用特有相关 */
+	"quickapp": {},
+	/* 小程序特有相关 */
+	"mp-weixin": {
+		"appid": "",
+		"setting": {
+			"urlCheck": false
+		},
+		"usingComponents": true
+	},
+	"mp-alipay": {
+		"usingComponents": true
+	},
+	"mp-baidu": {
+		"usingComponents": true
+	},
+	"mp-toutiao": {
+		"usingComponents": true
+	},
+	"uniStatistics": {
+		"enable": false
+	},
+	"vueVersion": "2",
+	"h5": {
+		"title": "运营端"
+	}
 }
 }

+ 57 - 0
pages/dataOverview/operationalAnalysis/components/arrearsAnalysis.vue

@@ -0,0 +1,57 @@
+<!-- 欠费分析 -->
+<template>
+	<view class="arrears">
+		<view class="arrears-line">
+			<LineChart :chartData="chartData" :title="title" :opts="opts"/>
+		</view>
+	</view>
+</template>
+
+<script>
+	import LineChart from '@/components/lineChart.vue'
+	export default {
+		components: {
+			LineChart
+		},
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			chartData: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			opts: {
+				type: Object,
+				default: () => {
+					return {
+						xAxis: {
+							rotateLabel: false,
+							labelCount: 6
+						},
+						yAxis: {
+							showTitle: true,
+							splitNumber: 5,
+							data: [{
+								title: '元',
+								titleOffsetY: -5
+							}]
+						},
+						legend: {
+							show: false
+						},
+						dataLabel: false,
+						extra: {
+							column: {
+								width: 20
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</script>

+ 57 - 0
pages/dataOverview/operationalAnalysis/components/incomeAnalysis.vue

@@ -0,0 +1,57 @@
+<!-- 收入分析 -->
+<template>
+	<view class="revenue">
+		<view class="revenue-line">
+			<ColumnChart :chartData="chartData" :title="title" :opts="opts"/>
+		</view>
+	</view>
+</template>
+
+<script>
+	import ColumnChart from '@/components/columnChart.vue'
+	export default {
+		components: {
+			ColumnChart
+		},
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			chartData: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			opts: {
+				type: Object,
+				default: () => {
+					return {
+						xAxis: {
+							rotateLabel: false,
+							labelCount: 6
+						},
+						yAxis: {
+							showTitle: true,
+							splitNumber: 5,
+							data: [{
+								title: '元',
+								titleOffsetY: -5
+							}]
+						},
+						legend: {
+							show: false
+						},
+						dataLabel: false,
+						extra: {
+							column: {
+								width: 20
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</script>

+ 29 - 0
pages/dataOverview/operationalAnalysis/components/paymentMethod.vue

@@ -0,0 +1,29 @@
+<!-- 支付占比分析分析 -->
+<template>
+	<view class="revenue">
+		<view class="revenue-line">
+			<PieChart :chartData="chartData" :title="title"/>
+		</view>
+	</view>
+</template>
+
+<script>
+	import PieChart from '@/components/pieChart.vue'
+	export default {
+		components: {
+			PieChart
+		},
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			chartData: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			}
+		}
+	}
+</script>

+ 34 - 3
pages/dataOverview/operationalAnalysis/components/revenueAnalysis.vue

@@ -31,12 +31,43 @@
 				type: String,
 				type: String,
 				default: ''
 				default: ''
 			},
 			},
-			chartData: {
+			params: {
 				type: Object,
 				type: Object,
-				default: () => {
-					return {}
+				default: () => {}
+			}
+		},
+		data() {
+			return {
+				chartData: {
+					categories: [],
+					series: [{
+						name: '',
+						data: []
+					}]
 				}
 				}
 			}
 			}
+		},
+		methods: {
+			/**
+			 * 获取数据
+			 */
+			getData({ reportType, queryDate }) {
+				uni.$u.api.operationalAnalysisApi.getRevenueDataApi({ reportType, queryDate }).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.categories = res.data.itemList.map(item => {
+								return item.statisTime
+							})
+							this.chartData.series[0].data = res.data.itemList.map(item => {
+								return item.amt
+							})
+						} else {
+							this.chartData.categories = []
+							this.chartData.series[0].data = []
+						}
+					}
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 46 - 14
pages/dataOverview/operationalAnalysis/components/revenueRanking.vue

@@ -1,7 +1,7 @@
 <!-- 路段/停车场营收排行 -->
 <!-- 路段/停车场营收排行 -->
 <template>
 <template>
 	<view class="ranking">
 	<view class="ranking">
-		<TableRanking :loading="loading" :title="title" :tableTh="tableTh" :tableData="tableData"/>
+		<TableRanking :loading="loading" :title="title" :tableTh="tableTh" :tableData="tableData" @pageChange="pageChange"/>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -12,27 +12,59 @@
 			TableRanking
 			TableRanking
 		},
 		},
 		props: {
 		props: {
-			loading: {
-				type: Boolean,
-				default: false
-			},
 			title: {
 			title: {
 				type: String,
 				type: String,
 				default: ''
 				default: ''
 			},
 			},
 			tableTh: {
 			tableTh: {
 				type: Array,
 				type: Array,
-				default: () => []
+				default: () => [
+					{ width: 100, field: '路段编号', key: 'roadNo' },
+					{ width: 100, field: '路段名称', key: 'roadName' },
+					{ width: 100, field: '收益(元)', key: 'amt' }
+				]
+			}
+		},
+		data() {
+			return {
+				tableData: {
+					current: 1,
+					total: 0,
+					list: []
+				},
+				reportType: '',
+				queryDate: '',
+				loading: false
+			}
+		},
+		methods: {
+			getData({ reportType, queryDate }) {
+				this.reportType = reportType
+				this.queryDate = queryDate
+				this.tableData.current = 1
+				this.getList()
 			},
 			},
-			tableData: {
-				type: Object,
-				default: () => {
-					return {
-						current: 1,
-						total: 0,
-						list: []
+			getList() {
+				this.loading = true
+				uni.$u.api.operationalAnalysisApi.getParkingLotRevenueDataApi({
+					pageNum: this.tableData.current,
+					pageSize: 10,
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					console.log(res)
+					if (res.code === 200) {
+						this.tableData.list = res.rows
+						this.tableData.total = res.total
 					}
 					}
-				}
+					this.loading = false
+				}).catch(() => {
+					this.loading = false
+				})
+			},
+			pageChange(current) {
+				this.tableData.current = current
+				this.getList()
 			}
 			}
 		}
 		}
 	}
 	}

+ 145 - 0
pages/dataOverview/operationalAnalysis/components/sectionAnalysis.vue

@@ -0,0 +1,145 @@
+<!-- 路段分析 -->
+<template>
+	<view class="section">
+		<!-- 营收趋势分析 -->
+		<view class="section-part">
+			<view class="section-part-title"><text>|</text>营收趋势分析</view>
+			<view class="section-part-content">
+				<ColumnChart :chartData="revenueTrendsData" :title="title" :opts="opts1"/>
+			</view>
+		</view>
+		<view class="section-part">
+			<view class="section-part-title"><text>|</text>车流量统计</view>
+			<view class="section-part-content">
+				<ColumnChart :chartData="trafficFlowData" :title="title" :opts="opts2"/>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import ColumnChart from '@/components/columnChart.vue'
+	export default {
+		components: {
+			ColumnChart
+		},
+		props: {
+			title: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				opts1: {
+					xAxis: {
+						rotateLabel: true
+					},
+					yAxis: {
+						showTitle: true,
+						splitNumber: 5,
+						data: [{
+							title: '收益(元)',
+							titleOffsetY: -5
+						}]
+					},
+					legend: {
+						show: false
+					},
+					dataLabel: false,
+					enableScroll: false,
+					padding: [0, 0, 10, 0],
+					extra: {
+						column: {
+							width: 20
+						}
+					}
+				},
+				opts2: {
+					xAxis: {
+						rotateLabel: true
+					},
+					yAxis: {
+						showTitle: true,
+						splitNumber: 5,
+						data: [{
+							title: '车辆(辆)',
+							titleOffsetY: -5
+						}]
+					},
+					legend: {
+						show: false
+					},
+					dataLabel: false,
+					padding: [0, 0, 10, 0],
+					extra: {
+						column: {
+							width: 20
+						}
+					}
+				},
+				revenueTrendsData: {
+					categories: [],
+					series: [{
+						name: '',
+						data: []
+					}]
+				},
+				trafficFlowData: {
+					categories: [],
+					series: [{
+						name: '',
+						data: []
+					}]
+				}
+			}
+		},
+		methods: {
+			getData({ reportType, queryDate }) {
+				this.reportType = reportType
+				this.queryDate = queryDate
+				this.getRevenueTrendsData()
+			},
+			getRevenueTrendsData() {
+				uni.$u.api.operationalAnalysisApi.getRevenueTrendsDataApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.revenueTrendsData.categories = res.data.itemList.map(item => {
+								return item.roadName
+							})
+							this.revenueTrendsData.series[0].data = res.data.itemList.map(item => {
+								return item.amt
+							})
+						} else {
+							this.revenueTrendsData.categories = []
+							this.revenueTrendsData.series[0].data = []
+						}
+						console.log(this.revenueTrendsData)
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.section {
+		&-part {
+			background-color: #fff;
+			border-radius: 5px;
+			margin-bottom: 10px;
+
+			&-title {
+				padding: 15px;
+
+				text {
+					color: #f00;
+					margin-right: 5px;
+				}
+			}
+		}
+	}
+</style>

+ 56 - 0
pages/dataOverview/operationalAnalysis/components/sourceOfPayment.vue

@@ -0,0 +1,56 @@
+<!-- 支付来源分析 -->
+<template>
+	<view class="revenue">
+		<view class="revenue-line">
+			<LineChart :chartData="chartData" :title="title" :opts="opts"/>
+		</view>
+	</view>
+</template>
+
+<script>
+	import LineChart from '@/components/lineChart.vue'
+	export default {
+		components: {
+			LineChart
+		},
+		props: {
+			title: {
+				type: String,
+				default: ''
+			},
+			chartData: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			opts: {
+				type: Object,
+				default: () => {
+					return {
+						xAxis: {
+							rotateLabel: true
+						},
+						yAxis: {
+							showTitle: true,
+							splitNumber: 5,
+							data: [{
+								title: '元',
+								titleOffsetY: -5
+							}]
+						},
+						legend: {
+							show: false
+						},
+						dataLabel: false,
+						extra: {
+							column: {
+								width: 20
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</script>

+ 76 - 20
pages/dataOverview/operationalAnalysis/components/tollCollectorPerformance.vue

@@ -2,7 +2,7 @@
 <template>
 <template>
 	<view class="performance">
 	<view class="performance">
 		<template v-if="type === 'table'">
 		<template v-if="type === 'table'">
-			<TableRanking :loading="loading" :title="title" :tableTh="tableTh" :tableData="tableData"/>
+			<TableRanking :loading="loading" :title="title" :tableTh="tableTh" :tableData="tableData"  @pageChange="pageChange"/>
 		</template>
 		</template>
 		<template v-else>
 		<template v-else>
 			<LineChart :chartData="chartData" :title="title"/>
 			<LineChart :chartData="chartData" :title="title"/>
@@ -21,11 +21,7 @@
 		props: {
 		props: {
 			type: {
 			type: {
 				type: String,
 				type: String,
-				default: 'line'
-			},
-			loading: {
-				type: Boolean,
-				default: false
+				default: 'table'
 			},
 			},
 			title: {
 			title: {
 				type: String,
 				type: String,
@@ -33,23 +29,83 @@
 			},
 			},
 			tableTh: {
 			tableTh: {
 				type: Array,
 				type: Array,
-				default: () => []
+				default: () => [
+					{ width: 100, field: '工号', key: 'payeeNo' },
+					{ width: 100, field: '姓名', key: 'payeeName' },
+					{ width: 100, field: '收益(元)', key: 'amt' }
+				]
 			},
 			},
-			tableData: {
-				type: Object,
-				default: () => {
-					return {
-						current: 1,
-						total: 0,
-						list: []
-					}
+		},
+		data() {
+			return {
+				chartData: {
+					categories: [],
+					series: [{
+						name: '',
+						data: []
+					}]
+				},
+				tableData: {
+					current: 1,
+					total: 0,
+					list: []
+				},
+				reportType: '',
+				queryDate: '',
+				loading: false
+			}
+		},
+		methods: {
+			getData({ reportType, queryDate }) {
+				this.reportType = reportType
+				this.queryDate = queryDate
+				if (this.type === 'table') {
+					this.tableData.current = 1
+					this.getTableData()
+				} else {
+					this.getChartData()
 				}
 				}
 			},
 			},
-			chartData: {
-				type: Object,
-				default: () => {
-					return {}
-				}
+			getTableData() {
+				this.loading = true
+				uni.$u.api.operationalAnalysisApi.getTollCollectorPerformanceApi({
+					pageNum: this.tableData.current,
+					pageSize: 10,
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						this.tableData.list = res.rows
+						this.tableData.total = res.total
+					}
+					this.loading = false
+				}).catch(() => {
+					this.loading = false
+				})
+			},
+			getChartData() {
+				uni.$u.api.operationalAnalysisApi.getTollCollectorPerformanceApi({
+					reportType: this.reportType,
+					queryDate: this.queryDate
+				}).then(res => {
+					if (res.code === 200) {
+						if (res.rows && res.rows.length) {
+							this.chartData.categories = res.rows.map(item => {
+								return item.payeeName
+							})
+							this.chartData.series[0].data = res.rows.map(item => {
+								return item.amt
+							})
+						} else {
+							this.chartData.categories = []
+							this.chartData.series[0].data = []
+						}
+					}
+				})
+			},
+			pageChange(current) {
+				this.tableData.current = current
+				this.getTableData()
 			}
 			}
 		}
 		}
 	}
 	}

+ 30 - 6
pages/dataOverview/operationalAnalysis/components/trafficFlow.vue

@@ -18,12 +18,6 @@
 				type: String,
 				type: String,
 				default: ''
 				default: ''
 			},
 			},
-			chartData: {
-				type: Object,
-				default: () => {
-					return {}
-				}
-			},
 			opts: {
 			opts: {
 				type: Object,
 				type: Object,
 				default: () => {
 				default: () => {
@@ -52,6 +46,36 @@
 					}
 					}
 				}
 				}
 			}
 			}
+		},
+		data() {
+			return {
+				chartData: {
+					categories: [],
+					series: [{
+						name: '',
+						data: []
+					}]
+				}
+			}
+		},
+		methods: {
+			getData({ reportType, queryDate }) {
+				uni.$u.api.operationalAnalysisApi.getTrafficFlowDataApi({ reportType, queryDate }).then(res => {
+					if (res.code === 200) {
+						if (res.data.itemList && res.data.itemList.length) {
+							this.chartData.categories = res.data.itemList.map(item => {
+								return item.statisTime
+							})
+							this.chartData.series[0].data = res.data.itemList.map(item => {
+								return item.vehicleCount
+							})
+						} else {
+							this.chartData.categories = []
+							this.chartData.series[0].data = []
+						}
+					}
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 151 - 89
pages/dataOverview/operationalAnalysis/operationalAnalysis.vue

@@ -15,22 +15,37 @@
 		</view>
 		</view>
 		<view class="operation-main">
 		<view class="operation-main">
 			<template v-if="currentType.value === 1">
 			<template v-if="currentType.value === 1">
-				<RevenueAnalysis :type="currentType.type" :chartData="currentType.data" :title="title"/>
+				<RevenueAnalysis ref="revenueAnalysis" :type="currentType.type" :title="title"/>
 			</template>
 			</template>
 			<template v-else-if="currentType.value === 2">
 			<template v-else-if="currentType.value === 2">
-				<RevenueAnalysis :type="currentType.type" :chartData="currentType.data" :title="title"/>
+				<RevenueAnalysis ref="revenueAnalysis" :type="currentType.type" :title="title"/>
 			</template>
 			</template>
 			<template v-else-if="currentType.value === 3">
 			<template v-else-if="currentType.value === 3">
-				<RevenueRanking :tableTh="currentType.tableTh" :tableData="currentType.tableData" :title="title"/>
+				<RevenueRanking ref="revenueRanking" :title="title"/>
 			</template>
 			</template>
 			<template v-else-if="currentType.value === 4">
 			<template v-else-if="currentType.value === 4">
-				<TrafficFlow :chartData="currentType.data" :title="title"/>
+				<TrafficFlow ref="trafficFlow" :title="title"/>
 			</template>
 			</template>
 			<template v-else-if="currentType.value === 5">
 			<template v-else-if="currentType.value === 5">
-				<TollCollectorPerformance type="table" :tableTh="currentType.tableTh" :tableData="currentType.tableData" :title="title"/>
+				<TollCollectorPerformance ref="tollCollectorPerformance" type="table" :title="title"/>
 			</template>
 			</template>
 			<template v-else-if="currentType.value === 6">
 			<template v-else-if="currentType.value === 6">
-				<TollCollectorPerformance type="line" :chartData="currentType.data" :title="title"/>
+				<TollCollectorPerformance ref="tollCollectorPerformance" type="line" :title="title"/>
+			</template>
+			<template v-else-if="currentType.value === 7">
+				<SectionAnalysis ref="sectionAnalysis" :title="title"/>
+			</template>
+			<template v-else-if="currentType.value === 8">
+				<ArrearsAnalysis :chartData="currentType.data" :title="title"/>
+			</template>
+			<template v-else-if="currentType.value === 9">
+				<IncomeAnalysis :chartData="currentType.data" :title="title"/>
+			</template>
+			<template v-else-if="currentType.value === 10">
+				<PaymentMethod :chartData="currentType.data" :title="title"/>
+			</template>
+			<template v-else-if="currentType.value === 11">
+				<SourceOfPayment :chartData="currentType.data" :title="title"/>
 			</template>
 			</template>
 		</view>
 		</view>
 		<!-- 分析类型 -->
 		<!-- 分析类型 -->
@@ -52,29 +67,44 @@
 	import RevenueRanking from './components/revenueRanking.vue'
 	import RevenueRanking from './components/revenueRanking.vue'
 	import TrafficFlow from './components/trafficFlow.vue'
 	import TrafficFlow from './components/trafficFlow.vue'
 	import TollCollectorPerformance from './components/tollCollectorPerformance.vue'
 	import TollCollectorPerformance from './components/tollCollectorPerformance.vue'
+	import SectionAnalysis from './components/sectionAnalysis.vue'
+	import ArrearsAnalysis from './components/arrearsAnalysis.vue'
+	import IncomeAnalysis from './components/incomeAnalysis.vue'
+	import SourceOfPayment from './components/sourceOfPayment.vue'
+	import PaymentMethod from './components/paymentMethod.vue'
 	export default {
 	export default {
 		components: {
 		components: {
 			RevenueAnalysis,
 			RevenueAnalysis,
 			RevenueRanking,
 			RevenueRanking,
 			TrafficFlow,
 			TrafficFlow,
-			TollCollectorPerformance
+			TollCollectorPerformance,
+			SectionAnalysis,
+			ArrearsAnalysis,
+			IncomeAnalysis,
+			SourceOfPayment,
+			PaymentMethod
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
 				tabList: [{
 				tabList: [{
 						label: '年',
 						label: '年',
-						value: 1
+						value: 2
 					},
 					},
 					{
 					{
 						label: '月',
 						label: '月',
-						value: 2
+						value: 1
 					},
 					},
 					{
 					{
 						label: '日',
 						label: '日',
-						value: 3
+						value: 0
 					}
 					}
 				],
 				],
-				tabCur: 1,
+				tabCur: 2,
+				// 参数
+				params: {
+					reportType: 2,
+					queryDate: ''
+				},
 				// 类型
 				// 类型
 				typePicker: false,
 				typePicker: false,
 				currentType: {},
 				currentType: {},
@@ -83,79 +113,42 @@
 							text: '营收分析(折线)',
 							text: '营收分析(折线)',
 							value: 1,
 							value: 1,
 							type: 'line',
 							type: 'line',
-							data: {
-								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
-								series: [{
-									name: '',
-									data: [10, 10, 20, 30, 40, 0, 0, 0, 0, 0, 0, 0]
-								}]
-							}
+							key: 'revenueAnalysis'
 						},
 						},
 						{
 						{
 							text: '营收分析(柱状)',
 							text: '营收分析(柱状)',
 							value: 2,
 							value: 2,
 							type: 'column',
 							type: 'column',
-							data: {
-								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
-								series: [{
-									name: '',
-									data: [10, 10, 20, 30, 40, 0, 0, 0, 0, 0, 0, 0]
-								}]
-							}
+							key: 'revenueAnalysis'
 						},
 						},
 						{
 						{
 							text: '路段/停车场营收排行',
 							text: '路段/停车场营收排行',
 							value: 3,
 							value: 3,
-							tableTh: [
-								{ width: 100, field: '路段编号', key: 'roadNum' },
-								{ width: 100, field: '路段名称', key: 'roadName' },
-								{ width: 100, field: '收益(元)', key: 'income' },
-							],
-							tableData: {
-								current: 1,
-								total: 10,
-								list: [
-									{ roadNum: 'RN00000009', roadName: '可处路1', income: 100.36 },
-									{ roadNum: 'RN00000010', roadName: '可处路2', income: 101.03 },
-									{ roadNum: 'RN00000011', roadName: '可处路3', income: 102.01 },
-									{ roadNum: 'RN00000012', roadName: '可处路4', income: 103.02 }
-								]
-							}
+							key: 'revenueRanking'
 						},
 						},
 						{
 						{
 							text: '车流量分析',
 							text: '车流量分析',
 							value: 4,
 							value: 4,
-							data: {
-								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
-								series: [{
-									name: '',
-									data: [10, 10, 20, 30, 40, 0, 0, 0, 0, 0, 0, 0]
-								}]
-							}
+							key: 'trafficFlow'
 						},
 						},
 						{
 						{
 							text: '收费员业绩排行',
 							text: '收费员业绩排行',
 							value: 5,
 							value: 5,
-							tableTh: [
-								{ width: 100, field: '工号', key: 'workNum' },
-								{ width: 100, field: '姓名', key: 'name' },
-								{ width: 100, field: '收益(元)', key: 'income' },
-							],
-							tableData: {
-								current: 1,
-								total: 10,
-								list: [
-									{ workNum: '5001', name: '李四', income: 100.36 },
-									{ workNum: '5001', name: '张三', income: 100.36 },
-									{ workNum: '5001', name: '王五', income: 100.36 },
-									{ workNum: '5001', name: '刘刘', income: 100.36 },
-									{ workNum: '5001', name: '李四', income: 100.36 }
-								]
-							}
+							key: 'tollCollectorPerformance'
 						},
 						},
 						{
 						{
 							text: '收费员业绩分析',
 							text: '收费员业绩分析',
 							value: 6,
 							value: 6,
+							key: 'tollCollectorPerformance'
+						},
+						{
+							text: '路段分析',
+							value: 7,
+							key: 'sectionAnalysis'
+						},
+						{
+							text: '欠费分析',
+							value: 8,
 							data: {
 							data: {
 								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
 								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
 								series: [{
 								series: [{
@@ -164,47 +157,94 @@
 								}]
 								}]
 							}
 							}
 						},
 						},
-						{
-							text: '路段分析',
-							value: 7
-						},
-						{
-							text: '欠费分析',
-							value: 8
-						},
 						{
 						{
 							text: '收入分析',
 							text: '收入分析',
-							value: 9
+							value: 9,
+							data: {
+								categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+								series: [{
+									name: '',
+									data: [10, 10, 20, 30, 40, 0, 0, 0, 0, 0, 0, 0]
+								}]
+							}
 						},
 						},
 						{
 						{
 							text: '支付方式占比',
 							text: '支付方式占比',
-							value: 10
+							value: 10,
+							data: {
+								series: [{
+									data: [{
+											"name": "一班",
+											"value": 50
+										},
+										{
+											"name": "二班",
+											"value": 30
+										},
+										{
+											"name": "三班",
+											"value": 20
+										},
+										{
+											"name": "四班",
+											"value": 18
+										},
+										{
+											"name": "五班",
+											"value": 8
+										}
+									]
+								}]
+							}
 						},
 						},
 						{
 						{
 							text: '支付来源分析',
 							text: '支付来源分析',
-							value: 11
+							value: 11,
+							data: {
+								categories: [1, 2, 3, 4, 5],
+								series: [{
+									name: '',
+									data: [10, 10, 20, 30, 40]
+								}]
+							}
 						}
 						}
 					]
 					]
 				],
 				],
+				title: '',
 				// 年
 				// 年
 				yearPicker: false,
 				yearPicker: false,
 				yearList: this.getYearList(),
 				yearList: this.getYearList(),
 				defaultYear: [4],
 				defaultYear: [4],
-				title: '2022年',
+				currentYear: '',
+				yearObj: {},
 				// 月
 				// 月
 				monthPicker: false,
 				monthPicker: false,
 				monthList: this.getMonthList(),
 				monthList: this.getMonthList(),
 				defaultMonth: [],
 				defaultMonth: [],
+				currentMonth: '01',
+				monthObj: {},
 				// 日
 				// 日
 				dayPicker: false,
 				dayPicker: false,
 				dayList: this.getDayList(),
 				dayList: this.getDayList(),
-				defaultDay: []
+				defaultDay: [],
+				currentDay: '01',
+				dayObj: {}
 			}
 			}
 		},
 		},
 		onShow() {
 		onShow() {
-			this.currentType = this.typeList[0][0]
+			this.currentType = this.typeList[0][6]
+			this.defaultSetVal();
 		},
 		},
 		methods: {
 		methods: {
+			defaultSetVal() {
+				this.currentYear = this.yearList[0][4].value
+				this.title = this.yearList[0][4].text
+				this.yearObj = this.yearList[0][4]
+				this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`
+				setTimeout(() => {
+					this.$refs[this.currentType.key].getData(this.params)
+				}, 500)
+			},
 			getYearList() {
 			getYearList() {
 				const date = new Date()
 				const date = new Date()
 				const year = date.getFullYear();
 				const year = date.getFullYear();
@@ -213,8 +253,8 @@
 				]
 				]
 				for (let i = year - 4; i < year + 1; i++) {
 				for (let i = year - 4; i < year + 1; i++) {
 					const obj = {
 					const obj = {
-						text: i + '年',
-						value: i
+						text: String(i),
+						value: String(i)
 					}
 					}
 					list[0].push(obj)
 					list[0].push(obj)
 				}
 				}
@@ -228,8 +268,12 @@
 				]
 				]
 				for (let i = 1; i < 13; i++) {
 				for (let i = 1; i < 13; i++) {
 					const obj = {
 					const obj = {
-						text: i + '月',
-						value: i
+						text: String(i),
+						value: String(i)
+					}
+					if (i < 10) {
+						obj.text = '0' + i
+						obj.value = '0' + i
 					}
 					}
 					list[0].push(obj)
 					list[0].push(obj)
 				}
 				}
@@ -249,8 +293,12 @@
 				]
 				]
 				for (let i = 1; i < dayLen + 1; i++) {
 				for (let i = 1; i < dayLen + 1; i++) {
 					const obj = {
 					const obj = {
-						text: i + '日',
-						value: i
+						text: String(i),
+						value: String(i)
+					}
+					if (i < 10) {
+						obj.text = '0' + i
+						obj.value = '0' + i
 					}
 					}
 					list[0].push(obj)
 					list[0].push(obj)
 				}
 				}
@@ -266,16 +314,17 @@
 			tabClick(item) {
 			tabClick(item) {
 				this.tabCur = item.value
 				this.tabCur = item.value
 				switch (item.value) {
 				switch (item.value) {
-					case 1:
-						this.yearPicker = true
+					case 0:
+						this.dayPicker = true
 						break
 						break
-					case 2:
+					case 1:
 						this.monthPicker = true
 						this.monthPicker = true
 						break
 						break
-					case 3:
-						this.dayPicker = true
+					case 2:
+						this.yearPicker = true
 						break
 						break
 				}
 				}
+				this.params.reportType = this.tabCur
 			},
 			},
 			/**
 			/**
 			 * 选择器确认
 			 * 选择器确认
@@ -288,16 +337,29 @@
 			yearConfirm(e) {
 			yearConfirm(e) {
 				this.defaultYear = [e.indexs[0]]
 				this.defaultYear = [e.indexs[0]]
 				this.title = e.value[0].text
 				this.title = e.value[0].text
+				this.currentYear = e.value[0].value
+				this.yearObj = e.value[0]
+				this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`
+				this.$refs[this.currentType.key].getData(this.params)
 				this.yearPicker = false
 				this.yearPicker = false
 			},
 			},
 			monthConfirm(e) {
 			monthConfirm(e) {
 				this.defaultMonth = [e.indexs[0]]
 				this.defaultMonth = [e.indexs[0]]
-				this.title = e.value[0].text
+				this.currentMonth = e.value[0].value
+				this.monthObj = e.value[0]
+				this.title = `${this.yearObj.text}-${this.monthObj.text}`
+				this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`
+				this.$refs[this.currentType.key].getData(this.params)
 				this.monthPicker = false
 				this.monthPicker = false
 			},
 			},
 			dayConfirm(e) {
 			dayConfirm(e) {
 				this.defaultDay = [e.indexs[0]]
 				this.defaultDay = [e.indexs[0]]
 				this.title = e.value[0].text
 				this.title = e.value[0].text
+				this.currentDay = e.value[0].value
+				this.dayObj = e.value[0]
+				this.title = `${this.yearObj.text}-${this.monthObj.text}-${this.dayObj.text}`
+				this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`
+				this.$refs[this.currentType.key].getData(this.params)
 				this.dayPicker = false
 				this.dayPicker = false
 			}
 			}
 		}
 		}

+ 65 - 10
pages/dataOverview/todayOverview/todayOverview.vue

@@ -12,7 +12,7 @@
 					<view class="title">今日营收</view>
 					<view class="title">今日营收</view>
 					<view class="content">
 					<view class="content">
 						<view class="content-left">
 						<view class="content-left">
-							<text>23890.02</text>元
+							<text>{{ todayData.amtIn || 0 }}</text>元
 						</view>
 						</view>
 						<view class="content-right">
 						<view class="content-right">
 							<u--image :src="require('@/static/icons/trending-up-icon.svg')" width="59px" height="36px">
 							<u--image :src="require('@/static/icons/trending-up-icon.svg')" width="59px" height="36px">
@@ -24,19 +24,19 @@
 					<view class="list">
 					<view class="list">
 						<view class="list-item">
 						<view class="list-item">
 							<view class="list-item-total">
 							<view class="list-item-total">
-								<text>2342.00</text>元
+								<text>{{ todayData.amtOwe || 0 }}</text>元
 							</view>
 							</view>
 							<view class="list-item-title">今日欠费</view>
 							<view class="list-item-title">今日欠费</view>
 						</view>
 						</view>
 						<view class="list-item">
 						<view class="list-item">
 							<view class="list-item-total">
 							<view class="list-item-total">
-								<text>324</text>次
+								<text>{{ todayData.countVehicle || 0 }}</text>次
 							</view>
 							</view>
 							<view class="list-item-title">今日停车</view>
 							<view class="list-item-title">今日停车</view>
 						</view>
 						</view>
 						<view class="list-item">
 						<view class="list-item">
 							<view class="list-item-total">
 							<view class="list-item-total">
-								<text>203</text>次
+								<text>{{ todayData.countQr || 0 }}</text>次
 							</view>
 							</view>
 							<view class="list-item-title">今日扫码</view>
 							<view class="list-item-title">今日扫码</view>
 						</view>
 						</view>
@@ -53,7 +53,7 @@
 						<view class="title">路段总数</view>
 						<view class="title">路段总数</view>
 						<view class="content">
 						<view class="content">
 							<view class="content-left">
 							<view class="content-left">
-								<text>23</text>个
+								<text>{{ roadData.roadTotal || 0 }}</text>个
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -61,7 +61,7 @@
 						<view class="title">泊位总数</view>
 						<view class="title">泊位总数</view>
 						<view class="content">
 						<view class="content">
 							<view class="content-left">
 							<view class="content-left">
-								<text>23</text>个
+								<text>{{ roadData.spaceTotal || 0 }}</text>个
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -77,7 +77,7 @@
 						<view class="title">停车场总数</view>
 						<view class="title">停车场总数</view>
 						<view class="content">
 						<view class="content">
 							<view class="content-left">
 							<view class="content-left">
-								<text>23</text>个
+								<text>{{ parkingLotData.total || 0 }}</text>个
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -85,13 +85,14 @@
 						<view class="title">泊位总数</view>
 						<view class="title">泊位总数</view>
 						<view class="content">
 						<view class="content">
 							<view class="content-left">
 							<view class="content-left">
-								<text>23</text>个
+								<text>{{ parkingLotData.total || 0 }}</text>个
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -99,11 +100,65 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-
+				todayData: {},
+				roadData: {},
+				parkingLotData: {}
 			}
 			}
 		},
 		},
+		onShow() {
+			this.getTodayData();
+			this.getRoadData();
+			// this.getParkingLotData();
+		},
 		methods: {
 		methods: {
-
+			/**
+			 * 获取今日概况
+			 */
+			getTodayData() {
+				uni.$u.api.todayOverviewApi.getTodayDataApi().then(res => {
+					if (res.code === 200) {
+						this.todayData = res.data
+					} else {
+						this.$refs.uToast.show({
+							loading: true,
+							message: res.msg || '获取今日概况失败!',
+							type: 'error'
+						})
+					}
+				})
+			},
+			/**
+			 * 获取路段概况
+			 */
+			getRoadData() {
+				uni.$u.api.todayOverviewApi.getRoadDataApi().then(res => {
+					if (res.code === 200) {
+						this.roadData = res.data
+					} else {
+						this.$refs.uToast.show({
+							loading: true,
+							message: res.msg || '获取路段概况失败!',
+							type: 'error'
+						})
+					}
+				})
+			},
+			/**
+			 * 获取停车场概况
+			 */
+			getParkingLotData() {
+				uni.$u.api.todayOverviewApi.getParkingLotDataApi().then(res => {
+					if (res.code === 200) {
+						this.parkingLotData = res.data
+					} else {
+						this.$refs.uToast.show({
+							loading: true,
+							message: res.msg || '获取停车场概况失败!',
+							type: 'error'
+						})
+					}
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 16 - 1
pages/index/index.vue

@@ -64,6 +64,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -158,7 +159,21 @@
 					content: '你确认退出登录?',
 					content: '你确认退出登录?',
 					success: (res) => {
 					success: (res) => {
 						if (res.confirm) {
 						if (res.confirm) {
-							this.jumpPage('pages/login/login')
+							uni.$u.api.logoutApi().then(res => {
+								console.log(res)
+								if (res.code === 200) {
+									uni.$u.vuex('vuex_token', '');
+									this.$u.vuex('vuex_user', {});
+									this.$u.vuex('vuex_isLogin', false);
+									this.jumpPage('pages/login/login')
+								} else {
+									this.$refs.uToast.show({
+										loading: true,
+										message: res.msg || '退出登录失败!',
+										type: 'error'
+									})
+								}
+							})
 						}
 						}
 					}
 					}
 				});
 				});

+ 31 - 10
pages/login/login.vue

@@ -27,6 +27,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -60,16 +61,36 @@
 			submitLogin() {
 			submitLogin() {
 				this.$refs.uForm.validate().then(res => {
 				this.$refs.uForm.validate().then(res => {
 					this.loading = true
 					this.loading = true
-					// uni.$u.api.loginApi(this.form).then(res => {
-					// 	console.log(res)
-					// 	uni.$u.route({
-					// 		url: 'pages/index/index'
-					// 	})
-					// }).catch(err => {
-					// 	this.loading = false
-					// })
-					uni.$u.route({
-						url: 'pages/index/index'
+					const form = {
+						...this.form
+					}
+					uni.$u.api.loginApi({
+						telephone: form.phoneNumber,
+						loginPwd: form.password
+					}).then(res => {
+						if (res.code === 200) {
+							uni.$u.vuex('vuex_token', res.data.token);
+							this.$u.vuex('vuex_user', res.data);
+							this.$u.vuex('vuex_isLogin', true);
+							this.$refs.uToast.show({
+								loading: true,
+								message: '登录成功!',
+								type: 'success',
+								complete() {
+									uni.$u.route({
+										url: 'pages/index/index'
+									})
+								}
+							})
+						} else {
+							this.$refs.uToast.show({
+								loading: true,
+								message: res.msg || '登录失败',
+								type: 'error'
+							})
+						}
+					}).catch(err => {
+						this.loading = false
 					})
 					})
 				}).catch(errors => {
 				}).catch(errors => {
 					uni.$u.toast(errors[0].message || '必填项不能为空!')
 					uni.$u.toast(errors[0].message || '必填项不能为空!')

+ 3 - 2
store/index.js

@@ -13,7 +13,7 @@ try {
 
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
 
 
-let saveStateKeys = ['vuex_user', 'vuex_isLogin'];
+let saveStateKeys = ['vuex_user', 'vuex_isLogin', 'vuex_token'];
 
 
 // 保存变量到本地存储中
 // 保存变量到本地存储中
 const saveLifeData = function(key, value) {
 const saveLifeData = function(key, value) {
@@ -33,7 +33,8 @@ const store = new Vuex.Store({
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
 		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
 		vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
 		vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
-		vuex_isLogin: lifeData.vuex_isLogin ? lifeData.vuex_isLogin : false
+		vuex_isLogin: lifeData.vuex_isLogin ? lifeData.vuex_isLogin : false,
+		vuex_token: lifeData.vuex_token ? lifeData.vuex_token : false
 	},
 	},
 	mutations: {
 	mutations: {
 		$uStore(state, payload) {
 		$uStore(state, payload) {

+ 15 - 0
vue.config.js

@@ -0,0 +1,15 @@
+module.exports = {
+	devServer:{
+		port: '8090',
+		disableHostCheck:true,
+		proxy:{
+			'/api':{
+				target: 'http://172.16.90.64:7000/',
+				changeOrigin: true,
+				pathRewrite:{
+					'^/api': ''
+				}
+			}
+		}
+	}
+}