李天标 5 years ago
parent
commit
b16db6e387

+ 1 - 5
configs/env.js

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

+ 1 - 6
main.js

@@ -22,13 +22,8 @@ const i18n = new VueI18n({
 
 App.mpType = 'app'
 
-// Vue.prototype.serverurl="http://127.0.0.1:8090/cleanMachineServer";
-// Vue.prototype.serverurl="http://sunzee.myqnapcloud.com:8090/cleanMachineServer";
-// Vue.prototype.serverurl="http://192.168.0.184:8090/cleanMachineServer";
-// Vue.prototype.serverurl="https://app.sunzee.com.cn:8090/cleanMachineServer";
-// Vue.prototype.serverurl="http://app.sunzee.com.cn:8090/cleanMachineServer";
+// Vue.prototype.serverurl="http://127.0.0.1:8090";
 Vue.prototype.serverurl="https://app.sunzee.com.cn:9443/cleanMachineServer";
-// Vue.prototype.serverurl="https://clean.sunzee.com.cn/cleanMachineServer";
 Vue.prototype.$store = store;
 Vue.prototype._i18n = i18n;
 const app = new Vue({

+ 1 - 1
manifest.json

@@ -93,7 +93,7 @@
     "mp-weixin" : {
         "appid" : "wxfffa94218fe6667b",
         "setting" : {
-            "urlCheck" : true,
+            "urlCheck" : false,
             "es6" : true,
             "postcss" : true,
             "minified" : false

+ 9 - 0
materialAppletApp.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 30 - 24
pages.json

@@ -21,30 +21,6 @@
 				// "enablePullDownRefresh": true
 			}
 		},
-		// {
-		//     "path" : "pages/User/merchantList",
-		//     "style" : {
-		// 		"navigationBarTitleText":"机器销售",
-		// 		// "disableScroll": true,
-		// 		"enablePullDownRefresh": true
-		// 	}
-		// },
-		// {
-		//     "path" : "pages/User/equipmentSratisticsList",
-		//     "style" : {
-		// 		"navigationBarTitleText":"机器排行",
-		// 		// "disableScroll": true,
-		// 		"enablePullDownRefresh": true
-		// 	}
-		// },
-		// {
-		//     "path" : "pages/User/equipmentStatusList",
-		//     "style" : {
-		// 		"navigationBarTitleText":"机器状态",
-		// 		// "disableScroll": true,
-		// 		"enablePullDownRefresh": true
-		// 	}
-		// },
 		{
 		    "path" : "pages/Setting/Setting",
 		    "style" : {
@@ -78,6 +54,30 @@
 			}
 		},
 		{
+		    "path" : "pages/Setting/parameters",
+		    "style" : {
+				"navigationBarTitleText":"参数类型",
+				// "disableScroll": true,
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+		    "path" : "pages/Setting/generalParameters",
+		    "style" : {
+				"navigationBarTitleText":"通用参数",
+				// "disableScroll": true,
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+		    "path" : "pages/Setting/advancedParameters",
+		    "style" : {
+				"navigationBarTitleText":"进阶参数",
+				// "disableScroll": true,
+				"enablePullDownRefresh": true
+			}
+		},
+		{
 		    "path" : "pages/Setting/dayPay",
 		    "style" : {
 				"navigationBarTitleText":"按日支付",
@@ -140,6 +140,12 @@
 				// "disableScroll": true
 			}
         }
+        ,{
+            "path" : "pages/Setting/saoma",
+            "style" : {
+				"navigationBarTitleText": "扫码"
+			}
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "white",

+ 14 - 1
pages/Setting/Setting.vue

@@ -7,7 +7,8 @@
 						<uni-list-item title="使用统计" note="单台机器的使用次数统计" @click="useStatistics(equipment.id,equipment.name)" thumb="../../static/img/tongji.png"></uni-list-item>
 						<uni-list-item title="清洗规则" note="设定机器每天的清洗时间段(单台机器)" @click="rule(equipment.id,equipment.name,equipment.rule)" thumb="../../static/img/renwu.png"></uni-list-item>
 						<uni-list-item title="支付" note="按天数/次数支付(单台机器)" show-extra-icon="true" @click="pay(equipment.id,equipment.name)" thumb="../../static/img/pay.png"></uni-list-item>
-						<uni-list-item title="参数调整" thumb="../../static/img/canshu.png"></uni-list-item>
+						<uni-list-item title="参数调整" thumb="../../static/img/canshu.png"  @click="paramters(equipment.id,equipment.name)"></uni-list-item>
+						<uni-list-item title="扫码测试" thumb="../../static/img/canshu.png"  @click="test()"></uni-list-item>
 					</uni-list>
 				</uni-collapse-item>
 			</view>
@@ -120,6 +121,18 @@
 					url: 'pay',
 				});
 			},
+			paramters(equipmentId,equipmentName){
+				uni.setStorageSync('nowEquipmentId', equipmentId);
+				uni.setStorageSync('nowEquipmentName', equipmentName);
+				uni.navigateTo({
+					url: 'parameters',
+				});
+			},
+			test(){
+				uni.navigateTo({
+					url: 'saoma',
+				});
+			},
 		}
 	}
 </script>

+ 248 - 0
pages/Setting/advancedParameters.vue

@@ -0,0 +1,248 @@
+<template>
+	<view class="">
+		<view class="line">
+
+		</view>
+		<!-- <view class="body">
+			<p class="p">X轴回零速度:</p>
+			<input class="input" type="text" v-model="D420" />
+			<button type="primary" class="button" @click="update('D-420',D420)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">X轴爬行速度:</p>
+			<input class="input" type="text" v-model="D421" />
+			<button type="primary" class="button" @click="update('D-421',D421)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">Y轴回零速度:</p>
+			<input class="input" type="text" v-model="D422" />
+			<button type="primary" class="button" @click="update('D-422',D422)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">Y轴爬行速度:</p>
+			<input class="input" type="text" v-model="D423" />
+			<button type="primary" class="button" @click="update('D-423',D423)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">E轴回零速度:</p>
+			<input class="input" type="text" v-model="D424" />
+			<button type="primary" class="button" @click="update('D-424',D424)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">E轴爬行速度:</p>
+			<input class="input" type="text" v-model="D425" />
+			<button type="primary" class="button" @click="update('D-425',D425)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view> -->
+		<view class="body">
+			<p class="p">X轴加速度:</p>
+			<input class="input" type="text" v-model="D426" />
+			<button type="primary" class="button" @click="update('D426',D426)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">X轴减速度:</p>
+			<input class="input" type="text" v-model="D427" />
+			<button type="primary" class="button" @click="update('D427',D427)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">Y轴加速度:</p>
+			<input class="input" type="text" v-model="D428" />
+			<button type="primary" class="button" @click="update('D428',D428)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">Y轴减速度:</p>
+			<input class="input" type="text" v-model="D429" />
+			<button type="primary" class="button" @click="update('D429',D429)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">E轴加速度:</p>
+			<input class="input" type="text" v-model="D430" />
+			<button type="primary" class="button" @click="update('D430',D430)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">E轴加速度:</p>
+			<input class="input" type="text" v-model="D431" />
+			<button type="primary" class="button" @click="update('D431',D431)">
+				<p class="p2">更新</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+	</view>
+</template>
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				D420: 0,
+				D421: 0,
+				D422: 0,
+				D423: 0,
+				D424: 0,
+				D425: 0,
+				D426: 0,
+				D427: 0,
+				D428: 0,
+				D429: 0,
+				D430: 0,
+				D431: 0,
+			}
+		},
+		onShow() {
+			this.getParam();
+		},
+		methods: {
+			...mapActions('chart', ['getParameters', 'updateParameters']),
+			getParam() {
+				const param = {};
+				param['id'] = uni.getStorageSync("nowEquipmentId");
+				param['code'] = '1';
+				this.getParameters(param).then(data => {
+					var info = data;
+					if (info!=null||info!='') {
+						for (var i = 0; i < info.length; i++) {
+							if(info[i].name=='D-420'){
+								this.D420=info[i].val;
+							}
+							if(info[i].name=='D-421'){
+								this.D421=info[i].val;
+							}
+							if(info[i].name=='D-422'){
+								this.D422=info[i].val;
+							}
+							if(info[i].name=='D-423'){
+								this.D423=info[i].val;
+							}
+							if(info[i].name=='D-424'){
+								this.D424=info[i].val;
+							}
+							if(info[i].name=='D-425'){
+								this.D425=info[i].val;
+							}
+							if(info[i].name=='D-426'){
+								this.D426=info[i].val;
+							}
+							if(info[i].name=='D-427'){
+								this.D427=info[i].val;
+							}
+							if(info[i].name=='D-428'){
+								this.D428=info[i].val;
+							}
+							if(info[i].name=='D-429'){
+								this.D429=info[i].val;
+							}
+							if(info[i].name=='D-430'){
+								this.D430=info[i].val;
+							}
+							if(info[i].name=='D-431'){
+								this.D431=info[i].val;
+							}
+						}
+					}
+
+				}, _ => void uni.stopPullDownRefresh());
+			},
+			update(name, val) {
+				const param = {};
+				param['id'] = uni.getStorageSync("nowEquipmentId");
+				param['name'] = name;
+				param['val'] = val;
+				this.updateParameters(param).then(data => {
+					if (data == 'SUCCESS') {
+						uni.showToast({
+							title: '修改成功',
+							duration: 1000
+						});
+					}
+				}, _ => void uni.stopPullDownRefresh());
+			},
+		},
+	}
+</script>
+
+<style>
+	.line {
+		height: 50upx;
+	}
+
+	.line2 {
+		height: 10upx;
+	}
+
+	.body {
+		background-color: #FFFFFF;
+		width: 600upx;
+		padding: 10upx 10upx 10upx 10upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		font-size: 32upx;
+	}
+
+	.p {
+		width: 200upx;
+		text-align: right;
+	}
+
+	.input {
+		width: 200upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		width: 120upx;
+		height: 60upx;
+		text-align: left;
+		border-radius: 10upx;
+
+	}
+
+	.p2 {
+		font-size: 30upx;
+		/* #ifndef H5 */
+		padding-top: 3upx;
+		/* #endif */
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+</style>

+ 247 - 0
pages/Setting/generalParameters.vue

@@ -0,0 +1,247 @@
+<template>
+	<view class="">
+		<view class="line">
+
+		</view>
+		<view class="body">
+			<p class="p">自测试模式</p>
+			<!-- <input class="input" type="text" v-model="M17" /> -->
+			<!-- <button type="primary" class="button" @click="update('M-17',M17)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M17','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M17','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">A轴正转</p>
+			<!-- <input class="input" type="text" v-model="M311" /> -->
+			<button type="primary" class="button" @click="update('M311','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M311','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">A轴反转</p>
+			<!-- <input class="input" type="text" v-model="M312" />
+			<button type="primary" class="button" @click="update('M-312',M312)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M312','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M312','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">喷水泵启动</p>
+			<!-- <input class="input" type="text" v-model="M313" />
+			<button type="primary" class="button" @click="update('M-313',M313)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M313','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M313','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">气泵启动</p>
+			<!-- <input class="input" type="text" v-model="M315" />
+			<button type="primary" class="button" @click="update('M-315',M315)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M315','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M315','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">清洁消毒喷水泵</p>
+			<!-- <input class="input" type="text" v-model="M316" />
+			<button type="primary" class="button" @click="update('M-316',M316)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M316','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M316','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">清洗洁厕灵+水</p>
+			<!-- <input class="input" type="text" v-model="M317" />
+			<button type="primary" class="button" @click="update('M-317',M317)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M317','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M317','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+		<view class="line2"></view>
+		<view class="body">
+			<p class="p">消毒液+水</p>
+			<!-- <input class="input" type="text" v-model="M318" /> -->
+			<!-- <button type="primary" class="button" @click="update('M-318',M318)">
+				<p class="p2">更新</P>
+			</button> -->
+			<button type="primary" class="button" @click="update('M318','0')">
+				<p class="p2">启动</P>
+			</button>
+			<button type="primary" class="button" @click="update('M318','1')">
+				<p class="p2">关闭</P>
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapActions,
+		mapMutations
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				M17: 0,
+				M311: 0,
+				M312: 0,
+				M313: 0,
+				M315: 0,
+				M316: 0,
+				M317: 0,
+				M318: 0,
+			}
+		},
+		onShow() {
+			this.getParam();
+		},
+		methods: {
+			...mapActions('chart', ['getParameters', 'updateParameters']),
+			getParam() {
+				const param = {};
+				param['id'] = uni.getStorageSync("nowEquipmentId");
+				param['code'] = '0';
+				this.getParameters(param).then(data => {
+					var info = data;
+					if (info!=null||info!='') {
+						for (var i = 0; i < info.length; i++) {
+							if(info[i].name=='M-17'){
+								this.M17=info[i].val;
+							}
+							if(info[i].name=='M-311'){
+								this.M311=info[i].val;
+							}
+							if(info[i].name=='M-312'){
+								this.M312=info[i].val;
+							}
+							if(info[i].name=='M-313'){
+								this.M313=info[i].val;
+							}
+							if(info[i].name=='M-315'){
+								this.M315=info[i].val;
+							}
+							if(info[i].name=='M-316'){
+								this.M316=info[i].val;
+							}
+							if(info[i].name=='M-317'){
+								this.M317=info[i].val;
+							}
+							if(info[i].name=='M-318'){
+								this.M318=info[i].val;
+							}
+						}
+					}
+			
+				}, _ => void uni.stopPullDownRefresh());
+			},
+			update(name, val) {
+				const param = {};
+				param['id'] = uni.getStorageSync("nowEquipmentId");
+				param['name'] = name;
+				param['val'] = val;
+				this.updateParameters(param).then(data => {
+					if (data == 'SUCCESS') {
+						uni.showToast({
+							title: '修改成功',
+							duration: 1000
+						});
+					}
+				}, _ => void uni.stopPullDownRefresh());
+			},
+		},
+	}
+</script>
+
+<style>
+	.line {
+		height: 50upx;
+	}
+
+	.line2 {
+		height: 10upx;
+	}
+
+	.body {
+		padding-top: 10upx;
+		background-color: #FFFFFF;
+		width: 550upx;
+		padding: 10upx 10upx 10upx 10upx;
+		display: flex;
+		flex-direction: row;
+		justify-content: flex-start;
+		font-size: 32upx;
+	}
+
+	.p {
+		width: 250upx;
+		padding-top: 3upx;
+		text-align: right;
+	}
+
+	.input {
+		width: 200upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
+	}
+
+	.button {
+		width: 120upx;
+		height: 60upx;
+		text-align: left;
+		border-radius: 10upx;
+
+	}
+
+	.p2 {
+		font-size: 30upx;
+		/* #ifndef H5 */
+		padding-top: 3upx;
+		/* #endif */
+		position: absolute;
+		/* 水平居中 */
+		left: 50%;
+		-webkit-transform: translateX(-50%);
+		transform: translateX(-50%);
+	}
+</style>

