李天标 4 gadi atpakaļ
vecāks
revīzija
f6e4f844d7

+ 2 - 2
configs/env.js

@@ -9,8 +9,8 @@ let configs = {
 if (process.env.NODE_ENV === 'development') {
 	// 测试环境
 	configs = Object.assign(configs, {
-		// baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
-		baseUrl: 'http://127.0.0.1:8090',
+		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
+		// baseUrl: 'http://127.0.0.1:8090',
 		// baseUrl: 'http://127.0.0.1:8686',
 	});
 }

+ 12 - 2
main.js

@@ -33,6 +33,16 @@ import mainStatistics from '@/pages/Charts/mainStatistics';
 //   },
 // })
 Vue.use(VueI18n)
+
+// Vue.use(VueI18n,{
+// 	i18n: function(path, options) {
+// 	    let value = i18n.t(path, options)
+// 	    if (value !== null && value !== undefined) {
+// 	      return value
+// 	    }
+// 	    return ''
+// 	  }
+// })
 Vue.config.productionTip = !!env.isProduction;
 const i18n = new VueI18n({  
   // locale: 'en-US',  // 默认选择的语言
@@ -45,8 +55,8 @@ const i18n = new VueI18n({
 
 App.mpType = 'app'
 // Vue.prototype.serverurl="http://127.0.0.1:8686";
-Vue.prototype.serverurl="http://127.0.0.1:8090";
-// Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
+// Vue.prototype.serverurl="http://127.0.0.1:8090";
+Vue.prototype.serverurl="https://app.sunzee.com.cn/ShenzeeServer";
 Vue.prototype.$store = store;
 Vue.prototype._i18n = i18n;
 const app = new Vue({

+ 9 - 9
packageA/pages/remote/alarmClockItem.vue

@@ -141,7 +141,7 @@
 				this.getEquipmentListByUser(this.globalUser)
 					.then(data => {
 						// this.merchantList = data;
-						console.log("1223");
+						// console.log("1223");
 						var listName = data[0].equipmentList;
 						var equipmentNameList = this.equipmentNameList;
 						var co = {};
@@ -180,7 +180,7 @@
 					success: (res) => {
 						if (res.data.code) {
 							var alarmClock = res.data.data;
-							console.log("list");
+							// console.log("list");
 							var status = alarmClock.status;
 							this.time = alarmClock.hour;
 							if (status == '0') {
@@ -262,9 +262,9 @@
 				if (e) {
 					this[this.type] = e.value;
 					//选择的值
-					console.log('value => ' + e.value);
+					// console.log('value => ' + e.value);
 					//原始的Date对象
-					console.log('date => ' + e.date);
+					// console.log('date => ' + e.date);
 				}
 			},
 			bindPickerChange: function(e) {
@@ -363,10 +363,10 @@
 
 				}
 				this.week = we;
-				console.log('we => ' + this.week);
+				// console.log('we => ' + this.week);
 			},
 			addEids(equipmentIds) {
-				console.log('equipmentIds' + equipmentIds);
+				// console.log('equipmentIds' + equipmentIds);
 				var eids = equipmentIds.split(",");
 				var idss = this.equipmentIds;
 				var is = this.equipmentNameList
@@ -378,7 +378,7 @@
 				}
 			},
 			search() {
-				console.log("search");
+				// console.log("search");
 				var clientId = this.searchClientId;
 				var list = uni.getStorageSync("listName");
 				var n = 0;
@@ -421,7 +421,7 @@
 				} else {
 					this.equipmentIds = val
 				}
-				console.log('this.equipmentIds => ' + this.equipmentIds);
+				// console.log('this.equipmentIds => ' + this.equipmentIds);
 			},
 			switchChange: function(e) {
 				this.status = e.target.value;
@@ -444,7 +444,7 @@
 				}
 				param['equipmentIds'] = eids;
 				param['adminId'] = this.globalUser.id;
-				console.log("param =>" + param);
+				// console.log("param =>" + param);
 				this.addAlarmClock(param)
 					.then(res => {
 						if (res.code) {

+ 1 - 1
packageA/pages/remote/alarmClockList.vue

@@ -77,7 +77,7 @@
 						if (res.data.code) {
 							var alarmClockList = [];
 							var alarmClocks = res.data.data;
-							console.log("list");
+							// console.log("list");
 
 							for (var i = 0; i < alarmClocks.length; i++) {
 								var alarmClock = alarmClocks[i];

+ 8 - 0
packageA/pages/remote/remoteList.vue

@@ -12,6 +12,9 @@
 					<view v-show="show">
 						<uni-list-item title="闹钟" @click="alarmClock()" />
 					</view>
+					<view v-show="show">
+						<uni-list-item title="机器音量调节" @click="volume()" />
+					</view>
 				</uni-list>
 			</uni-collapse>
 		</view>
@@ -58,6 +61,11 @@
 					url: 'alarmClockList',
 				});
 			},
+			volume() {
+				uni.navigateTo({
+					url: 'volume',
+				});
+			},
 		}
 	}
 	

+ 258 - 0
packageA/pages/remote/volume.vue

@@ -0,0 +1,258 @@
+<template>
+	<view>
+		<view class="search">
+			<view class="search-title">
+				输入机器编码
+			</view>
+			<view class="search-input">
+				<input type="text" placeholder='输入设备编码后6位' v-model="searchClientId" />
+			</view>
+			<view class="search-button">
+				<button type="primary" class="" @click="search()">
+					<p class="">搜索</P>
+				</button>
+			</view>
+		</view>
+		<view class="td-right">
+			<view class="uni-list">
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						点击选择机器
+					</view>
+					<view class="uni-list-cell-db" style="overflow: hidden;text-overflow: ellipsis;">
+						<picker @change="changeEquipment" :value="index" :range="equipmentNameList">
+							<view class="uni-input">{{equipmentNameList[index]}}</view>
+						</picker>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="uni-title">当前音量</view>
+		<view>
+			<slider :value="volume" @change="sliderChange" min="0" max="15" show-value />
+		</view>
+		<view class="tr">
+			<button type="primary" formType="submit" @click="update()" class="button">
+				<p class="p1">提交</p>
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				index: null,
+				equipmentName: null,
+				equimentType: null,
+				equipmentId: null,
+				equipmentNameList: [],
+				globalUser: null,
+				show: true,
+				volume:0,
+				searchClientId: null
+			}
+		},
+		onShow() {
+			var token = uni.getStorageSync("token");
+			this.globalUser = uni.getStorageSync("globalUser");
+			if (token.length > 1) {
+				this.getEquipmentListData();
+				// this.getParam();
+			} else {
+				uni.reLaunch({
+					url: '../Login/Login',
+				});
+			}
+
+		},
+		methods: {
+			...mapActions('chart', ['getParameters', 'updateParameters', 'getEquipmentListByUser','updata']),
+			getEquipmentListData() {
+				this.getEquipmentListByUser(this.globalUser)
+					.then(data => {
+						// this.merchantList = data;
+						var listName = data[0].equipmentList;
+						var equipmentNameList = [];
+						for (var i = 0; i < listName.length; i++) {
+							equipmentNameList.push("名称:" + listName[i].name + " 编号:" + listName[i].clientId.substring(
+								listName[i].clientId.length - 6, listName[i].clientId.length));
+						}
+						this.equipmentNameList = equipmentNameList;
+						var listId = data[0].id;
+						if (listId != null && listId != '1') {
+							uni.setStorageSync("listName", listName);
+						}
+						uni.stopPullDownRefresh();
+					}, _ => void uni.stopPullDownRefresh());
+			},
+			search() {
+				var clientId = this.searchClientId;
+				var list = uni.getStorageSync("listName");
+				var n = 0;
+				for (var i = 0; i < list.length; i++) {
+					var code = list[i].clientId.substring(list[i].clientId.length - 6, list[i].clientId.length);
+					if (code == clientId) {
+						n++;
+						this.index = i;
+						var id = list[i].id;
+						this.equipmentId = id;
+						this.clientId = list[i].clientId;
+						this.volume = list[i].volume;
+						break;
+					}
+				}
+				if (n == 0) {
+					uni.showModal({
+						title: "提示",
+						content: "找不到该机器",
+						success: (res) => {
+
+						}
+					})
+				}
+			},
+			sliderChange(e) {
+				this.volume = e.detail.value;
+				// console.log('音量发生变化:' + this.volume)
+			},
+			//改变机器
+			changeEquipment: function(e) {
+				this.searchClientId = null;
+				this.index = e.target.value;
+				var list = uni.getStorageSync("listName");
+				this.equipmentId = list[e.target.value].id;
+				this.clientId = list[e.target.value].clientId;
+				this.volume = list[e.target.value].volume;
+			},
+			update() {
+				uni.showModal({
+					title: "提示",
+					content: "是否修改音量?",
+					success: (res) => {
+						if (res.confirm) {
+							const param = {};
+							param['id'] = this.equipmentId;
+							param['volume'] = this.volume;
+							if (param != null) {
+								this.updata(param)
+									.then(res => {
+										uni.showModal({
+											title: '提示',
+											content: res.message,
+										});
+									}, _ => void uni.stopPullDownRefresh());
+							}
+						} else if (res.cancel) {
+							
+						}
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style>
+	.search {
+		width: 100%;
+		padding-top: 30upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+	}
+
+	.search-title {
+		width: 28%;
+		text-align: center;
+		font-size: 26upx;
+		font-family: "PingFang-SC-Bold";
+	}
+
+	.search-input {
+		width: 45%;
+		text-align: center;
+		font-size: 26upx;
+		font-family: "PingFang-SC-Bold";
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.search-button {
+		width: 20%;
+		padding-left: 7upx;
+		text-align: center;
+	}
+
+	.line {
+		height: 50upx;
+	}
+
+	.line2 {
+		height: 10upx;
+	}
+
+	.body {
+		background-color: #FFFFFF;
+		width: 700upx;
+		padding: 10upx 10upx 10upx 10upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		font-size: 32upx;
+	}
+	.tr {
+		padding-top: 15upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		font-size: 48upx;
+		font-family: "PingFang-SC-Bold";
+		position: fixed;
+		bottom: 100upx;
+		width: 100%;
+	}
+	.p1 {
+		font-size: 48upx;
+	}
+	.p {
+		width: 350upx;
+		text-align: right;
+	}
+
+	.input {
+		width: 200upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+		text-align: center;
+	}
+	.button {
+		margin: auto;
+		width: 60%;
+		height: 100upx;
+	}
+
+	.p2 {
+		font-size: 30upx;
+		/* #ifndef H5 */
+		padding-top: 3upx;
+		/* #endif */
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+	.uni-title{
+		padding-left: 20upx;
+		font-size: 26upx;
+		font-family: "PingFang-SC-Bold";
+	}
+		
+</style>

+ 95 - 87
pages.json

@@ -151,102 +151,110 @@
 		]
 	},
 	"subPackages": [{
-			"root": "packageA",
-			"name": "pack1",
-			"pages": [{
-					"path": "pages/equipmentStatus/map",
-					"style": {
-						"navigationBarTitleText": "MAP",
-						"enablePullDownRefresh": false
-					}
-				},
-				{
-					"path": "pages/equipmentStatus/GoogleMap",
-					"style": {
-						"navigationBarTitleText": "GoogleMap",
-						"enablePullDownRefresh": false
-					}
-				}, {
-					"path": "pages/remote/dosugar",
-					"style": {
-						"navigationBarTitleText": "远程做糖",
-						"enablePullDownRefresh": false
-					}
+		"root": "packageA",
+		"name": "pack1",
+		"pages": [{
+				"path": "pages/equipmentStatus/map",
+				"style": {
+					"navigationBarTitleText": "MAP",
+					"enablePullDownRefresh": false
+				}
+			},
+			{
+				"path": "pages/equipmentStatus/GoogleMap",
+				"style": {
+					"navigationBarTitleText": "GoogleMap",
+					"enablePullDownRefresh": false
+				}
+			}, {
+				"path": "pages/remote/dosugar",
+				"style": {
+					"navigationBarTitleText": "远程做糖",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "pages/remote/sugarList",
-					"style": {
-						"navigationBarTitleText": "今日做糖列表",
-						"enablePullDownRefresh": false
-					}
+			}, {
+				"path": "pages/remote/sugarList",
+				"style": {
+					"navigationBarTitleText": "今日做糖列表",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "pages/remote/remoteList",
-					"style": {
-						"navigationBarTitleText": "远程操作列表",
-						"enablePullDownRefresh": false
-					}
+			}, {
+				"path": "pages/remote/remoteList",
+				"style": {
+					"navigationBarTitleText": "远程操作列表",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "pages/remote/parameters",
-					"style": {
-						"navigationBarTitleText": "参数列表",
-						"enablePullDownRefresh": false
-					}
+			}, {
+				"path": "pages/remote/parameters",
+				"style": {
+					"navigationBarTitleText": "参数列表",
+					"enablePullDownRefresh": false
+				}
 
-				},
-				{
-					"path": "pages/remote/advancedParameters",
-					"style": {
-						"navigationBarTitleText": "进阶参数",
-						"enablePullDownRefresh": false
-					}
+			},
+			{
+				"path": "pages/remote/advancedParameters",
+				"style": {
+					"navigationBarTitleText": "进阶参数",
+					"enablePullDownRefresh": false
+				}
 
-				},
-				{
-					"path": "pages/remote/generalParameters",
-					"style": {
-						"navigationBarTitleText": "通用参数",
-						"enablePullDownRefresh": false
-					}
+			},
+			{
+				"path": "pages/remote/generalParameters",
+				"style": {
+					"navigationBarTitleText": "通用参数",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "pages/remote/alarmClockList",
-					"style": {
-						"navigationBarTitleText": "闹钟",
-						"enablePullDownRefresh": false
-					}
+			}, {
+				"path": "pages/remote/alarmClockList",
+				"style": {
+					"navigationBarTitleText": "闹钟",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "pages/remote/alarmClockItem",
-					"style": {
-						"navigationBarTitleText": "设置闹钟",
-						"enablePullDownRefresh": false
-					}
+			}, {
+				"path": "pages/remote/alarmClockItem",
+				"style": {
+					"navigationBarTitleText": "设置闹钟",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "pages/user/equipmentName",
+				"style": {
+					"navigationBarTitleText": "修改设备名称"
+				}
+			},
+			{
+				"path": "pages/user/timeRule",
+				"style": {
+					"navigationBarTitleText": "定时开关机"
+				}
+			},
+			{
+				"path": "pages/user/timeSet",
+				"style": {
+					"navigationBarTitleText": "定时开关机"
+				}
+			},
+			{
+				"path": "pages/user/timeSelect",
+				"style": {}
+			}
 
-				}, {
-					"path": "pages/user/equipmentName",
-					"style": {
-						"navigationBarTitleText": "修改设备名称"
-					}
-				},
-				{
-					"path": "pages/user/timeRule",
-					"style": {
-						"navigationBarTitleText": "定时开关机"
-					}
-				},
-				{
-					"path": "pages/user/timeSet",
-					"style": {
-						"navigationBarTitleText": "定时开关机"
-					}
-				},
-				{
-					"path": "pages/user/timeSelect",
-					"style": {}
+			, {
+				"path": "pages/remote/volume",
+				"style": {
+					"navigationBarTitleText": "音量调节",
+					"enablePullDownRefresh": false
 				}
-			
+
+			}
 		]
 	}]
 }

+ 275 - 54
pages/Charts/mainStatistics.vue

@@ -5,7 +5,8 @@
 				<image class="userFlagimg" src="../../static/img/userFlag.png" mode=""></image>
 			</view>
 			<view class="pname">
-				<font class="wenzi" style="color: #BDD6F3;font-size:28upx"> {{$t('mainStatistics.name')}}: {{pnameData}}</font>
+				<font class="wenzi" style="color: #BDD6F3;font-size:28upx"> {{$t('mainStatistics.name')}}: {{pnameData}}
+				</font>
 			</view>
 			<view class="company">
 				<font style="color: #BDD6F3;font-size:28upx">{{$t('mainStatistics.company')}}</font>
@@ -14,7 +15,8 @@
 		<view class="ri">
 			<view class="riShell">
 				<view class="riImg">
-					<image style="width: 64upx;height: 64upx;padding-top: 20upx;" :src="$t('mainStatistics.dayImg')"></image>
+					<image style="width: 64upx;height: 64upx;padding-top: 20upx;" :src="$t('mainStatistics.dayImg')">
+					</image>
 				</view>
 				<view class="riTitle">
 					<view style="text-align:left;font-size:28upx;font-family:PingFang-SC-Medium">
@@ -39,7 +41,8 @@
 		<view class="fourTitle">
 			<view class="four">
 				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.weekImg')" mode=""></image>
+					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.weekImg')"
+						mode=""></image>
 				</view>
 				<view class="fourShell">
 					<view class="one">
@@ -55,7 +58,8 @@
 
 			<view class="four">
 				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.monthImg')" mode=""></image>
+					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.monthImg')"
+						mode=""></image>
 				</view>
 				<view class="fourShell">
 					<view class="one">
@@ -71,7 +75,8 @@
 
 			<view class="four">
 				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.yearImg')" mode=""></image>
+					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.yearImg')"
+						mode=""></image>
 				</view>
 				<view class="fourShell">
 					<view class="one">
@@ -87,7 +92,8 @@
 
 			<view class="four">
 				<view class="fourImg">
-					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.allImg')" mode=""></image>
+					<image style="width: 54upx;height: 54upx;padding-top: 20upx;" :src="$t('mainStatistics.allImg')"
+						mode=""></image>
 				</view>
 				<view class="fourShell">
 					<view class="one">
@@ -101,6 +107,21 @@
 				</view>
 			</view>
 		</view>
+		<!-- 商家选择 -->
+		<view v-if="id!=1&&type<4&&length>0" class="td-right">
+			<view class="uni-list">
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						当前商家:
+					</view>
+					<view class="uni-list-cell-db" style="overflow: hidden;text-overflow: ellipsis;">
+						<picker @change="changeAdmin" :value="index" :range="adminList">
+							<view class="uni-input">{{adminList[index]}}</view>
+						</picker>
+					</view>
+				</view>
+			</view>
+		</view>
 		<view class="qiun-columns">
 			<view class="qiun-bg-white qiun-title-bar qiun-common-mt">
 				<view class="qiun-title-dot-light">
@@ -113,8 +134,9 @@
 				</view>
 			</view>
 			<view class="qiun-charts" style="background-color: #FFFFFF;">
-				<canvas canvas-id="canvaColumn1" id="canvaColumn1" class="charts" disable-scroll=true @touchstart="touchLine1"
-				 @touchmove="moveLine1" @touchend="touchEndLine1" style="background-color: #FFFFFF;"></canvas>
+				<canvas canvas-id="canvaColumn1" id="canvaColumn1" class="charts" disable-scroll=true
+					@touchstart="touchLine1" @touchmove="moveLine1" @touchend="touchEndLine1"
+					style="background-color: #FFFFFF;"></canvas>
 			</view>
 		</view>
 		<view class="line"></view>
@@ -130,8 +152,9 @@
 				</view>
 			</view>
 			<view class="qiun-charts" style="background-color: #FFFFFF;">
-				<canvas canvas-id="canvaColumn2" id="canvaColumn2" class="charts" disable-scroll=true @touchstart="touchLine2"
-				 @touchmove="moveLine2" @touchend="touchEndLine2" style="background-color: #FFFFFF;"></canvas>
+				<canvas canvas-id="canvaColumn2" id="canvaColumn2" class="charts" disable-scroll=true
+					@touchstart="touchLine2" @touchmove="moveLine2" @touchend="touchEndLine2"
+					style="background-color: #FFFFFF;"></canvas>
 			</view>
 		</view>
 		<view class="line"></view>
@@ -147,8 +170,9 @@
 				</view>
 			</view>
 			<view class="qiun-charts" style="background-color: #FFFFFF;">
-				<canvas canvas-id="canvaColumn3" id="canvaColumn3" class="charts" disable-scroll=true @touchstart="touchLine3"
-				 @touchmove="moveLine3" @touchend="touchEndLine3" style="background-color: #FFFFFF;"></canvas>
+				<canvas canvas-id="canvaColumn3" id="canvaColumn3" class="charts" disable-scroll=true
+					@touchstart="touchLine3" @touchmove="moveLine3" @touchend="touchEndLine3"
+					style="background-color: #FFFFFF;"></canvas>
 			</view>
 		</view>
 		<view class="line"></view>
@@ -164,8 +188,9 @@
 				</view>
 			</view>
 			<view class="qiun-charts" style="background-color: #FFFFFF;">
-				<canvas canvas-id="canvaColumn4" id="canvaColumn4" class="charts" disable-scroll=true @touchstart="touchLine4"
-				 @touchmove="moveLine4" @touchend="touchEndLine4" style="background-color: #FFFFFF;"></canvas>
+				<canvas canvas-id="canvaColumn4" id="canvaColumn4" class="charts" disable-scroll=true
+					@touchstart="touchLine4" @touchmove="moveLine4" @touchend="touchEndLine4"
+					style="background-color: #FFFFFF;"></canvas>
 			</view>
 		</view>
 	</view>
@@ -217,7 +242,13 @@
 				startDate4: '',
 				endDate4: '',
 				today: '',
-				week: ''
+				week: '',
+				adminList: [],
+				admins: [],
+				index: 0,
+				id: 0,
+				length:0,
+				type: null,
 			}
 		},
 		computed: {
@@ -236,6 +267,8 @@
 				index: 0,
 				text: this.$t('tabs.tab1')
 			});
+			this.id = 0;
+			this.index = 0;
 			var token = uni.getStorageSync("token");
 			if (token.toString().length > 1) {
 				this.init();
@@ -249,11 +282,16 @@
 			var globalUser = uni.getStorageSync("globalUser");
 			if (globalUser.toString().length > 1) {
 				//判断是不是初次登陆
-				if (test == 2) {
-					this.init();
+				// if (test == 2) {
+				// 	this.init();
+				// }
+				if (globalUser.type > 0&&globalUser.type<4) {
+					this.getAdmin();
 				}
+				this.id = globalUser.id;
+				this.type = globalUser.type;
 			}
-			var id = this.adminId;
+			// var id = this.adminId;
 
 			this.day();
 			// this.equipmentStatus();
@@ -271,7 +309,7 @@
 			this.equipmentStatus();
 		},
 		methods: {
-			...mapActions('chart', ['getStatistics', 'getMainStatistics', 'getMachineNum']),
+			...mapActions('chart', ['getStatistics', 'getMachineNum']),
 			async init() {
 				if (!this.pname) {
 					this.pname = this.loginUser.name;
@@ -301,6 +339,92 @@
 				this.week = this.$t('mainStatistics.week' + date.getDay());
 
 			},
+			//查询下级用户
+			getAdmin() {
+				var param = {};
+				var token = uni.getStorageSync("token");
+				var globalUser = uni.getStorageSync("globalUser");
+				param['id'] = globalUser.id;
+				uni.request({
+					url: this.serverurl + '/TAdmin/selectLowAdmin',
+					data: param,
+					header: {
+						'token': token
+					},
+					method: "POST",
+					success: (res) => {
+						if (res.data.code) {
+							var admins = res.data.data;
+							this.admins = admins;
+							var adminList = [];
+							adminList.push('本商户');
+							if (admins.length > 0) {
+								this.length = admins.length;
+								adminList.push('所有下级');
+								for (var i = 1; i < admins.length; i++) {
+									// console.log(admins[i].name)
+									if (admins[i].name != null || admins[i].name != '') {
+										adminList.push(admins[i].name);
+									} else {
+										adminList.push(admins[i].username);
+									}
+								}
+							}
+							this.adminList = adminList;
+						} else {
+							uni.showToast({
+								title: `获取信息失败:` + res.data.message,
+								icon: 'none'
+							})
+						}
+					},
+				});
+				// this.selectLowAdmin(param)
+				// 	.then(res => {
+				// 		if (res.code) {
+				// 			var admins = res.data;
+				// 			this.admins = admins;
+				// 			var adminList = [];
+				// 			adminList.push('本商户');
+				// 			if (admins.length > 0) {
+				// 				this.length = admins.length;
+				// 				adminList.push('所有下级');
+				// 				for (var i = 1; i < admins.length; i++) {
+				// 					// console.log(admins[i].name)
+				// 					if (admins[i].name != null || admins[i].name != '') {
+				// 						adminList.push(admins[i].name);
+				// 					} else {
+				// 						adminList.push(admins[i].username);
+				// 					}
+				// 				}
+				// 			}
+				// 			this.adminList = adminList;
+				// 		} else {
+				// 			uni.showToast({
+				// 				title: `获取信息失败:` + res.message,
+				// 				icon: 'none'
+				// 			})
+				// 		}
+				// 	});
+			},
+			// 改变商家
+			changeAdmin: function(e){
+				this.index = e.target.value;
+				var id = '';
+				if(e.target.value>1){
+					id = this.admins[e.target.value-1].id;
+				}
+				if(e.target.value==1){
+					id = 'all';
+				}
+				if(e.target.value==0){
+					id = 0;
+				}
+				// console.log("adminID="+id);
+				this.id = id;
+				this.init();
+				 
+			},
 			equipmentStatus() {
 				var that = this;
 				var id = uni.getStorageSync("globalUser").id;
@@ -321,7 +445,7 @@
 					},
 				});
 			},
-			checkEquipmentStatus(id){
+			checkEquipmentStatus(id) {
 				var token = uni.getStorageSync("token");
 				uni.request({
 					url: this.serverurl + '/TEquipment/checkEquipmentStatus',
@@ -333,7 +457,7 @@
 					},
 					method: "POST",
 					success: (res) => {
-						
+
 					},
 				});
 			},
@@ -435,6 +559,24 @@
 				if (this.equipmentId) {
 					param['equipmentId'] = this.equipmentId;
 				}
+				if (this.id!=1) {
+					var id = this.id;
+				}else{
+					var id = 0;
+				}
+				if(id=='all'){
+					param['adminId'] = null;
+					if(this.type==1){
+						param['agencyId'] = globalUser.id;
+					}
+					if(this.type==2){
+						param['merchantId'] = globalUser.id;
+					}
+				}else if(id==0){
+					
+				}else{
+					param['adminId'] = id;
+				}
 				return this.getStatistics(param)
 					.then(data => {
 						uni.stopPullDownRefresh();
@@ -492,36 +634,39 @@
 					});
 			},
 			initChart(canvasId, chartData) {
-				if (this.$t('lang') != 'zh') {
-					chartData.categories = chartData.categories.map(e => {
-						if (e.indexOf('点') >= 0) {
-							return e.replace('点', this.$t('mainStatistics.oclock'));
-						}
-						if (e.indexOf('周') >= 0) {
-							const weekNum = e.substring(e.length - 1) == '日' ? '0' : e.substring(e.length - 1);
-							return this.$t('mainStatistics.week' + weekNum);
-						}
-						if (e.indexOf('月') >= 0) {
-							var res = e.toString();
-							if (res.length > 3) {
-								return e.replace('月', this.$t('mainStatistics.mon'));
-							} else {
-								return e.replace('月', this.$t('mainStatistics.y'));
+				if (this.$t('lang') != null && this.$t('lang') != '') {
+					if (this.$t('lang') != 'zh') {
+						chartData.categories = chartData.categories.map(e => {
+							if (e.indexOf('点') >= 0) {
+								return e.replace('点', this.$t('mainStatistics.oclock'));
 							}
-						}
-						return e;
-					});
+							if (e.indexOf('周') >= 0) {
+								const weekNum = e.substring(e.length - 1) == '日' ? '0' : e.substring(e.length - 1);
+								return this.$t('mainStatistics.week' + weekNum);
+							}
+							if (e.indexOf('月') >= 0) {
+								var res = e.toString();
+								if (res.length > 3) {
+									return e.replace('月', this.$t('mainStatistics.mon'));
+								} else {
+									return e.replace('月', this.$t('mainStatistics.y'));
+								}
+							}
+							return e;
+						});
 
-					chartData.series = chartData.series.map(e => {
-						if (e['name'] == '销售个数') {
-							e['name'] = this.$t('mainStatistics.saleNum');
-						}
-						if (e['name'] == '销售额') {
-							e['name'] = this.$t('mainStatistics.saleroom');
-						}
-						return e;
-					});
+						chartData.series = chartData.series.map(e => {
+							if (e['name'] == '销售个数') {
+								e['name'] = this.$t('mainStatistics.saleNum');
+							}
+							if (e['name'] == '销售额') {
+								e['name'] = this.$t('mainStatistics.saleroom');
+							}
+							return e;
+						});
+					}
 				}
+
 				return new uCharts({
 					$this: _self,
 					canvasId: canvasId,
@@ -579,6 +724,26 @@
 				if (this.equipmentId) {
 					param['equipmentId'] = this.equipmentId;
 				}
+				if (this.id!=1) {
+					var id = this.id;
+				}else{
+					var id = 0;
+				}
+				var aid = param.adminId;
+				if(id=='all'){
+					param['adminId'] = null;
+					if(this.type==1){
+						param['agencyId'] = globalUser.id;
+					}
+					if(this.type==2){
+						param['merchantId'] = globalUser.id;
+					}
+				}else if(id==0){
+					
+				}else{
+					param['adminId'] = id;
+					aid = id;
+				}
 				// console.log('getMainStatisticsData:{}', param);
 				var adminId = param.adminId;
 				var equipmentId = this.equipmentId;
@@ -587,7 +752,7 @@
 				uni.request({
 					url: serverurl + '/TEquipment/getMachineNum',
 					data: {
-						"adminId": adminId,
+						"adminId": aid,
 						"equipmentId": equipmentId
 					},
 					method: "POST",
@@ -600,9 +765,16 @@
 						this.machineUseNum = list[1];
 					}
 				});
-				return this.getMainStatistics(param)
-					.then(data => {
-						for (let bean of data) {
+				uni.request({
+					url: serverurl + '/TOrder/getMainStatistics',
+					data: param,
+					method: "POST",
+					header: {
+						'token': token
+					},
+					success: (res) => {
+						var list = res.data.data;
+						for (let bean of list) {
 							if (bean['categorie'] === 'day') {
 								this.dayTotalMoney = bean['salePrice'];
 								this.dayTotalNum = bean['saleNum'];
@@ -620,8 +792,31 @@
 								this.yearTotalNum = bean['saleNum'];
 							}
 						}
-						uni.stopPullDownRefresh();
-					}, _ => void uni.stopPullDownRefresh());
+					}
+				});
+				// return this.getMainStatistics(param)
+				// 	.then(data => {
+				// 		for (let bean of data) {
+				// 			if (bean['categorie'] === 'day') {
+				// 				this.dayTotalMoney = bean['salePrice'];
+				// 				this.dayTotalNum = bean['saleNum'];
+				// 			}
+				// 			if (bean['categorie'] === 'week') {
+				// 				this.weekTotalMoney = bean['salePrice'];
+				// 				this.weekTotalNum = bean['saleNum'];
+				// 			}
+				// 			if (bean['categorie'] === 'month') {
+				// 				this.monthTotalMoney = bean['salePrice'];
+				// 				this.monthTotalNum = bean['saleNum'];
+				// 			}
+				// 			if (bean['categorie'] === 'year') {
+				// 				this.yearTotalMoney = bean['salePrice'];
+				// 				this.yearTotalNum = bean['saleNum'];
+				// 			}
+				// 		}
+				// 		uni.stopPullDownRefresh();
+				// 	}, _ => void uni.stopPullDownRefresh());
+					
 			},
 
 			touchLine1(e) {
@@ -916,4 +1111,30 @@
 	.fontLeft {
 		margin-right: 6upx;
 	}
+
+	.tr {
+		padding-top: 15upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		font-size: 26upx;
+		font-family: "PingFang-SC-Bold";
+	}
+
+	.td-left {
+		font-family: "PingFang-SC-Bold";
+		margin: auto;
+		font-size: 26upx;
+		width: 30%;
+		text-align: right;
+	}
+
+	.td-right {
+		font-family: "PingFang-SC-Bold";
+		/* font-weight: bold; */
+		margin: auto;
+		/* font-size: 26upx; */
+		width: 70%;
+		text-align: left;
+	}
 </style>

+ 31 - 2
pages/Login/loginWeixin.vue

@@ -42,7 +42,8 @@
 				keyEventBind: {
 					backbutton: false, //Boolean(默认truee)关闭back按键监听  
 					menubutton: false //Boolean(默认true)关闭menu按键监听  
-				}
+				},
+				isShowLoading: false
 			};
 		},
 		onShow() {
@@ -57,8 +58,29 @@
 		},
 		methods: {
 			loginwxSubmit(event) {
-				uni.hideKeyboard();
+				console.log("yy");
+				if (!this.isShowLoading) {
+					uni.showLoading({
+						title: '加载中',
+						icon: 'loading',
+					})
+					this.isShowLoading = true;
+				}
+				if (this.isShowLoading) {
+					uni.hideLoading()
+					this.isShowLoading = false;
+				}
+				// if (this.isShowLoading) {
+				// 	uni.hideLoading()
+				// }
+				// uni.showToast({
+				// 	title: '没有更多数据了',
+				// 	icon: 'none',
+				// });
+
+				// uni.hideKeyboard();
 				// const { value: loginForm } = event.detail;
+				// debugger
 				var username = event.detail.value.username;
 				var pass = event.detail.value.password;
 				var password = MD5(pass);
@@ -71,6 +93,13 @@
 				// debugger;
 				this.$store.dispatch('loginWXCZ', this.parm)
 					.then(data => {
+						if (this.isShowLoading) {
+							uni.hideLoading()
+						}
+						uni.showToast({
+							title: '绑定成功',
+							icon: 'none',
+						});
 						var result = data.message;
 						var weixinInfo = data.data;
 						var code = data.code;

+ 1 - 0
pages/User/equipmentStatusList.vue

@@ -153,6 +153,7 @@
 						<view><span>{{$t('equipmentStatusList.area')}}:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
 						<view><span>{{$t('equipmentStatusList.temperature')}}:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
 						<view><span>{{$t('equipmentStatusList.humidity')}}:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
+						<view><span>音量:</span><span>{{equipment.volume?equipment.volume:''}}</span></view>
 						<view><span>{{$t('equipmentStatusList.equipmentTemperature')}}:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
 						<view class="" v-if="equipment.hasTodayAlarm">
 							<view><span>{{$t('equipmentStatusList.alarm')}}:</span></view>

+ 1 - 0
store/index.js

@@ -34,6 +34,7 @@ const store = new Vuex.Store({
 			commit('setLoading', true);
 			// console.log(`login actions: `, arguments);
 			const encryptPwd = MD5(password);
+			// const encryptPwd = password;
 			const data = { username, password: encryptPwd };
 			return apis.sz.post('/TAdmin/userLogin', data)
 				.then(res => {

+ 9 - 0
store/modules/chart.js

@@ -115,6 +115,15 @@ export default {
 					return res;
 				});
 		},
+		//查询下级用户
+		selectLowAdmin({ commit },param) {
+			return apis.sz.post('/TAdmin/selectLowAdmin',param)
+			.then(res => {
+					// const { data } = res;
+					return res;
+				});
+				
+		},
 	}
 }