2 Commits 3f583881c0 ... 0fe7e26f36

Author SHA1 Message Date
  litianbiao 0fe7e26f36 Merge branch 'master' of http://112.74.63.148:3000/wuhongshuang/shenzeeUniApp 2 years ago
  litianbiao bc2fcbe8ea 更新 2 years ago
5 changed files with 100 additions and 7 deletions
  1. 8 0
      common/lang/en.js
  2. 8 0
      common/lang/zh.js
  3. 2 2
      configs/env.js
  4. 2 2
      main.js
  5. 80 3
      pages/User/equipmentStatusList.vue

+ 8 - 0
common/lang/en.js

@@ -61,7 +61,12 @@ export default {
 		reset:'reboot',
 		reboot:'reboot equipment',
 		door:'open door',
+		outDoor:'outer door',
+		inDoor:'inner door',
 		open:'open',
+		close:'close',
+		openStatus:'Door opening',
+		closeStatus:'Door closing',
 		opensuccess:'open success',
 		title:'equipment status',
 		red:'Red means machine alarm',
@@ -77,7 +82,10 @@ export default {
 		humidity:'equipmentHumidity',
 		alarm:'alarm content',
 		tip:'prompt',
+		successReturn:'Sending succeeded',
+		errorReturn:'fail in send',
 		rebootTip:'whether or not to reboot?',
+		updateTip:'Execute or not?',
 		sleepTip:'whether or not to sleep?',
 		onoffTip:'whether to turn it off?',
 		wuliaoTip:'Are you sure?',

+ 8 - 0
common/lang/zh.js

@@ -59,7 +59,12 @@ export default {
 		reset:'重启',
 		reboot:'一键重启炉头',
 		door:'远程开门',
+		outDoor:'外门',
+		inDoor:'内门',
+		openStatus:'开门状态',
+		closeStatus:'关闭状态',
 		open:'开门',
+		close:'关门',
 		opensuccess:'开门成功',
 		title:'机器状态',
 		red:'红色代表机器报警',
@@ -75,6 +80,9 @@ export default {
 		humidity:'柜内湿度',
 		alarm:'报警内容',
 		tip:'提示',
+		successReturn:'发送成功',
+		errorReturn:'发送失败',
+		updateTip:'是否执行操作?',
 		rebootTip:'是否重启?',
 		sleepTip:'是否休眠?',
 		onoffTip:'是否关机?',

+ 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',
 	});
 }
 

+ 2 - 2
main.js

@@ -56,8 +56,8 @@ const i18n = new VueI18n({
 });
 
 App.mpType = 'app'
-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({

+ 80 - 3
pages/User/equipmentStatusList.vue

@@ -160,8 +160,35 @@
 								</view>
 							</view>
 						</view>
-
 						<view class="line1"></view>
+						<!-- 远程开门 -->
+						<!-- 类型,0:外门,1:内门,状态:0:关闭,1:开启 -->
+						<!-- 外门 -->
+						<view class="" v-if="equipment.equimentType=='MG320'||equipment.equimentType=='MG330'">
+						<view class="opendoor"><span>{{$t('equipmentStatusList.outDoor')}}:{{equipment.outDoor==1?$t('equipmentStatusList.openStatus'):$t('equipmentStatusList.closeStatus')}}</span>
+							<view class="switch1">
+								<button type="primary" @click="updateEquipment(equipment.id,0,0)" class="button">
+									<p class="p">{{$t('equipmentStatusList.open')}}</p>
+								</button>
+								<button type="primary" @click="updateEquipment(equipment.id,0,1)" class="button">
+									<p class="p">{{$t('equipmentStatusList.close')}}</p>
+								</button>
+							</view>
+						</view>
+						<view class="line1"></view>
+						<!-- 内门 -->
+						<view class="opendoor"><span>{{$t('equipmentStatusList.inDoor')}}:{{equipment.inDoor==1?$t('equipmentStatusList.openStatus'):$t('equipmentStatusList.closeStatus')}}</span>
+							<view class="switch1">
+								<button type="primary" @click="updateEquipment(equipment.id,1,0)" class="button">
+									<p class="p">{{$t('equipmentStatusList.open')}}</p>
+								</button>
+								<button type="primary" @click="updateEquipment(equipment.id,1,1)" class="button">
+									<p class="p">{{$t('equipmentStatusList.close')}}</p>
+								</button>
+							</view>
+						</view>
+						<view class="line1"></view>
+						</view>
 						<!-- 一键重启 -->
 						<!-- <view class="opendoor"><span>{{$t('equipmentStatusList.reboot')}}:</span>
 							<view class="">
@@ -172,13 +199,13 @@
 						</view>
 						<view class="line1"></view> -->
 						<!-- 远程开门 -->
-						<view class="opendoor"><span>{{$t('equipmentStatusList.door')}}:</span>
+<!-- 						<view class="opendoor"><span>{{$t('equipmentStatusList.door')}}:</span>
 							<view class="">
 								<button type="primary" @click="openDoor(equipment.id)" class="button">
 									<p class="p">{{$t('equipmentStatusList.open')}}</p>
 								</button>
 							</view>
-						</view>
+						</view> -->
 						<!-- 查看定位 -->
 						<view class="opendoor"><span>{{$t('equipmentStatusList.gps')}}:</span>
 							<view class="">
@@ -631,6 +658,56 @@
 					}
 				});
 			},
+			// type(类型,0:外门,1:内门), 
+			 // status(状态:0:关闭,1:开启)
+			updateEquipment(id,type,status){
+				var that = this;
+				uni.showModal({
+					title: that.$t('equipmentStatusList.tip'),
+					content: that.$t('equipmentStatusList.updateTip'),
+					success: function(res) {
+						if (res.confirm) {
+							var serverurl = that.serverurl;
+							var token = uni.getStorageSync("token");
+							uni.request({
+								url: serverurl + '/TEquipment/updateEquipment?id='+id+'&type='+type+'&status='+status,
+								method: "GET",
+								header: {
+									'token': token
+								},
+								success: (res) => {
+									var code = res.data.code;
+									if (code) {
+										uni.showModal({
+											title: that.$t(
+												'equipmentStatusList.tip'),
+											content: that.$t(
+												'equipmentStatusList.successReturn'),
+											success: function(res) {
+												// setTimeout(function() {
+												// }, 7000);
+											}
+										})
+									} else {
+										uni.showModal({
+											title: that.$t(
+												'equipmentStatusList.tip'),
+											content: that.$t(
+												'equipmentStatusList.errorReturn'),
+											success: function(res) {
+											}
+										})
+									}
+				
+								}
+							});
+						} else if (res.cancel) {
+							that.onffChecked = false;
+							that.getEquipmentListData();
+						}
+					}
+				});
+			},
 			buliao(id) {
 				var that = this;
 				var token = uni.getStorageSync("token");