+ 29 - 0
pages/Setting/parameters.vue

@@ -0,0 +1,29 @@
+<template>
+	<view class="">
+		<uni-list>
+			<uni-list-item title="通用参数"  @click="general()"></uni-list-item>
+			<uni-list-item title="进阶参数"  @click="advanced()"></uni-list-item>
+		</uni-list>
+	</view>
+</template>
+
+<script>
+	export default {
+		methods: {
+			general(){
+				uni.navigateTo({
+					url:'generalParameters',
+				});
+			},
+			advanced(){
+				uni.navigateTo({
+					url: 'advancedParameters',
+				});
+			},
+			
+		}
+	}
+</script>
+
+<style>
+</style>

+ 35 - 0
pages/Setting/saoma.vue

@@ -0,0 +1,35 @@
+
+<template>
+	<view>
+		<input class="input" type="text" v-model="date" />
+		<button type="primary" @click="tel()">扫描</button>
+	</view>
+</template>
+ 
+<script>
+	export default {
+		data() {
+			return {
+				date: 0,
+			};
+		},		
+		methods:{
+			tel(){
+				var that = this;
+				// 允许从相机和相册扫码
+				uni.scanCode({
+				    success(res) {
+				        console.log('条码类型:' + res.scanType);
+				        console.log('条码内容:' + res.result);
+						that.date = res.result;
+				    }
+				});
+			},
+			
+		}
+	}
+</script>
+ 
+<style>
+ 
+</style>

BIN
static/img/canshu.png


BIN
static/img/pay.png


BIN
static/img/renwu.png


BIN
static/img/tongji.png


+ 16 - 0
store/modules/chart.js

@@ -100,6 +100,22 @@ export default {
 					return data;
 				});
 		},
+		//获取参数
+		getParameters({ commit },param) {
+			return apis.sz.post('/TEquipment/getParameters',param)
+				.then(res => {
+					const { data } = res;
+					return data;
+				});
+		},
+		//修改参数
+		updateParameters({ commit },param) {
+			return apis.sz.post('/TEquipment/updateParameters',param)
+				.then(res => {
+					const { data } = res;
+					return data;
+				});
+		},
 	}
 }