heyang 1 rok pred
rodič
commit
1216fbf1fb

BIN
images/basicsModules/doors-icon.png


BIN
images/basicsModules/handle-icon.png


BIN
images/basicsModules/icon_aqxxp_dh.png


BIN
images/basicsModules/icon_hxpg_gly.png


BIN
images/basicsModules/icon_hxpg_hxp.png


BIN
images/basicsModules/icon_hxpgm.png


BIN
images/basicsModules/icon_kcxq_cg.png


BIN
images/basicsModules/icon_kcxq_sb.png


BIN
images/basicsModules/icon_kcxq_ts.png


+ 3 - 3
pages/information/information.vue

@@ -13,7 +13,7 @@
 					<view class="bottom">{{item.content}}</view>
 				</view>
 			</view>
-			<view class="get-null-box" v-if="getData.nullDataType">暂无更多数据</view>
+			<view class="get-null-box" v-if="!dataList[0]">暂无更多数据</view>
 		</scroll-view>
 		<tab-bar ref='infoAll'></tab-bar>
 	</view>
@@ -49,11 +49,11 @@
             //滚动事件
 			scrollGet(){
 				let self=this;
-				if(self.total/self.getData.pageSize<=self.getData.page){
+				if(self.total/self.queryParams.pageSize<=self.queryParams.page){
 					console.log('没有更多数据!')
 				}else{
 						setTimeout(function(){
-							self.getData.page += 1;
+							self.queryParams.page += 1;
 							self.getList();
 						},1000)
 	

+ 225 - 0
pages_manage/laboratory/accessRecord.vue

@@ -0,0 +1,225 @@
+<!-- 进出记录 -->
+<template>
+	<view class="accessRecord">
+		<view class="title">
+			<view v-for="(item,index) in statisticsData">
+				<view>{{item.num}}</view>
+				<view>{{item.name}}</view>
+			</view>
+		</view>
+		<view class="list" v-for="(item,index) in dataList">
+			<view class="list-t">{{item.time}}</view>
+			<view class="list-b" v-for="(item2,index2) in item.child">
+				<view class="list-b-t">
+					<img :src="item2.avatar">
+					<view>{{item2.name}}</view>
+					<view>{{item2.phone}}</view>
+					<view :class="item2.status==0?'color-A':(item2.status==1?'color-B':(item2.status==2?'color-C':''))">
+					{{item2.status==0?'实验中':(item2.status==1?'已离开':(item2.status==2?'未离开考勤违规':''))}}
+					</view>
+				</view>
+				<img class="list-b-img" src="@/images/basicsModules/for_min_bg.png">
+				<view class="list-b-b">
+					<view>签到时间:{{item2.time1}}</view>
+					<view>离开时间:{{item2.time2}}</view>
+					<view>停留时间:{{item2.time3}}</view>
+				</view>
+				
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {} from '@/api/basicsModules/index.js'
+	export default {
+		name: "accessRecord",
+		props: {
+			subjectData: {},
+		},
+		data() {
+			return {
+				statisticsData:[
+					{name:'当前实验人数',num:'1'},
+					{name:'今日累计人次',num:'23'},
+					{name:'当月累计人次',num:'302'},
+				],
+				newData:{
+					
+				},
+				dataList:[
+					{
+						time:'2023年12月',
+						child:[
+							{
+								avatar:require('@/images/basicsModules/icon_yw_yc.png'),
+								name:'姓名',
+								phone:'123456987',
+								status:0,	
+								time1:'2023-12-14  12:20',	
+								time2:'2023-12-14  14:56',	
+								time3:'2小时26分钟',	
+							}
+						],
+						
+					},
+					{
+						time:'2023年12月',
+						child:[
+							{
+								avatar:require('@/images/basicsModules/icon_yw_yc.png'),
+								name:'姓名',
+								phone:'123456987',
+								status:1,	
+								time1:'2023-12-14  12:20',	
+								time2:'2023-12-14  14:56',	
+								time3:'2小时26分钟',	
+							}
+						],
+						
+					},
+					{
+						time:'2023年12月',
+						child:[
+							{
+								avatar:require('@/images/basicsModules/icon_yw_yc.png'),
+								name:'姓名',
+								phone:'123456987',
+								status:2,	
+								time1:'2023-12-14  12:20',	
+								time2:'2023-12-14  14:56',	
+								time3:'2小时26分钟',	
+							}
+						],
+						
+					}
+				]
+			}
+		},
+		created() {
+
+		},
+		mounted() {
+			
+		},
+		methods: {
+			
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	.accessRecord {
+		width: 750rpx;
+		.title{
+			width: 750rpx;
+			height: 160rpx;
+			background: #fff;
+			display: flex;
+			justify-content: space-between;
+			padding: 0 20rpx;
+			box-sizing: border-box;
+			>view{
+				flex: 1;
+				>view:nth-of-type(1){
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 36rpx;
+					color: #0183FA;
+					line-height: 30rpx;
+					text-align: center;
+					margin: 30rpx 0 34rpx 0;
+				}
+				>view:nth-of-type(2){
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 30rpx;
+					color: #222222;
+					line-height: 30rpx;
+					text-align: center;
+					border-right: 1rpx solid #E0E0E0;
+				}
+			}
+			>view:last-child{
+				>view:nth-of-type(2){
+					border-right: none;
+				}
+			}
+		}
+		.list{
+			padding: 0 20rpx;
+			box-sizing: border-box;
+			.list-t{
+				height: 80rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				font-size: 32rpx;
+				color: #222222;
+				line-height: 80rpx;
+			}
+			.list-b{
+				.list-b-t{
+					background: #FFFFFF;
+					border-radius:20rpx 20rpx 0 0;
+					display: flex;
+					justify-content: flex-start;
+					align-items: center;
+					padding: 30rpx 26rpx 16rpx 30rpx;
+					box-sizing: border-box;
+					>img{
+						width: 70rpx;
+						height: 70rpx;
+						border-radius: 35rpx;
+					}
+					>view:nth-of-type(1){
+						font-family: PingFang SC;
+						font-weight: 500;
+						font-size: 28rpx;
+						color: #333333;
+						line-height: 30rpx;
+						margin-left: 22rpx;
+					}
+					>view:nth-of-type(2){
+						font-family: PingFang SC;
+						font-weight: 500;
+						font-size: 28rpx;
+						color: #333333;
+						line-height: 30rpx;
+						margin-left: 44rpx;
+					}
+					>view:nth-of-type(3){
+						font-family: PingFang SC;
+						font-weight: 500;
+						font-size: 28rpx;
+						line-height: 30rpx;
+						flex: 1;
+						text-align: right;
+					}
+					.color-A{
+						color: #0183FA;
+					}
+					.color-B{
+						color: #999999;
+					}
+					.color-C{
+						color: #FFAE00;
+					}
+				}
+				.list-b-img{
+					width: 710rpx;
+					height: 32rpx;
+				}
+				.list-b-b{
+					background: #FFFFFF;
+					border-radius:0 0 20rpx 20rpx;
+					padding-top: 32rpx;
+					box-sizing: border-box;
+					overflow: hidden;
+					>view{
+						margin: 0 0 26rpx 20rpx;	
+					}
+				}
+			}
+		}
+	}
+</style>

+ 204 - 0
pages_manage/laboratory/airConditioning.vue

@@ -0,0 +1,204 @@
+<!-- 空调 -->
+<template>
+	<view class="airConditioning">
+		<view class="null-box" @click="backPage()"></view>
+		<!-- 空调按钮 -->
+		<view class="panel">
+			<view class="panel-t">
+				<view>{{switchStatus==0?'空调未开启':'空调已开启'}}</view>
+				<view @click="switchFun()" :class="switchStatus==0?'color-A':'color-B'">{{switchStatus==0?'开启':'关闭'}}</view>
+			</view>
+			<view class="panel-m">
+				<view :class="keystrokeIndex==index?'color-C':''" v-for="(item,index) in keystrokeData">{{item}}</view>
+			</view>
+			<view class="panel-b">
+				<view @click="subtract">-</view>
+				<view>{{result}}℃</view>
+				<view @click="add">+</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	import {} from '@/api/basicsModules/index.js'
+	import { config } from '@/api/request/config.js'
+	export default {
+		name: "airConditioning",
+		props: {
+			subjectData: {},
+		},
+		data() {
+			return {
+				baseUrl:config.base_url,
+				//开关状态
+				switchStatus:0,
+				keystrokeData:['制热	','制冷','送风'],
+				keystrokeIndex:0,
+				num1: 0,	
+			}
+		},
+		computed: {
+		    result() {
+		      return this.num1;
+		    },
+		},
+		created() {
+
+		},
+		mounted() {
+			
+		},
+		methods: {
+			// 返回按钮
+			backPage(){
+			  this.$parent.buttonClick('conditioningClose','');
+			},
+			switchFun(){
+				if(this.switchStatus==0){
+					this.$set(this, 'switchStatus',1);
+				}else{
+					this.$set(this, 'switchStatus',0);
+				}
+			},
+			add() {
+			  this.num1 += 1;
+			},
+			subtract() {
+			  this.num1 -= 1;
+			},	  
+			
+			
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	.airConditioning{
+		height: 100%;
+		width: 100%;
+		position: fixed;
+		top: 0;
+		display: flex;
+		flex-direction: column;
+		z-index: 10;
+		background: rgba(0, 0, 0, 0.2);
+		.null-box {
+		  flex: 1;
+		}
+		/* 空调面板 */
+		.panel{
+			width: 710rpx;
+			height: 430rpx;
+			background: #FFFFFF;
+			border-radius: 20rpx;
+			padding:34rpx 30rpx 0rpx;
+			box-sizing: border-box;
+			position: absolute;
+			top: 320rpx;
+			left:20rpx;
+			.panel-t{
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+				>view:nth-of-type(1){
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #333333;
+					line-height: 30rpx;
+					margin-right: 16rpx;
+				}
+				.color-A{
+					width: 100rpx;
+					height: 50rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 30rpx;
+					color: #FFFFFF;
+					line-height: 50rpx;
+					text-align: center;
+					background: #0183FA;
+					border-radius: 25rpx;
+				}
+				.color-B{
+					width: 100rpx;
+					height: 50rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 30rpx;
+					color: #666666;
+					line-height: 50rpx;
+					text-align: center;
+					background: #E0E0E0;
+					border-radius: 25rpx;
+				}
+			}
+			.panel-m{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				margin-top: 48rpx;
+				>view{
+					width: 200rpx;
+					height: 80rpx;
+					border-radius: 10rpx;
+					border: 1px solid #E0E0E0;
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #333333;
+					line-height: 80rpx;
+					text-align: center;
+				}
+				.color-C{
+					width: 200rpx;
+					height: 80rpx;
+					border-radius: 10rpx;
+					border: 1px solid #E0E0E0;
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #FFFFFF;
+					line-height: 80rpx;
+					text-align: center;
+					background: #0183FA;
+				}
+			}
+			.panel-b{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				width: 650rpx;
+				height: 100rpx;
+				border-radius: 10rpx;
+				border: 1px solid #E0E0E0;
+				margin-top: 40rpx;
+				>view:nth-of-type(1){
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #333333;
+					line-height: 100rpx;
+					width: 120rpx;
+					text-align: center;
+				}
+				>view:nth-of-type(2){
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #333333;
+					line-height: 30rpx;
+				}
+				>view:nth-of-type(3){
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 32rpx;
+					color: #333333;
+					line-height: 100rpx;
+					width: 120rpx;
+					text-align: center;
+				}
+			}
+		}
+		
+		
+	}
+</style>

+ 365 - 0
pages_manage/laboratory/iotControl.vue

@@ -0,0 +1,365 @@
+<template>
+	<view class="iotControl">
+		<view class="device-type">
+			<view v-for="(item,index) in deviceType" @click="deviceTypeFun(item)">
+				<img :src="item.img">
+				<view>{{item.name}}</view>
+				<img src="@/images/basicsModules/icon_wdwg_gd.png">
+			</view>
+		</view>
+		<!-- 传感器监测 -->
+		<view class="small-title">
+			<view></view>
+			<view>传感器监测</view>
+		</view>
+		<view class="sensor">
+			<view v-for="(item,index) in sensorData">
+				<img :src="item.img">
+				<veiw>{{item.name}}</veiw>
+			</view>
+		</view>
+		<!-- 智能控制 -->
+		<view class="small-title">
+			<view></view>
+			<view>智能控制</view>
+		</view>
+		<view class="intelligent-control">
+			<view  v-for="(item,index) in labHardwareVOList" :key="index">
+			  <view class="for-button-p">{{item.hardwareName}}
+				<text v-if="item.state.code=='3'&& item.hardwareTypeEnum.hardwareTypeCode==2">({{item.dictLabel}})</text>
+			  </view>
+			  <img v-if="item.state.code=='3' && item.pcType != 1" src="@/images/basicsModules/icon_10.png" @click="buttonClick('switch',item,'close')">
+			  <img v-if="item.state.code=='4' && item.pcType != 1" src="@/images/basicsModules/icon_11.png" @click="buttonClick('switch',item,'open')">
+			  <view class="for-button-p" v-if="item.state.code=='0' && item.pcType != 1">离线</view>
+			  <view class="for-button-p" v-if="item.state.code=='2' && item.pcType != 1" style="color:#0183FA;">在线</view>
+			  <view v-if="item.pcType == 1" class="pcType-button" @click="buttonClick('operate',item,'')">操作</view>
+			</view>
+		</view>
+		<!-- 智能终端 -->
+		<view class="small-title">
+			<view></view>
+			<view>智能终端</view>
+		</view>
+		<view class="intelligent-control">
+			<view  v-for="(item,index) in terminalData" :key="index">
+			  <view class="for-button-p">{{item.name}}</view>
+			  <view class="for-button-p" v-if="item.pcType == 1">离线</view>
+			  <view class="for-button-p" v-if="item.pcType != 1" style="color:#0183FA;">在线</view>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {} from '@/api/basicsModules/index.js'
+	export default {
+		name: "iotControl",
+		props: {
+			subjectData: {},
+		},
+		data() {
+			return {
+				deviceType:[
+					{
+						id:1,
+						name:'视频监控',
+						img: require('@/images/basicsModules/icon_xq_spjk.png'),
+					},
+					{
+						id:2,
+						name:'语音广播',
+						img: require('@/images/basicsModules/icon_sskz_xz.png'),
+					},
+					{
+						id:3,
+						name:'空调1',
+						img: require('@/images/basicsModules/icon_xq_kt.png'),
+					},
+					{
+						id:4,
+						name:'空调2',
+						img: require('@/images/basicsModules/icon_xq_kt.png'),
+					},
+				],
+				sensorData:[
+					{
+						name:'温度:  36°',
+						img: require('@/images/basicsModules/icon_yw_yc.png'),
+					},
+					{
+						name:'湿度:  60%',
+						img: require('@/images/basicsModules/icon_yw_yc.png'),
+					},
+					{
+						name:'烟感1号:  0',
+						img: require('@/images/basicsModules/icon_yw_yc.png'),
+					},
+					{
+						name:'烟感2号:  1',
+						img: require('@/images/basicsModules/icon_yw_yc.png'),
+					},
+					{
+						name:'一氧化碳:  0ppm',
+						img: require('@/images/basicsModules/icon_yw_yc.png'),
+					},
+					
+				],
+				labHardwareVOList:[
+					{
+						hardwareName:'高温设备1',
+						hardwareTypeEnum:{
+							enumName:'',	
+						},
+						state:{
+							code:3,
+						},
+						pcType:2,
+					}
+				],
+				terminalData:[
+					{
+						name:'智能管控一体机',
+						pcType:1,
+					}
+				],
+			}
+		},
+		created() {
+			
+		},
+		mounted() {
+			console.log(this.subjectData)
+		},
+		methods: {
+			//物联控制设备
+			deviceTypeFun(item){
+				if(item.id==1){
+					
+				}else if(item.id==2){
+					//语音广播弹窗开启
+					this.$parent.buttonClick('broadcastOpen','');
+				}else if(item.id==3){
+					//空调弹窗开启
+					this.$parent.buttonClick('conditioningOpen','');
+				}
+			},
+			buttonClick(type,row,status){
+			    let self = this;
+				if(type == 'switch'){
+				  //开关			
+				  let text = '';
+				  if(status == 'close'){
+				  	text = '关闭';
+				  }else if(status == 'open'){
+				  	text = '开启';
+				  }
+				  uni.showModal({
+						content: '确认要'+text+'吗?',
+						cancelColor:"#999",
+						confirmColor:"#0183FA",
+						success: function (res) {
+						  if (res.confirm) {
+							self.mangerControl(row,status);
+							console.log('用户点击确定');
+						  } else if (res.cancel) {
+							console.log('用户点击取消');
+						  }
+						}
+				  });  
+				}else if(type=='operate'){
+					//操作
+					uni.showModal({
+					  content: '确认要操作该设备吗?',
+					  cancelColor:"#999",
+					  confirmColor:"#0183FA",
+					  success: function (res) {
+						if (res.confirm) {
+						  self.controlSwitch(item.id);
+						  console.log('用户点击确定');
+						} else if (res.cancel) {
+						  console.log('用户点击取消');
+						}
+					  }
+					});
+				}
+			  
+			},
+			//设备开关
+			async mangerControl(item,status){
+			  let obj = {
+				id:item.id,
+				command:status,
+			  };
+			  const {data} = await mangerControl(obj);
+			  if(data.code == 200){
+				if(command == 'open'){
+				  item.type = 3;
+				}else if(command == 'close'){
+				  item.type = 4;
+				}
+				uni.showToast({
+				  title: '操作成功',
+				  icon:"none",
+				  mask:true,
+				  duration: 2000
+				});
+			  }
+			},
+			async controlSwitch(id){
+				const {data} = await controlSwitch({id:id});
+				if(data.code == 200){
+					uni.showToast({
+					  title: '操作成功',
+					  icon:"none",
+					  mask:true,
+					  duration: 2000
+					});
+				}
+			},
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	.iotControl {
+		width: 750rpx;
+		.device-type{
+			background: #fff;
+			padding: 24rpx 20rpx;
+			box-sizing: border-box;
+			display: flex;
+			justify-content: flex-start;
+			flex-wrap: wrap;
+			>view{
+				width: 356rpx;
+				height: 80rpx;
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+				border-right: 1px dashed #E0E0E0;
+				border-bottom: 1px dashed #E0E0E0;
+				padding-left: 10rpx;
+				box-sizing: border-box;
+				>img:nth-of-type(1){
+					width: 42rpx;
+					height: 42rpx;
+					margin-right: 12rpx;
+				}
+				>view{
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 30rpx;
+					color: #222222;
+					line-height: 80rpx;
+					width: 244rpx;
+				}
+				>img:nth-of-type(2){
+					width: 24rpx;
+					height: 22rpx;
+				}
+			}
+			>view:nth-child(2n){
+				border-right: none;
+				padding-left: 20rpx;
+				box-sizing: border-box;
+			}
+			>view:nth-last-child(1){
+				border-bottom: none;
+			}
+			>view:nth-last-child(2){
+				border-bottom: none;
+			}
+		}
+		.small-title{
+			height: 80rpx;
+			border-bottom: 1rpx solid #E0E0E0;
+			background: #FFFFFF;
+			margin-top: 20rpx;
+			display: flex;
+			align-items: center;
+			>view:nth-of-type(1){
+				width: 4rpx;
+				height: 34rpx;
+				background: #0D97EB;
+				margin: 0rpx 24rpx 0 20rpx;
+			}
+			>view:nth-of-type(2){
+				font-family: PingFang SC;
+				font-weight: 500;
+				font-size: 32rpx;
+				color: #333333;
+				line-height: 80rpx;
+			}
+			
+		}
+		.sensor{
+			display: flex;
+			justify-content: flex-start;
+			flex-wrap: wrap;
+			background: #fff;
+			padding: 12rpx 20rpx 30rpx;
+			box-sizing: border-box;
+			>view{
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+				height: 66rpx;
+				width: 355rpx;
+				>img{
+					width: 42rpx;
+					height: 42rpx;
+					margin-right: 20rpx;
+				}
+				>view{
+					font-family: PingFang SC;
+					font-weight: 500;
+					font-size: 28rpx;
+					color: #222222;
+					line-height: 30rpx;
+				}
+			}
+		}
+		.intelligent-control{
+			background: #fff;
+			padding:0 20rpx;
+			box-sizing: border-box;
+			>view{
+				display flex
+				border-bottom:1rpx solid #e0e0e0;
+				.for-button-p{
+				  flex:1;
+				  line-height:90rpx;
+				  color:#333333;
+				  font-size:28rpx;
+				  >text{
+					  font-size: 28rpx;
+					  color: #0183FA;
+				  }
+				}
+				>img{
+				  height:50rpx;
+				  width:100rpx;
+				  margin:20rpx 0 20rpx 0;
+				}
+				view:nth-child(2){
+				  text-align right
+				  color:#999;
+				}
+				.pcType-button{
+				  width:120rpx;
+				  line-height:42rpx;
+				  border:4rpx solid #0183FA;
+				  border-radius:30rpx;
+				  color: #0183FA !important;
+				  font-size: 24rpx;
+				  text-align center !important;
+				  margin:20rpx 0 20rpx 0;
+				}
+			}
+			>view:nth-last-child(1){
+				border-bottom:none;
+			}	
+		}
+	}
+</style>

+ 426 - 0
pages_manage/laboratory/voiceBroadcast.vue

@@ -0,0 +1,426 @@
+<!-- 语音广播 -->
+<template>
+	<view class="voiceBroadcast">
+		<view class="null-box" @click="backPage()"></view>
+		<!-- 语音广播-执行疏散 -->
+		<view class="broadcast">
+		  <view class="broadcast_t">语音广播<label>选择喇叭位置</label></view>
+		  <!-- 按钮部分 -->
+		  <view class="trumpet-max-box">
+			<view @click="trumpetClick(index)" class="trumpet-for-box"
+				  :class="item.type?'trumpet-color-a':'trumpet-color-b'" v-for="(item,index) in trumpetList"
+				  :key="index">
+			  <img src="@/images/basicsModules/icon_sskz_zc.png" v-if="!item.type">
+			  <img src="@/images/basicsModules/icon_sskz_xz.png" v-if="item.type">
+			  {{item.name}}
+			</view>
+		  </view>
+		  <view class="broadcast_m">
+			<view class="broadcast_m_t" 
+			    :class="liveType?'broadcast_m_t_back_a':'broadcast_m_t_back_b'"
+				@longpress.stop="recordButton"
+				@touchmove.stop="cancelButton"
+				@touchend.stop="sendButton"
+			>
+				{{liveType?'松开发送':'按住说话'}}
+			</view>
+			<view class="broadcast_m_b" v-if="!liveType">按住说话,录入广播内容</view>
+			<view class="broadcast_m_b" v-if="liveType">松开发送,向上滑动取消发送</view>
+		  </view>
+		</view>
+	</view>
+</template>
+<script>
+	import {} from '@/api/basicsModules/index.js'
+	import { config } from '@/api/request/config.js'
+	export default {
+		name: "voiceBroadcast",
+		props: {
+			subjectData: {},
+		},
+		data() {
+			return {
+				baseUrl:config.base_url,
+				//喇叭数据
+				trumpetList: [],
+				//广播相关
+				liveType: false,
+				sendLock: true, //发送锁,当为true时上锁,false时解锁发送
+				recorderManager: wx.getRecorderManager(),
+				isEvacuate: true, //疏散按钮控制,当为true时候执行疏散
+				//滑动记录
+				startPoint: {},	  		
+			}
+		},
+		created() {
+
+		},
+		mounted() {
+			
+		},
+		methods: {
+			// 返回按钮
+			backPage(){
+			  this.$parent.buttonClick('broadcastClose','');
+			},      
+			//获取喇叭列表
+			async getDeviceListBySub() {
+			  let _this=this;
+			  let obj = {
+				subId: _this.subId,
+				floorId: _this.itemData.subAddrr.floorId,
+				page: 1,
+				pageSize: 100,
+			  };
+			  const {data} = await getDeviceListBySub(obj)
+			  if (data.code == 200) {
+				for (let i = 0; i < data.data.length; i++) {
+				  data.data[i].type = false;
+				}
+				this.$set(this, 'trumpetList', data.data)
+			  }
+			},
+			//点击选择喇叭
+			trumpetClick(index) {
+			  this.trumpetList[index].type = !this.trumpetList[index].type;
+			},
+			//录制
+			recordButton(e) {
+			  console.log("按下")
+			  let self = this;
+			  let num = 0;
+			  for (let i = 0; i < self.trumpetList.length; i++) {
+				if (self.trumpetList[i].type) {
+				  num++
+				}
+			  }
+			  if (num == 0) {
+				uni.showToast({
+				  title: '请选择喇叭',
+				  icon: "none",
+				  mask: true,
+				  duration: 2000
+				});
+				return
+			  }
+			  this.liveType = true;
+			  console.log('录制', e)
+			  this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
+			  const options = {
+				duration: 10000,
+				sampleRate: 16000,
+				numberOfChannels: 1,
+				encodeBitRate: 48000,
+				format: 'mp3',
+				frameSize: 50
+			  }
+			  this.recorderManager.start(options); //开始录音
+			  this.recorderManager.onStart(() => {
+				console.log('recorder start')
+			  })
+			  this.recorderManager.onError((res) => {
+				console.log(res);
+			  })
+			  wx.showToast({
+				title: "正在录音,上划取消发送",
+				icon: "none",
+				duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
+			  });
+			  this.sendLock = false; //长按时是不上锁的。
+			},
+			//取消
+			cancelButton(e) {
+			  console.log("移动")
+			  let self = this;
+			  let num = 0;
+			  for (let i = 0; i < self.trumpetList.length; i++) {
+				if (self.trumpetList[i].type) {
+				  num++
+				}
+			  }
+			  if (num == 0) {
+				return
+			  }
+			  this.liveType = false;
+			  console.log('取消', e)
+			  let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
+			  if (Math.abs(moveLenght) > 50) {
+				wx.showToast({
+				  title: "松开手指,取消发送",
+				  icon: "none",
+				  duration: 60000
+				});
+				this.sendLock = true; //触发了上滑取消发送,上锁
+			  } else {
+				wx.showToast({
+				  title: "正在录音,上划取消发送",
+				  icon: "none",
+				  duration: 60000
+				});
+				this.sendLock = false; //上划距离不足,依然可以发送,不上锁
+			  }
+			},
+			//发送
+			sendButton(e) {
+			  console.log("松开")
+			  let self = this;
+			  let num = 0;
+			  for (let i = 0; i < self.trumpetList.length; i++) {
+				if (self.trumpetList[i].type) {
+	
+				  num++
+				}
+			  }
+			  if (num == 0) {
+				return
+			  }
+			  this.liveType = false;
+			  console.log('发送', e)
+			  wx.hideToast(); //结束录音、隐藏Toast提示框
+			  this.recorderManager.stop(); //结束录音
+			  this.recorderManager.onStop((res) => {
+				if (!this.sendLock) {
+				  console.log('1', this.recorderManager)
+				  this.uploadImg(res.tempFilePath);
+				}
+				console.log('停止录音', res.tempFilePath)
+				console.log("sendLock", this.sendLock);
+			  })
+			},
+			//上传MP3
+			async uploadImg(tempFilePaths) {
+			  var self = this;
+			  uni.uploadFile({
+				url: config.base_url + '/base/file/upload', //仅为示例,非真实的接口地址
+				header: {
+				  'Authorization': uni.getStorageSync('token')
+				},
+				filePath: tempFilePaths,
+				name: 'file',
+				formData: {
+				  'user': 'test'
+				},
+				success: (uploadFileRes) => {
+				  let res = JSON.parse(uploadFileRes.data);
+				  if (res.code == 200) {
+					console.log("上传成功", res)
+					self.textParseUrlIps(config.base_url + '/' + res.data.url);
+				  } else {
+					uni.showToast({
+					  title: res.msg,
+					  icon: "none",
+					  mask: true,
+					  duration: 2000
+					});
+				  }
+				},
+				fail: err => {
+				  uni.hideLoading()
+				},
+				complete: () => {}
+			  });
+			},
+			//发送语音
+			async textParseUrlIps(text) {
+			  let self = this;
+			  let newList = [];
+			  for (let i = 0; i < self.trumpetList.length; i++) {
+				if (self.trumpetList[i].type) {
+				  let obj = {
+					sn: self.trumpetList[i].deviceSn,
+					port: self.trumpetList[i].port,
+					deviceIp: self.trumpetList[i].deviceIp,
+					type: "",
+					name: "",
+					speed: "",
+					params: {
+					  tid: "",
+					  vol: self.trumpetList[i].deviceVol,
+					  urls: []
+					}
+				  };
+				  newList.push(obj);
+				}
+			  }
+			  const {
+				data
+			  } = await textParseUrlIps(newList, text)
+			  if (data.code == 200) {
+				uni.showToast({
+				  title: '发送成功',
+				  icon: "none",
+				  mask: true,
+				  duration: 2000
+				});
+			  }
+			},
+		},
+	}
+</script>
+
+<style lang="stylus" scoped>
+	.voiceBroadcast{
+		height: 100%;
+		width: 100%;
+		position: fixed;
+		top: 0;
+		display: flex;
+		flex-direction: column;
+		z-index: 10;
+		background: rgba(0, 0, 0, 0.2);
+		.null-box {
+		  flex: 1;
+		}
+		/* 语音广播-执行疏散 */
+		.broadcast {
+			width: 100%;
+			background: #FFFFFF;
+			border-top-left-radius: 20rpx;
+			border-top-right-radius: 20rpx;
+			padding:22rpx 30rpx 30rpx;
+			box-sizing: border-box;
+			margin-top: 20rpx;
+			position: absolute;
+			bottom: 0;
+		  .broadcast_t {
+			font-size: 30rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			color: #333333;
+			line-height: 30rpx;
+		
+			>label {
+			  font-size: 24rpx;
+			  font-family: PingFang SC;
+			  font-weight: 500;
+			  color: #999999;
+			  line-height: 30rpx;
+			  margin-left: 16rpx;
+			}
+		  }
+		
+		  .trumpet-max-box {
+			display: flex;
+			justify-content: flex-start;
+			margin-top: 22rpx;
+			flex-wrap: wrap;
+		
+			.trumpet-for-box {
+			  display: inline-block;
+			   width: auto;
+			  height: 60rpx;
+			  line-height: 60rpx;
+			  font-size: 24rpx;
+			  text-align: center;
+			  cursor: pointer;
+			  overflow: hidden;
+			  border: 1rpx solid #E0E0E0;
+			  border-radius: 10rpx;
+			  color: #E0E0E0;
+			  display: flex;
+			  justify-content: center;
+			  margin-right: 20rpx;
+			  margin-bottom: 10rpx;
+			  padding: 0 12rpx;
+		      box-sizing: border-box;
+			  >img {
+				width: 36rpx;
+				height: 34rpx;
+				margin: 12rpx 20rpx 0 25rpx;
+			  }
+			}
+		
+			.trumpet-color-a {
+			  border: 1px solid #0183FA;
+			  color: #0183FA;
+			}
+		
+			.trumpet-color-b {
+			  border: 1px solid #CCCCCC;
+			  color: #999;
+			}
+		  }
+		
+		  .broadcast_m {
+			width: 100%;
+		
+			.broadcast_m_t {
+			  width: 142rpx;
+			  height: 142rpx;
+			  margin: 30rpx 0 0 258rpx;
+			  position: relative;
+			  font-size: 24rpx;
+			  font-family: PingFang SC;
+			  font-weight: 500;
+			  line-height: 170rpx;
+			  text-align: center;
+		
+			  >img {
+				width: 142rpx;
+				height: 142rpx;
+				position: absolute;
+		
+			  }
+		
+			  >label {
+				width: 100%;
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #0183FA;
+				line-height: 24rpx;
+				display: inline-block;
+				text-align: center;
+				position: absolute;
+				top: 76rpx;
+			  }
+		
+			  /* 按下 */
+			  .press_color {
+				color: #FFFFFF;
+			  }
+		
+			  /* 松开 */
+			  .slip_color {
+				color: #0183FA;
+			  }
+			}
+		
+			.broadcast_m_t_back_a {
+			  background: url(@/images/basicsModules/icon_sskz_skfs.png);
+			  background-size: 100%;
+			  color: #FFFFFF;
+			}
+		
+			.broadcast_m_t_back_b {
+			  background: url(@/images/basicsModules/icon_sskz_azsh.png);
+			  background-size: 100%;
+			  color: #0183FA;
+			}
+		
+			.broadcast_m_b {
+			  font-size: 24rpx;
+			  font-family: PingFang SC;
+			  font-weight: 500;
+			  color: #999999;
+			  line-height: 24rpx;
+			  text-align: center;
+			  margin-top: 14rpx;
+			}
+		  }
+		
+		  /* 疏散按钮 */
+		  .evacuation-button-box {
+			width: 650rpx;
+			height: 100rpx;
+			background: #0183FA;
+			color: #fff;
+			text-align center;
+			line-height: 100rpx;
+			font-size: 28rpx;
+			margin: 88rpx auto 0;
+			border-radius: 20rpx;
+		  }
+		}
+	}
+</style>