李天标 hace 5 años
padre
commit
65b6d46615
Se han modificado 5 ficheros con 52 adiciones y 11 borrados
  1. 2 1
      main.js
  2. 37 9
      pages/Charts/mainStatistics.vue
  3. 3 0
      pages/User/equipmentStatusList.vue
  4. 3 1
      pages/User/user.vue
  5. 7 0
      store/modules/chart.js

+ 2 - 1
main.js

@@ -11,7 +11,8 @@ Vue.config.productionTip = !!env.isProduction;
 
 App.mpType = 'app'
 
-Vue.prototype.serverurl="http://127.0.0.1:8090";
+// Vue.prototype.serverurl="http://127.0.0.1:8090";
+Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
 
 Vue.prototype.$store = store;
 

+ 37 - 9
pages/Charts/mainStatistics.vue

@@ -2,13 +2,14 @@
 	<view>
 		<view class="head">
 			<view class="company">
-				<font style="color: #F76260;">申泽棉花糖后台</font>
+				<font style="color: #F76260;">申泽智能物联</font>
 			</view>
 			<view class="pname">
 				<font class="wenzi" style="color: #F76260;text-align:right">用户:{{pname}}</font>
 			</view>
 		</view>
 		<view class="qiun-title-bar color">
+			<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">总投放机器数量: {{machineTotalNum}}  工作机器数量:{{machineUseNum}}</font></view>
 			<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">今日收入总额: {{dayTotalMoney}}  销售数量:{{dayTotalNum}}</font></view>
 			<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本周收入总额: {{weekTotalMoney}}  销售数量:{{weekTotalNum}}</font></view>
 			<view class="qiun-title-dot-light1"><font style="color: #FFFFFF;">本月收入总额: {{monthTotalMoney}}  销售数量:{{monthTotalNum}}</font></view>
@@ -77,6 +78,7 @@
 	import { mapState, mapActions, mapMutations } from 'vuex';
 	import uCharts from '@/components/u-charts/u-charts.js';
 	import {dateUtils} from '@/common/util.js';
+	
 	var _self;
 	var canvaColumn1=null;
 	var canvaColumn2=null;
@@ -91,6 +93,8 @@
 		data() {
 			return {
 				pname:'',
+				machineTotalNum:0,
+				machineUseNum:0,
 				dayTotalMoney:0,
 				dayTotalNum:0,
 				weekTotalMoney:0,
@@ -134,23 +138,27 @@
 			this.init();
 		},
 		methods: {
-			...mapActions('chart', ['getStatistics','getMainStatistics']),
+			...mapActions('chart', ['getStatistics','getMainStatistics','getMachineNum']),
 			async init(){
 				console.log("adminId:" + this.adminId)
 				console.log("equipmentId:" + this.equipmentId)
 				_self = this;
-				this.cWidth = uni.upx2px(750);
-				this.cHeight = uni.upx2px(500);
-				
+				//图表中图
+				this.cWidth = uni.upx2px(600);
+				this.cHeight = uni.upx2px(430);
+
 				await this.getMainStatisticsData();
 				
 				await this.initDateRang(new Date(),'day');
 				await this.initDateRang(new Date(),'week');
 				await this.initDateRang(new Date(),'month');
 				await this.initDateRang(new Date(),'year');
+				
 				//初次登陆跳转后,把test变成2
 				uni.setStorageSync('test', '2');
+				
 			},
+		
 			initDateRang(day,chartType) {
 				const daystr = dateUtils.formateDate(day, 'yyyy/MM/dd');
 				if(chartType === 'day'){
@@ -242,6 +250,7 @@
 				if (this.equipmentId) {
 					param['equipmentId'] = this.equipmentId;
 				}
+				
 				return this.getStatistics(param)
 					.then(data => {
 							uni.stopPullDownRefresh();
@@ -257,6 +266,7 @@
 							if(param['chartType']=='year'){
 								canvaColumn4 = this.initChart('canvaColumn4',data);
 							}
+							
 						}
 					, _ => {
 							uni.stopPullDownRefresh();
@@ -283,7 +293,7 @@
 					type: 'column',
 					legend: true,
 					fontSize: 11,
-					background: '#E5FDC3',
+					background: '#E5FDC3',//y轴颜色
 					pixelRatio: 1,
 					animation: true,
 					categories: chartData.categories,
@@ -294,8 +304,8 @@
 						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
 						scrollShow: true, //新增是否显示滚动条,默认false
 						scrollAlign: 'left', //滚动条初始位置
-						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
-						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF  滚动条颜色底色
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6  滚动条颜色
 						// disableGrid:true,
 					},
 					yAxis: {
@@ -322,7 +332,23 @@
 				if (this.equipmentId) {
 					param['equipmentId'] = this.equipmentId;
 				}
-				console.log('getMainStatisticsData:{}',param)
+				console.log('getMainStatisticsData:{}',param);
+				var adminId = param.adminId;
+				var equipmentId = this.equipmentId;
+				var serverurl = this.serverurl;
+				uni.request({
+				    url: serverurl+'/TEquipment/getMachineNum', 
+					data:{
+						"adminId":adminId,
+						"equipmentId":equipmentId
+					},
+				    method:"POST",
+				    success: (res) => {
+							var list = res.data.data;
+							this.machineTotalNum = list[0];
+							this.machineUseNum = list[1];
+				    }
+				});
 				return this.getMainStatistics(param)
 					.then(data => {
 						for (let bean of data) {
@@ -347,6 +373,7 @@
 					}
 					, _ => void uni.stopPullDownRefresh());
 			},
+
 			touchLine1(e) {
 				if(canvaColumn1){
 					canvaColumn1.scrollStart(e);
@@ -492,6 +519,7 @@
 		width: 100%;
 		/* padding: 10upx 2%; */
 		flex-wrap: nowrap;
+		border-radius: 15upx;
 	}
 	.color{
 		background:#56de9e;

+ 3 - 0
pages/User/equipmentStatusList.vue

@@ -99,6 +99,9 @@
 		onPullDownRefresh() {
 			this.getEquipmentListData();
 		},
+		onShow() {
+			this.getEquipmentListData();
+		},
 		methods: {
 			...mapActions('chart', ['getEquipmentListByUser']),
 			getMerchantTitle(merchant){

+ 3 - 1
pages/User/user.vue

@@ -18,6 +18,9 @@
 			</view>
 		</view>
 		<view v-if="show">
+			<view class="">
+				修改设备名称
+			</view>
 			<view v-for="(list,index) in listName" :key="index" class="body">
 				<view class="input-two">
 					<input :id=list.id type="text" class="input" @focus="setStyle()" @blur="setStyle2()" :value=list.name @input="getValue" />
@@ -129,7 +132,6 @@
 				if (this.parm.id != null) {
 					this.updata(this.parm)
 						.then(res => {
-							var merchantList = res;
 							uni.showModal({
 								title: '提示',
 								content: '名称:' + this.parm.name + res.message,

+ 7 - 0
store/modules/chart.js

@@ -33,6 +33,13 @@ export default {
 					return res;
 				});
 		},
+		getMachineNum({ commit },param) {
+			return apis.sz.post('/TEquipment/getMachineNum',param)
+				.then(res => {
+					const { data } = res;
+					return data;
+				});
+		},
 	}
 }