吴洪双 5 роки тому
батько
коміт
38c218298f

+ 1 - 1
configs/env.js

@@ -22,4 +22,4 @@ if (process.env.NODE_ENV === 'production') {
 	});
 }
 
-export default configs;
+export default configs;

+ 1 - 3
main.js

@@ -4,7 +4,6 @@ import apis from './configs/http';
 import store from './store';
 import env from '@/configs/env';
 import mainStatistics from '@/pages/Charts/mainStatistics';
-import equipmentStatistics from '@/pages/Charts/equipmentStatistics';
 
 
 
@@ -27,5 +26,4 @@ Object.keys(apis).forEach(key => {
 	Vue.prototype[`$${key}`] = apis[key];
 });
 
-Vue.component('mainStatistics', mainStatistics);
-Vue.component('equipmentStatistics', equipmentStatistics);
+Vue.component('mainStatistics', mainStatistics);

+ 1 - 1
pages.json

@@ -84,7 +84,7 @@
 				"text": "机器销售"
 			},
 			{
-				"pagePath": "pages/User/equipmentSratisticsList",
+				"pagePath": "pages/Charts/equipmentStatistics",
 				"iconPath": "static/img/equipmentSratisticsList.png",
 				"selectedIconPath": "static/img/equipmentSratisticsListHL.png",
 				"text": "机器排行"

+ 1 - 1
pages/Charts/elseStatistics.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<mainStatistics :pname="pnameData" :equipmentId="equipmentIdData" :adminId="adminIdData" style="padding: 20upx;"></mainStatistics>
+		<mainStatistics :pname="pnameData" :equipmentId="equipmentIdData" :adminId="adminIdData"></mainStatistics>
 	</view>
 </template>
 

+ 73 - 40
pages/Charts/equipmentStatistics.vue

@@ -11,6 +11,7 @@
 				<font style="color: #BDD6F3;font-size:28upx">申泽智能物联</font>
 			</view>
 		</view>
+		<view class="line"></view>
 		<view class="qiun-columns">
 			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
 				<view class="qiun-title-dot-light">今日销售情况</view>
@@ -25,6 +26,7 @@
 				 @touchend="touchEndLine1" style="background-color: #E5FDC3;"></canvas>
 			</view>
 		</view>
+		<view class="line"></view>
 		<view class="qiun-columns">
 			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
 				<view class="qiun-title-dot-light">本周销售情况</view>
@@ -39,6 +41,7 @@
 				 @touchend="touchEndLine2" style="background-color: #E5FDC3;"></canvas>
 			</view>
 		</view>
+		<view class="line"></view>
 		<view class="qiun-columns">
 			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
 				<view class="qiun-title-dot-light">本月销售情况</view>
@@ -53,6 +56,7 @@
 				 @touchend="touchEndLine3" style="background-color: #E5FDC3;"></canvas>
 			</view>
 		</view>
+		<view class="line"></view>
 		<view class="qiun-columns">
 			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
 				<view class="qiun-title-dot-light">本年销售情况</view>
@@ -104,12 +108,12 @@
 		computed: {
 			...mapState(['loginUser']),
 		},
-		onLoad(option){
-			console.log("onLoad");
-			this.adminId = option['adminId'];
-			this.pname = option['pname'];
-			this.init();
-		},
+		// onLoad(option){
+		// 	console.log("onLoad");
+		// 	this.adminId = option['adminId'];
+		// 	this.pname = option['pname'];
+		// 	this.init();
+		// },
 		mounted() {
 			console.log("mounted");
 			this.init();
@@ -274,6 +278,7 @@
 					xAxis: {
 						type: 'grid',
 						gridType: 'dash',
+						rotateLabel: true,
 						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						scrollAlign: 'left', //滚动条初始位置
@@ -385,92 +390,104 @@
 <style>
 	page {
 		/* background: #F2F2F2; */
-		background:#FFFFFF;
+		background: #FFFFFF;
 		width: 750upx;
 		overflow-x: hidden;
 	}
-	.head{
+	
+	.head {
 		display: flex;
 		flex-direction: row;
-		background:#206DC3;
+		background: #206DC3;
 		width: 750upx;
-		height: 80upx;
-		margin-bottom: 20upx;
+		height: 60upx;
 	}
-	.company{
+	
+	.company {
 		width: 48%;
-		text-align:right;
+		text-align: right;
 	}
-	.pname{
+	
+	.pname {
 		display: flex;
 		flex-direction: row;
 		width: 40%;
 	}
-	.userFlagimg{
+	
+	.userFlagimg {
 		padding-left: 10upx;
 		padding-top: 10upx;
 		width: 26upx;
 		height: 28upx;
 	}
-	.wenzi{
+	
+	.wenzi {
 		padding-right: 0upx;
 		/* text-align:right; */
 		white-space: nowrap;
 		overflow: hidden;
 		/* text-overflow: ellipsis; */
 	}
-	.ri{
+	
+	.ri {
 		width: 690upx;
 		height: 180upx;
-		background:#FFFFFF;
+		background: #FFFFFF;
 		border-radius: 15upx;
 		/* 上移 */
 		transform: translateY(-90upx);
-		text-align:center;
+		text-align: center;
 		margin: auto;
 		display: flex;
 		flex-direction: row;
 		/* 阴影 */
-		box-shadow:0upx -1upx   20upx #D3D3D3;
+		box-shadow: 0upx -1upx 20upx #D3D3D3;
 		/* box-shadow:0px 0px  10px 5px #aaa; */
 	}
-	.riShell{
+	
+	.riShell {
 		display: flex;
 		flex-direction: row;
 		margin: auto;
 	}
-	.riTitle{
+	
+	.riTitle {
 		display: flex;
 		flex-direction: column;
 		margin: auto;
 	}
-	.riqi{
+	
+	.riqi {
 		display: flex;
 		flex-direction: column;
 		margin: auto;
 	}
-	.fourTitle{
+	
+	.fourTitle {
 		width: 690upx;
 		height: 294upx;
 		display: flex;
 		flex-direction: row;
-		flex-wrap:wrap;
-		background:#FFFFFF;
-		box-shadow:0upx 0upx   20upx #D3D3D3;
+		flex-wrap: wrap;
+		background: #FFFFFF;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		margin: auto;
 		border-radius: 15upx;
 		transform: translateY(-60upx);
-		}
-	.four{
+	}
+	
+	.four {
 		display: flex;
 		flex-direction: row;
 		margin: auto;
 		width: 48%;
 	}
-	.fourImg{
+	
+	.fourImg {
 		width: 54upx;
 		height: 54upx;
 	}
+	
 	.qiun-padding {
 		padding: 2%;
 		width: 96%;
@@ -493,7 +510,7 @@
 	
 	.qiun-common-mt {
 		margin-top: 0upx;
-		height: 200upx;
+		height: 160upx;
 	}
 	
 	.qiun-bg-white {
@@ -506,42 +523,58 @@
 		flex-wrap: nowrap;
 		border-radius: 15upx;
 	}
+	
 	.qiun-title-dot-light {
-		border-left: 30upx solid #0ea391;
-		padding-top: 20upx;
-		/* border-left: 20upx; */
+		width: 92%;
+		border-left: 20upx;
+		border-left: 10upx solid #0ea391;
 		padding-left: 10upx;
-		height: 85upx;
+		height: 32upx;
+		padding-bottom: 40upx;
 		font-family: "PingFang-SC-Bold";
 		font-weight: bold;
 		margin: auto;
 		font-size: 32upx;
 		color: #363D44;
 	}
-	.shijian{
+	
+	.shijian {
 		padding-top: 30upx;
 		height: 80upx;
 		width: 690upx;
 		margin: auto;
-		box-shadow:0upx 0upx 10upx #D3D3D3;
+		box-shadow: 0upx 0upx 10upx #D3D3D3;
+	}
+	.line{
+		background:#ECECEC ;
+		height: 20upx;
 	}
 	.qiun-charts {
 		width: 690upx;
 		height: 370upx;
-		padding-top: 30upx;
+		padding-top: 50upx;
 		background-color: #FFFFFF;
 		margin: auto;
 	}
+	
 	.charts {
 		width: 690upx;
 		height: 370upx;
 		background-color: #FFFFFF;
 		margin: auto;
 	}
+	
 	.preImg {
-		position: absolute;left: 40upx; width: 27upx;height: 45upx;
+		position: absolute;
+		left: 40upx;
+		width: 27upx;
+		height: 45upx;
 	}
+	
 	.nextImg {
-		position: absolute;right: 40upx; width: 27upx;height: 45upx;
+		position: absolute;
+		right: 40upx;
+		width: 27upx;
+		height: 45upx;
 	}
 </style>

+ 15 - 13
pages/Charts/mainStatistics.vue

@@ -5,7 +5,7 @@
 				<image class="userFlagimg" src="../../static/img/userFlag.png" mode=""></image>
 			</view>
 			<view class="pname">
-				<font class="wenzi" style="color: #BDD6F3;font-size:28upx">用户:{{pname}}</font>
+				<font class="wenzi" style="color: #BDD6F3;font-size:28upx">用户:{{pnameData}}</font>
 			</view>
 			<view class="company">
 				<font style="color: #BDD6F3;font-size:28upx">申泽智能物联</font>
@@ -215,19 +215,25 @@
 		},
 		computed: {
 			...mapState(['loginUser']),
+			pnameData:{
+				get(){
+					return this.pname;
+				}
+			},
 		},
 		// onLoad(option){
 		// 	console.log("onLoad")
 		// 	this.init();
 		// },
-		onShow() {
-			var test = uni.getStorageSync('test');
-			//判断是不是初次登陆
-			if (test == 2) {
-				this.init();
-			}
-			this.day();
-		},
+		// onShow() {
+		// 	console.log("onShow");
+		// 	var test = uni.getStorageSync('test');
+		// 	//判断是不是初次登陆
+		// 	if (test == 2) {
+		// 		this.init();
+		// 	}
+		// 	this.day();
+		// },
 		mounted() {
 			console.log("mounted");
 			this.init();
@@ -236,13 +242,9 @@
 		methods: {
 			...mapActions('chart', ['getStatistics', 'getMainStatistics', 'getMachineNum']),
 			async init() {
-				console.log('pname:{}', this.pname);
 				if (!this.pname) {
-					console.log('loginUser:{}', this.loginUser)
 					this.pname = this.loginUser.name;
 				}
-				console.log("adminId:" + this.adminId)
-				console.log("equipmentId:" + this.equipmentId)
 				_self = this;
 				//图表中图
 				this.cWidth = uni.upx2px(690);