<!-- 开始检查 -->
<template>
    <view id="startChecking">
        <!--选择检查实验室-->
        <view class="startCheckingPage" v-if="pageType == 1">
            <view class="startCheckingPage-top-box">
                <view class="item-picker-box">
                    <view class="name-p">房间号</view>
                    <view class="span-p">*</view>
                    <view class="picker-big-box">
						<view class="picker-box">
							<input class="picker-text" @click="popupClick(1)" type="text" disabled v-model="form.fjNumber" placeholder="请选择房间">
							<view class="img-box" @click.stop="saoCode">
								<img src="@/pages_manage/images/Version2.2/icon_aqjc_sm.png">
							</view>
						</view>
					</view>
                </view>
                <view class="item-picker-box">
                    <view class="name-p">实验楼</view>
                    <view class="span-p"></view>
                    <view class="picker-big-box">
                        <view class="picker-box picker-back">
                            <input class="picker-text" type="text" disabled maxlength="11" v-model="form.buildingName" placeholder="选择房间后自动匹配">
                        </view>
                    </view>
                </view>
                <view class="item-picker-box">
                    <view class="name-p">实验室</view>
                    <view class="span-p"></view>
                    <view class="picker-big-box">
                        <view class="picker-box picker-back">
                            <input class="picker-text" type="text" disabled maxlength="11" v-model="form.laboratoryName" placeholder="选择房间后自动匹配">
                        </view>
                    </view>
                </view>
                <view class="item-picker-box">
                    <view class="name-p">负责人</view>
                    <view class="span-p"></view>
                    <view class="picker-big-box">
                        <view class="picker-box picker-back">
                            <input class="picker-text" type="text" disabled maxlength="11" v-model="form.fzrName" placeholder="选择房间后自动匹配">
                        </view>
                    </view>
                </view>
                <view class="item-picker-box">
                    <view class="name-p">联系方式</view>
                    <view class="span-p"></view>
                    <view class="picker-big-box">
                        <view class="picker-box">
                            <input class="picker-text" type="number" maxlength="11" v-model="form.fzrLxfs" placeholder="请输入联系方式">
                        </view>
                    </view>
                </view>
            </view>
            <view class="startCheckingPage-bottom-button" @click="goButton(2)">确定</view>
        </view>
        <!--录入检查项-->
        <view class="check-item-page" v-if="pageType == 2">
            <!--录入检查项-->
            <view class="user-info-box" @click="goButton(1)">
                <view class="user-info-left">
                    <view class="user-info-min-box">
                        <img src="@/pages_manage/images/Version2.2/icon_aqjc_sysxx.png">
                        <view>实验室信息</view>
                        <view>{{form.laboratoryName}}</view>
                    </view>
                    <view class="user-info-min-box">
                        <img src="@/pages_manage/images/Version2.2/icon-aqjc_fzr.png">
                        <view>实验室负责人</view>
                        <view>{{form.fzrName}}</view>
                    </view>
                </view>
                <img class="user-info-right" src="@/pages_manage/images/icon_04.png">
            </view>
            <view class="check-for-max-box" v-if="minPageType == 1">
                <view class="check-for-big-box" v-for="(item,index) in form.detailsList" :key="index">
					<view class="check-for-button-max-box">
						<view class="left-title-p">检查项：</view>
						<uni-data-picker :ellipsis="false" :localdata="checkOptionList[index]" :map="{text:'name',value:'id'}"
						popup-title="请选择所属目录" @change="(e)=>onchange(e,index)" @nodeclick="onnodeclick"
						ref="uniDataPicker" :addType="true" :addIndex="index">
							<view  class="button-text-p">{{item.jcxName?item.jcxName:'请选择检查项'}}</view>
						</uni-data-picker>
					</view>
					<view class="check-for-button-add-p" @click="dialogClick(index)"> 手动添加检查项 </view>
                    <view class="check-for-img-max-box">
                        <view class="left-title-p">隐患图片：</view>
                        <view class="right-img-box">
                            <view class="img-box" v-for="(imgUrl,imgIndex) in item.yhImg" :key="imgIndex">
                                <img class="img-data" :src="configURL+imgUrl">
                                <img class="position-img" src="@/pages_manage/images/icon_ssp_closure.png" @click="delImg(index,imgIndex)">
                            </view>
                            <img class="add-button" src="@/pages_manage/images/icon_07.png" @click="selectImage(item)" v-if="item.yhImg.length<5">
                        </view>
                    </view>
                    <view class="check-for-input-max-box">
                        <view class="left-title-p">隐患描述：</view>
                        <textarea type="text" v-model="item.yhMs" maxlength="50" placeholder="请输入问题描述"></textarea>
                    </view>
                   <view class="voice">
                       <view class="voice_t">语音备注：</view>
					   <view class="voice_b" v-for="(voiceItem,voiceIndex) in item.voice" :key="voiceIndex">
						   <view class="voice_b_l" @tap="voicePlay(voiceItem.url)"><img class="add-button" src="@/pages_manage/images/icon_yyt.png"/>{{voiceItem.times}}″</view>
						   <img class="voice_b_r" src="@/pages_manage/images/Version2.3/icon_sczl_sc.png" @tap="voiceDele(index,voiceIndex)"/>
					   </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(item,$event)" @touchmove.stop="cancelButton"  @touchend.stop="sendButton(item,$event)">
				   		{{liveType?'松开发送':'按住说话'}}
				   	</view>
				   </view>

					<view class="check-for-big-box-position-img-box"
					v-if="form.detailsList.length>1"
					@click="delDetailsList(index)">
						<img src="@/pages_manage/images/icon_ssp_closure.png">
					</view>
                </view>
            </view>
            <view class="add-for-item-p" @click="addDanger" v-if="minPageType == 1">+ 新增隐患项</view>
            <view class="check-button-box-one" v-if="minPageType == 1" @click="goMinButton(2)">下一步</view>
            <!--检查项详情-->
            <view class="danger-list-box" v-if="minPageType == 2" @click="goMinButton(1)">
                <img class="danger-list-left-img" src="@/pages_manage/images/Version2.2/icon_aqjc_yhsl.png">
                <view class="danger-list-left-text">隐患数量</view>
                <view class="danger-list-left-num">{{form.detailsList.length}}</view>
                <img class="danger-list-right-img" src="@/pages_manage/images/icon_04.png">
            </view>
            <view class="danger-title-text-p" v-if="minPageType == 2">整改选项</view>
            <view class="danger-info-picker-max-box" v-if="minPageType == 2">
                <view class="danger-info-picker-box">
                    <view class="danger-info-picker-title">截止时间</view>
                    <picker mode="date" @change="deadlineChange">
						<input class="picker-text" disabled type="text" v-model="deadline" placeholder="请选择截止时间">
                    </picker>
                </view>
                <view class="danger-info-picker-box">
                    <view class="danger-info-picker-title">整改类型</view>
                    <picker @change="rectificationTypeChange" :range="rectificationTypeArray">
						<input class="picker-text" disabled type="text" v-model="rectificationType" placeholder="请选择整改类型">
                    </picker>
                </view>
                <view class="danger-info-picker-box">
                    <view class="danger-info-picker-title">检查单位</view>
                    <picker @change="inspectionUnitChange" :range="inspectionUnitArray">
						<input class="picker-text" disabled type="text" v-model="inspectionUnit" placeholder="请选择检查单位">
                    </picker>
                </view>
            </view>
			<!-- 检查名称弹窗 -->
			<uni-popup ref="popup" class="inspect_name" type="bottom">
				<view class="popup-content">
					<view class="inspect_name_t">
						<view class="inspect_name_t_l">检查名称：</view>
						<input type="text" v-model="form.checkName" maxlength="20" placeholder="请输入检查名称"/>
					</view>
					<view class="inspect_name_b" @click="releaseFun()">发布</view>
				</view>
			</uni-popup>
            <view class="check-button-box" v-if="minPageType == 2">
                <view @click="upDataClick(1)">保存草稿</view>
                <view @click="upDataClick(2)">提交检查</view>
            </view>
        </view>
        <!--搜索项-->
        <view class="search-max-box" v-if="pageType == 3">
            <view class="search-top-input-box">
                <input type="text" maxlength="14" placeholder="请输入检查项关键字" @confirm="inputSearch">
            </view>
            <scroll-view scroll-y @scrolltolower="inputSearch" class="scroll-box">
                <view class="search-for-box" v-for="(item,index) in searchList" :key="index">
                    <view>{{item.name}}</view>
                    <view>{{item.text}}</view>
                </view>
                <view class="search-add-item" v-if="searchList[0]">
                    <view>没有找到对应的检查项</view>
                    <view>手动添加 >></view>
                </view>
                <view class="search-null-box" v-if="searchNullType">
                    <img src="@/pages_manage/images/Version2.2/icon_xzwt_kzt.png">
                    <view>没有找到对应的问题~</view>
                    <view>手动添加</view>
                </view>
            </scroll-view>
        </view>
		<!-- 添加项 -->
		<view class="add-search-max-box" v-if="open">
			<view class="add-search-min-box">
				<view class="add-search-box">
					<view class="add-search-title">检查项名称</view>
					<textarea class="add-search-input" type="text" v-model="examinationForm.name" maxlength="30" placeholder="请输入问题名称"></textarea>
				</view>
				<view class="add-search-box">
					<view class="add-search-title">所属目录</view>
					<uni-data-picker :ellipsis="false" :localdata="checkOptionListExamination" :map="{text:'name',value:'id'}"
					popup-title="请选择所属目录" @change="onchangeTwo" @nodeclick="onnodeclickTwo" >
						<view  class="add-search-picker">{{examinationForm.value?examinationForm.value:'请选择所属目录'}}</view>
					</uni-data-picker>
				</view>
			</view>
			<view class="add-search-button">
			    <view @click="dialogClickOff">返回</view>
			    <view @click="addPopupTwoButtonClick">立即添加</view>
			</view>
		</view>
		<!-- 房间选择弹出层 -->
		<view class="popup-max-box" v-if="popupType">
			<view class="popup-null" @click="popupClick(2)"></view>
			<view class="popup-big-box">
				<view class="popup-input-box">
					<input type="text" maxlength="10" v-model="room" placeholder="请输入房间号">
					<view @click="getSelectInfoByRoom">搜索</view>
				</view>
				<view class="popup-for-max-box">
					<view class="popup-for-null" v-if="!roomList[0]">暂无数据</view>
					<view class="popup-for-box" v-for="(item,index) in roomList" :key="index">
						<view class="name-p">{{item.name}} ({{item.room}})</view>
						<view class="button-p" @click="popupClickItem(item)">确定</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const myaudio  = uni.createInnerAudioContext();
    import { config } from '@/api/request/config.js'
    import { checkRecordAddC,checkRecordAdd,getSelectInfoByRoom, checkOptionList, treeselect,treeDepselect, addTempCheckOption,recordDettailsList,checkRecordUpdate } from '@/api/index.js'
    export default {
        name: "startChecking",
        data() {
            return {

				configURL:config.base_url,
				id:"",
				submitStatus:null,
				//当前隐患
				popupTwoIndex:"",
				//新增项or固有
				isLingshi:0,
				//新增名称
				addPopupName:"",
				//联级选择器
				popupTwoType:false,
				popupTopList:[],
				popupBottomList:[],
				popupIndex:0,
				popupMinIndex:"",
				popupIndexType:true,
				popupData1:{},
				popupData2:{},
				popupData3:{},
				popupData4:{},
				//房间弹层 状态
				popupType:false,
				//房间搜索字段
				room:"",
				roomList:[],
                //页面状态
                pageType:1,
                //页面子状态
                minPageType:1,
				//数据
				form:{
					checkName:'',//检查名称
					fjNumber:"",
					buildingId:"",
					buildingName:"",
					laboratoryId:"",
					laboratoryName:"",
					fzrId:"",
					fzrName:"",
					fzrLxfs:"",
					jcDw:"",
					detailsList:[
						{
							isLingshi:0,
							yhImg:[],
							voice:[],//语音备忘存储
							yhMs:"",
							jcxId:"",
							jcxName:"",
						}
					],
				},
                //检查项
                userData:{
                    name:"第一教学楼-101号",
                    userName:"刘轩宇"
                },
                //检查列表项
                forDataList:[
                    {
                        dangerImg:[],
                        dangerText:"",
                        dangerId:"",
                        dangerName:"请选择对应检查项",
                    }
                ],
                //检查详情选项数据
                deadline:"",
                rectificationType:"",
                rectificationTypeArray:['一般整改','重大整改'],
                inspectionUnit:"",
                inspectionUnitArray:[],
				inspectionUnitArrayData:[],
                //搜索回调列表
                searchList:[
                    // {
                    //     name:"检查项名称",
                    //     text:"一级检查项名称内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容",
                    // },
                    // {
                    //     name:"检查项名称",
                    //     text:"一级检查项名称内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容",
                    // },
                    // {
                    //     name:"检查项名称",
                    //     text:"一级检查项名称内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容",
                    // },
                ],
				searchNullType:true,
				//检查项
				checkOptionList:[],
				checkOptionListExamination:[],
				//新增检查项
				openIndex:"",
				open:false,
				examinationForm:{
					name:"",
					value:"",
					idList:"",
				},
				jcxSstkMs:[],
				jcxSstkNum:'',
				//临时数据组
				temporaryIdList:[],
				//添加项 目录
				uniPicker:"请选择所属目录",
				//滑动记录
				startPoint:{},
				liveType:false,
				sendLock: true, //发送锁，当为true时上锁，false时解锁发送
				recorderManager : wx.getRecorderManager(),
				temporaryData:[],
            }
        },
        onLoad(option) {
			this.getCheckOptionListTwo();
			this.treeselect();
			if(option.id){
				this.id = option.id;
				this.getInfo();
			}else{
				this.getCheckOptionList();
			}
        },
        onShow() {


        },
        methods: {
			//语音备忘播放
			async voicePlay(item){
				 myaudio.src = config.base_url+item;
				 myaudio.play();
			},
			//语音备忘删除
			async voiceDele(index,voiceIndex){
				let self = this;
				uni.showModal({
				  title: '',
				  cancelColor:'#999999',
				  confirmColor:'#FF6E6E',
				  content: '确定删除此语音吗?',
				  success (res) {
				    if (res.confirm) {
				      console.log('用户点击确定')
					  self.form.detailsList[index].voice.splice(voiceIndex,1);
					  self.$forceUpdate();
				    } else if (res.cancel) {
				      console.log('用户点击取消')

				    }
				  }
				})

			},
			//录制
			recordButton(item,e){
				console.log("按下")
				let self = this;
				if(item.voice.length>=5){
					uni.showToast({
						title: '语音备忘最多只能上传5条',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				this.liveType=true;
				console.log('录制',e)
				this.startPoint = e.touches[0];//记录长按时开始点信息，后面用于计算上划取消时手指滑动的距离。
				const options = {
					duration: 60000,
					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;

			    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(item,e){
				console.log("松开")
				let self = this;

			    this.liveType=false;
				console.log('发送',e)
				wx.hideToast();//结束录音、隐藏Toast提示框
				this.recorderManager.stop();//结束录音
				this.recorderManager.onStop((res) => {

					if(!this.sendLock){

						this.uploadVoice(item,res.duration,res.tempFilePath);
					}
					console.log('停止录音', res.tempFilePath)
					console.log("sendLock",this.sendLock);
				})
			},
			//上传MP3
			async uploadVoice(item,times,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)
							console.log(item)
							let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
							item.voice.push({'times':seconds,'url':res.data.url})
							console.log(JSON.stringify(self.voice))
							//self.textParseUrlIps(res.data.url);
							// self.newData.imgList.push(res.data.url);
						}else{
							uni.showToast({
								title: res.msg,
								icon:"none",
								mask:true,
								duration: 2000
							});
						}
			        },
			        fail: err => {
						uni.hideLoading()
					},
			        complete: () => {
			        }
			    });
			},
			//搜索特定检查项
			async searchClick(text,index){
				console.log("搜索text",text);
				console.log("搜索index",index);
				let newObj = {
					level:4,
					searchValue:text
				}
				const {data} = await checkOptionList(newObj);
				if(data.code == 200){

					if(data.data[0]){
						let list = JSON.parse(JSON.stringify(this.checkOptionList));
						list[index] = this.getTreeData(data.data);
						this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
						console.log('this.$refs.uniDataPicker',this.$refs.uniDataPicker)
						this.$refs.uniDataPicker[index].show();
					}else{
						uni.showToast({
							title: '未找到相关检查项',
							icon:"none",
							mask:true,
							duration: 2000
						});
					}
				}
			},
			//重置检查项
			async resetClick(index){
				console.log("重置index",index);
				let newObj = {
					level:4,
				}
				const {data} = await checkOptionList(newObj);
				if(data.code == 200){

					let list = JSON.parse(JSON.stringify(this.checkOptionList));
					list[index] = this.getTreeData(data.data);
					this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
					this.$refs.uniDataPicker[index].show();
				}
			},
			async getInfo(){
				let self = this;
				let obj = {
					id:this.id
				};
			    const {data} = await recordDettailsList(obj);
				if(data.code == 200){
				  let obj = JSON.parse(JSON.stringify(data.data));
				  console.log('详情',obj)
				  console.log(obj.yhlist[0].voice)
				  console.log(JSON.parse(obj.yhlist[0].voice))
				  for(let i=0;i<obj.yhlist.length;i++){
					  /* 语音格式转换*/
					 obj.yhlist[i].voice=JSON.parse(obj.yhlist[i].voice)
					let text = "";
					if(obj.yhlist[i].level1){
					  text = text + obj.yhlist[i].level1;
					}
					if(obj.yhlist[i].level2){
					  text = text + '/'+ obj.yhlist[i].level2;
					}
					if(obj.yhlist[i].level3){
					  text = text + '/'+ obj.yhlist[i].level3;
					}
					if(obj.yhlist[i].level4){
					  text = text + '/'+ obj.yhlist[i].level4;
					}
					obj.yhlist[i].level = text;
					if(obj.yhlist[i].yhImg){
					  if(obj.yhlist[i].yhImg[i]){
						obj.yhlist[i].yhImg = obj.yhlist[i].yhImg.split(",");
					  }
					}
					if(obj.yhlist[i].zmClImg){
					  if(obj.yhlist[i].zmClImg[i]){
						obj.yhlist[i].zmClImg = obj.yhlist[i].zmClImg.split(",");
					  }
					}
					if(obj.yhlist[i].yhZghImg){
					  if(obj.yhlist[i].yhZghImg[i]){
						obj.yhlist[i].yhZghImg = obj.yhlist[i].yhZghImg.split(",");
					  }
					}
				  }

					for(let i=0;i<obj.yhlist.length;i++){
						if(obj.yhlist[i].isLingshi == 1){
							let list = JSON.parse(JSON.stringify(this.checkOptionList));
							let minObj = {
								id:parseInt(obj.yhlist[i].jcxId+''),
								name:obj.yhlist[i].jcxName,
							}
							list.push(minObj);
							this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)));
							this.temporaryIdList.push(obj.yhlist[i].jcxId);
						}
						this.getCheckOptionList();
					}


				  let newOjb = obj.record;
				  newOjb.detailsList = obj.yhlist;
				  this.$set(this,'deadline',newOjb.zgjzTime);
				  if(newOjb.zgType == 0){
					  this.$set(this,'rectificationType','一般整改');
				  }else if(newOjb.zgType == 1){
					  this.$set(this,'rectificationType','重大整改');
				  }
				  for(let i=0;i<self.inspectionUnitArrayData.length;i++){
					  if(self.inspectionUnitArrayData[i].id == newOjb.jcDw){
						  this.$set(this,'inspectionUnit',self.inspectionUnitArrayData[i].label);
					  }
				  }
				  this.$set(this,'form',newOjb);
				}
			},
			//确认搜索房间
			popupClickItem(item){
				this.$set(this.form,"fjNumber",item.room)
				this.$set(this.form,"deptName",item.deptName)
				this.$set(this.form,"buildingId",item.building)
				this.$set(this.form,"deptId",item.deptId)
				this.$set(this.form,"laboratoryId",item.id)
				this.$set(this.form,"buildingName",item.buildName)
				this.$set(this.form,"laboratoryName",item.name)
				this.$set(this.form,"fzrId",item.userId)
				this.$set(this.form,"fzrName",item.safeUserName)
				this.$set(this.form,"fzrLxfs",item.safeUserPhone)
				this.popupType = false;
			},
			//联级选择器开关
			popupTwoClick(type,index){
				if(type == 1){
					this.isLingshi = 0;
					this.popupTwoIndex = index;
					this.addPopupName = "";
					this.popupBottomList = JSON.parse(JSON.stringify(this.checkOptionList))
					this.popupTwoType = true;
				}else if(type == 2){
					this.popupTwoType = false;
				}
			},
			//联级选择器添加/选择已有 切换
			popupTypeClick(){
				if(this.isLingshi == 0){
					this.isLingshi = 1;
				}else{
					this.isLingshi = 0;
				}
			},
			//搜索房间弹层开关
			popupClick(type){
				if(type == 1){
					this.room = "";
					this.roomList = [];
					this.popupType = true;
				}else if(type == 2){
					this.popupType = false;
				}
			},
			//搜索房间接口
			async getSelectInfoByRoom(){
			    let self = this;
				if(!this.room){
					uni.showToast({
						title: '请输入要搜索房间号',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
			    const {data} = await getSelectInfoByRoom(this.room);
				if(data.code==200){
					if(data.data[0]){
						this.roomList = data.data;
					}else{
						uni.showToast({
							title: '未找到相关房间',
							icon:"none",
							mask:true,
							duration: 2000
						});
					}
				}
			},
            //主页面切换
            goButton(type){
				if(type == 1){
					this.pageType = 1;
				}else if(type == 2){
					if(!this.form.fjNumber){
						uni.showToast({
							title: '请选择房间',
							icon:"none",
							mask:true,
							duration: 2000
						});
						return
					}
					this.pageType = 2;
				}
            },
            //调用摄像头
            saoCode(){
				let self = this;
                uni.scanCode({
                    onlyFromCamera: true,
                    success: function (res) {
						if(res.result.indexOf("code") != -1 && res.result.indexOf("-") != -1 && res.result.indexOf("&") != -1){
							let codeRoom = "";
							let newList = res.result.split("?")[1].split("&")
							let list = newList[0].split("=")[1].split("-")
							codeRoom = list[1];
							if(codeRoom){
								self.roomList = [];
								self.room = codeRoom;
								self.getSelectInfoByRoom();
								self.popupType = true;
							}else{
								uni.showToast({
									title: '请扫描正确的二维码',
									icon:"none",
									mask:true,
									duration: 2000
								});
							}
						}else{
							uni.showToast({
								title: '请扫描正确的二维码',
								icon:"none",
								mask:true,
								duration: 2000
							});
						}
                    }
                });
            },
            /**************************检查项***************************/
			//检查项初始化
			initialization(){
				this.popupTopList = [];
				this.popupBottomList = [];
				this.popupIndex = 0;
				this.popupMinIndex = "";
				this.popupIndexType = true;
				this.popupData1 = {};
				this.popupData2 = {};
				this.popupData3 = {};
				this.popupData4 = {};
				this.$forceUpdate();
			},

			//检查项确定按钮
			popupTwoButtonClick(){
				let self = this;
				if(!this.popupMinIndex){
					uni.showToast({
						title: '请选择检查项',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				let list = [];
				for(let i=0;i<self.popupTopList.length;i++){
					list.push(self.popupTopList[i].id);
				}

				let num = 0;
				for(let i=0;i<self.temporaryIdList.length;i++){
					if(self.temporaryIdList[i] == self.popupTopList[self.popupTopList.length-1].id){
						num++
					}
				}
				if(num == 0){
					this.$set(this.form.detailsList[this.popupTwoIndex],'isLingshi',0);
				}else{
					this.$set(this.form.detailsList[this.popupTwoIndex],'isLingshi',1);
				}
				this.form.detailsList[this.popupTwoIndex].jcxId = JSON.parse(JSON.stringify(list))
				this.form.detailsList[this.popupTwoIndex].jcxName = JSON.parse(JSON.stringify(self.popupTopList[self.popupTopList.length-1].name))
				this.popupTwoType = false;
				this.initialization();
			},
			//已选中检查项点击事件
			popupTwoMinItemClick(item,index){
				if(this.popupIndex != index){
					this.popupIndex = index;
					console.log("index",index)
					if(index == 0){
						this.popupData2 = {};
						this.popupData3 = {};
						this.popupData4 = {};
						this.popupTopList.splice(1,3);
						this.popupBottomList = this.popupData1;
					}else if(index == 1){
						this.popupData3 = {};
						this.popupData4 = {};
						this.popupTopList.splice(2,2);
						this.popupBottomList = this.popupData2;
					}else if(index == 2){
						this.popupData4 = {};
						this.popupTopList.splice(3,1);
						this.popupBottomList = this.popupData3;
					}
					this.popupMinIndex = "";
					this.$forceUpdate();
				}
			},
			//选中检查项
			popupTwoItemClick(item){
				let obj = {
					name:item.name,
					id:item.id
				}
				if(this.popupIndexType){
					if(this.popupTopList[0]){
						this.popupIndex++
					}
					this.popupTopList.push(obj);
				}else{
					this.popupTopList[this.popupTopList.length-1] = obj;
				}
				this.popupMinIndex = obj.id;
				this.popupIndexType = false;
				this.$forceUpdate();
			},
			//查看检查项下一级
			popupTwoImgClick(item){
				if(item.children){
					let obj = {
						name:item.name,
						id:item.id
					}
					if(this.popupIndexType){
						if(this.popupTopList[0]){
							this.popupIndex++
						}
						this.popupTopList.push(obj);
					}else{
						this.popupTopList[this.popupTopList.length-1] = obj
					}
					if(this.popupIndex == 0){
						this.popupData1 = JSON.parse(JSON.stringify(this.popupBottomList))
					}else if(this.popupIndex == 1){
						this.popupData2 = JSON.parse(JSON.stringify(this.popupBottomList))
					}else if(this.popupIndex == 2){
						this.popupData3 = JSON.parse(JSON.stringify(this.popupBottomList))
					}else if(this.popupIndex == 3){
						this.popupData4 = JSON.parse(JSON.stringify(this.popupBottomList))
					}
					this.popupBottomList = JSON.parse(JSON.stringify(item.children))
					this.popupMinIndex = "";
					this.popupIndexType = true;
					this.$forceUpdate();
				}
			},
			//获取检查项
			async getCheckOptionList() {
				let newObj = {
					level:4,
				}
				const {data} = await checkOptionList(newObj);
				if(data.code == 200){

					let list = this.getTreeData(data.data);
					this.checkOptionList.push(JSON.parse(JSON.stringify(list)));
				}
			},
			async getCheckOptionListTwo() {
				let newObj = {
					level:3,
				}
				const {data} = await checkOptionList(newObj);
				if(data.code == 200){
					let list = this.getTreeData(data.data);
					this.checkOptionListExamination = JSON.parse(JSON.stringify(list));
				}
			},
			//获取检查单位
			/* async treeselect() {
				let self = this;
			  const {data} = await treeselect({});
			  if(data.code == 200){
				let list = [];
				for(let i=0;i<data.data[0].children.length;i++){
					let obj = {
						id:data.data[0].children[i].id,
						label:data.data[0].children[i].label,
					}
					self.inspectionUnitArray.push(data.data[0].children[i].label)
					list.push(obj);
					for(let o=0;o<data.data[0].children[i].children.length;o++){
						let obj = {
							id:data.data[0].children[i].children[o].id,
							label:data.data[0].children[i].children[o].label,
						}
						self.inspectionUnitArray.push(data.data[0].children[i].children[o].label)
						list.push(obj);
					}
				}
				this.inspectionUnitArrayData = list;
			  }
			}, */
			async treeselect() {
				let self = this;
				  const {data} = await treeselect({});
				  if(data.code == 200){
					let list = [];
					for(let i=0;i<data.data[0].children.length;i++){
						let obj = {
							id:data.data[0].children[i].id,
							label:data.data[0].children[i].label,
						}
						if(data.data[0].children[i].children){
							for(let o=0;o<data.data[0].children[i].children.length;o++){
								let obj = {
									id:data.data[0].children[i].children[o].id,
									label:data.data[0].children[i].children[o].label,
								}
								self.inspectionUnitArray.push(data.data[0].children[i].children[o].label)
								list.push(obj);
							}
						}else{
							self.inspectionUnitArray.push(data.data[0].children[i].label)
							list.push(obj);
						}
					}
					this.inspectionUnitArrayData = list;
				  }
			},


			getTreeData(data){
			  for(var i=0;i<data.length>0;i++){
				if(data[i].children == null||data[i].children.length<=0){
				  // children若为空数组，则将children设为undefined
				  data[i].children = undefined;
				}else {
				  // children若不为空数组，则继续 递归调用 本方法
				  this.getTreeData(data[i].children);
				}
			  }
			  return data;
			},
            // 图片上传
            selectImage(item) {
                let self = this;
                if(item.yhImg.length>4){
                    uni.showToast({
                        title: '最多上传5张图片',
                        icon:"none",
                        mask:true,
                        duration: 2000
                    });
                    return
                }
                wx.chooseImage({
                    count: 1,
                    sizeType: ["original", "compressed"],
                    sourceType: ["album", "camera"],
                    success: function(res) {
                        let tempFilePaths = res.tempFilePaths[0];
                        self.uploadImg(tempFilePaths,item);
                    }
                });
            },
            async uploadImg(tempFilePaths,item){
                var self = this;
                uni.showLoading({
                    title: '上传中',
                    mask: true
                });
                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){
							item.yhImg.push(res.data.url);
							console.log(res.data.url)
						}else{
							uni.showToast({
								title: res.msg,
								icon:"none",
								mask:true,
								duration: 2000
							});
						}
                    },
                    fail: err => {},
                    complete: () => {
                        uni.hideLoading()
                    }
                });
            },
            //删除图片
            delImg(index,minIndex){
                this.form.detailsList[index].yhImg.splice(minIndex,1);
				this.$forceUpdate();
			},
            //添加隐患
            addDanger(){
				if(this.form.detailsList.length>19){
					uni.showToast({
						title: '最多添加20个隐患',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				let obj = {
					isLingshi:0,
					yhImg:[],
					voice:[],
					yhMs:"",
					jcxId:"",
					jcxName:"",
				}
				this.form.detailsList.push(obj);
				this.getCheckOptionList();
				this.$forceUpdate();
            },
			//删除隐患
			delDetailsList(index){
				this.form.detailsList.splice(index,1);
				this.$forceUpdate();
			},
            //子页面切换
            goMinButton(type){
				let self = this;
				if(type == 1){
					this.minPageType = 1;
				}else if(type == 2){
					for(let i=0;i<self.form.detailsList.length;i++){
						console.log(self.form.detailsList[i])
						console.log(typeof(self.form.detailsList[i].yhMs))
						console.log(typeof(self.form.detailsList[i].voice))
						let num = i+1;
						// if(!self.form.detailsList[i].yhImg[0]){
						// 	uni.showToast({
						// 		title: '第'+num+'个隐患项未上传图片',
						// 		icon:"none",
						// 		mask:true,
						// 		duration: 2000
						// 	});
						// 	return
						// }else
						/* if(!self.form.detailsList[i].yhMs){
							uni.showToast({
								title: '第'+num+'未填写隐患描述',
								icon:"none",
								mask:true,
								duration: 2000
							});
							return
						}else */ if(!self.form.detailsList[i].jcxName){
							uni.showToast({
								title: '第'+num+'未选择隐患项',
								icon:"none",
								mask:true,
								duration: 2000
							});
							return
						}else if(!self.form.detailsList[i].yhMs && self.form.detailsList[i].voice.length<=0){
							uni.showToast({
								title: '请输入第'+num+'项隐患描述!',
								icon:"none",
								mask:true,
								duration: 2000
							});
							return
						}
					}
					this.minPageType = 2;
				}
            },
            //整改类型选中事件
            rectificationTypeChange(e){
				if(e.target.value == 0){
					this.rectificationType = "一般整改";
				}else if(e.target.value == 1){
					this.rectificationType = "重大整改";
				}
				this.form.zgType = e.target.value;
            },
            //检查单位选中事件
            inspectionUnitChange(e){
				this.form.jcDw = this.inspectionUnitArrayData[e.target.value].id;
				this.form.jcDwName = this.inspectionUnitArrayData[e.target.value].label;
				this.inspectionUnit = this.inspectionUnitArrayData[e.target.value].label;
            },
            //截止时间选中事件
            deadlineChange(e){
				let time = e.target.value.replace(/-/g, '/')
				    time = Date.parse(time)
				let time2 = new Date().setHours(0,0,0,0)
				if(time<time2){
					uni.showToast({
						title: '请选择今天或以后的时间',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
                console.log('picker发送选择改变，携带值为', e.target.value)
                this.form.zgjzTime = e.target.value;
				this.deadline = e.target.value
            },

			//发布
			async releaseFun(){
				let self=this;

				let type=this.submitStatus;

				let obj = JSON.parse(JSON.stringify(this.form))

				for(let i=0;i<obj.detailsList.length;i++){
					if(obj.detailsList[i].jcxName.indexOf("/") != -1){
						let list = obj.detailsList[i].jcxName.split("/");
						obj.detailsList[i].jcxName = list[list.length-1];
					}
						obj.detailsList[i].jcxId = obj.detailsList[i].jcxId + ',';
						obj.detailsList[i].yhImg = obj.detailsList[i].yhImg + '';
						obj.detailsList[i].voice = JSON.stringify(obj.detailsList[i].voice);

				}

				obj.zgStatus = 0;

				if(self.id){
					obj.isCg=0;
					obj.isFabu=1;
					const {data} = await checkRecordUpdate(obj);
					if(data.code == 200){
						uni.showToast({
							title: type == 1?'保存草稿成功':(type == 2?'提交成功':''),
							icon:"none",
							mask:true,
							duration: 2000
						});
					    setTimeout(function(){
					        uni.navigateBack();
					    },2000);
					}
				}else{
					self.saveSubmit(obj,type)
				}
			},
			//保存草稿
			async saveDraft(obj,type){
				obj.isCg=1;
				const {data} = await checkRecordAddC(obj);
				if(data.code == 200){
					uni.showToast({
						title: type == 1?'保存草稿成功':(type == 2?'提交成功':''),
						icon:"none",
						mask:true,
						duration: 2000
					});
				    setTimeout(function(){
				        uni.navigateBack();
				    },2000);
				}
			},
			//立即提交
			async saveSubmit(obj,type){

				obj.isCg=0;
				obj.isFabu=1;

				const {data} = await checkRecordAdd(obj);
				if(data.code == 200){
					uni.showToast({
						title: type == 1?'保存草稿成功':(type == 2?'提交成功':''),
						icon:"none",
						mask:true,
						duration: 2000
					});
				    setTimeout(function(){
				        uni.navigateBack();
				    },2000);
				}
			},

			//提交接口
			async upDataClick(type){
				let self = this;
				this.submitStatus=type;//提交检查和保存草稿箱按钮点击状态保存
				if(!this.form.zgjzTime){
					uni.showToast({
						title: '请选择整改时间',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				if(this.form.zgType != 0 && this.form.zgType != 1){
					uni.showToast({
						title: '请选择整改类型',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				if(!this.form.jcDw){
					uni.showToast({
						title: '请选择检查单位',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}

				let isVoice=false;
				let obj = JSON.parse(JSON.stringify(this.form))

				for(let i=0;i<obj.detailsList.length;i++){
					if(obj.detailsList[i].jcxName.indexOf("/") != -1){
						let list = obj.detailsList[i].jcxName.split("/");
						obj.detailsList[i].jcxName = list[list.length-1];
					}
						obj.detailsList[i].jcxId = obj.detailsList[i].jcxId + ',';
						obj.detailsList[i].yhImg = obj.detailsList[i].yhImg + '';
						obj.detailsList[i].voice = JSON.stringify(obj.detailsList[i].voice);

				}
				if(type==1){//保存草稿
					self.saveDraft(obj,type)
				}else if(type==2){//提交
					//如果有语音备注，提示
					this.form.detailsList.forEach(function(item){
						if(!item.yhMs && item.voice.length>=0){
							isVoice=true;
							console.log('没有备注,但是有语音')
					      return
						}else{
							isVoice=false;
						}
					})
					if(isVoice==true){//有语音

						uni.showModal({
							 title: '',
							cancelText:'保存草稿',
							cancelColor:'#999999',
							confirmColor:'#0183FA',
							confirmText:'继续发布',
							content: '当前隐患描述使用语音备注，可以补充文字描述后提交发布或者 保存草稿箱后续发布?',
							success (res) {
							if (res.confirm) {
								 console.log('继续发布')
								  self.minPageType=1;
							 } else if (res.cancel) {
								console.log('保存草稿')
							    self.saveDraft(obj,type)

							  }
						 }
						})
					}else{
						console.log('没有语音')
						self.$refs.popup.open()

					}
				}




			},
            /**************************搜索项***************************/
            //搜索
            inputSearch(event){
                console.log("e",event.detail.value)
            },
			//选中固有检查项(新)
			onchange(e,index) {
				let self = this;
				let val = e.detail.value[e.detail.value.length-1].value
				let num = 0;
				for(let i=0;i<self.temporaryIdList.length;i++){
					if(self.temporaryIdList[i] == val){
						num++
					}
				}
				if(num == 0){
					this.$set(this.form.detailsList[index],'isLingshi',0);
				}else{
					this.$set(this.form.detailsList[index],'isLingshi',1);
				}
				let list = [];
				let listName=[];
				for(let i=0;i<e.detail.value.length;i++){
					list.push(e.detail.value[i].value)

					if(i<3){
						listName.push(e.detail.value[i].text)
					}

				}
				let jcxSstkNum=this.getTreeName(this.checkOptionList[0],e.detail.value[e.detail.value.length-1].value)

				this.$set(this.form.detailsList[index],'jcxSstkNum',jcxSstkNum);
				this.$set(this.form.detailsList[index],'jcxId',list);
				this.$set(this.form.detailsList[index],'jcxSstkMs',listName.join('-'));
				this.$set(this.form.detailsList[index],'jcxName',e.detail.value[e.detail.value.length-1].text);
			},
			  //根据id查找父元素
			getTreeName(list,id){
			   let _this=this
			  for (let i = 0; i < list.length; i++) {
				let a=list[i]
				if(a.id===id){
				  return a.code
				}else{
				  if(a.children && a.children.length>0){
					let res=_this.getTreeName(a.children,id)
					if(res){
					  return res
					}
				  }
				}
			  }
			},
			onnodeclick(node) {
				console.log("node",node)

			},
			//新增检查项-按钮
			dialogClick(index){
				this.examinationForm.name = "";
				this.examinationForm.value = "";
				this.examinationForm.idList = "";
				this.openIndex = index;
				this.open = true;
			},
			dialogClickOff(){
				this.open = false;
			},
			onchangeTwo(e){
				this.jcxSstkNum=[];
				this.jcxSstkMs='';
				this.$set(this.examinationForm,'value',e.detail.value[e.detail.value.length-1].text);
				this.$set(this.examinationForm,'idList',e.detail.value[e.detail.value.length-1].value);

				let list = [];
				let listName=[];
				for(let i=0;i<e.detail.value.length;i++){
					list.push(e.detail.value[i].value)
					if(i<3){
						listName.push(e.detail.value[i].text)
					}
				}
				console.log(9999)
				console.log(this.checkOptionListExamination)
				let jcxSstkNum=this.getTreeName(this.checkOptionListExamination,e.detail.value[e.detail.value.length-1].value)
				this.jcxSstkNum=jcxSstkNum;
				this.jcxSstkMs=listName.join('-');
				console.log(this.jcxSstkNum)
				console.log(this.jcxSstkMs)
				// this.$forceUpdate();
			},
			onnodeclickTwo(node) {
				console.log("node",node)

			},
			//新增检查项-提交
			async addPopupTwoButtonClick(){
				let self = this;
				if(!this.examinationForm.name){
					uni.showToast({
						title: '请输入检查项名称',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				if(!this.examinationForm.value){
					uni.showToast({
						title: '请选择所属目录',
						icon:"none",
						mask:true,
						duration: 2000
					});
					return
				}
				let obj = {
					name:this.examinationForm.name,
					parentId:this.examinationForm.idList
				};
				const {data} = await addTempCheckOption(obj);
				if(data.code == 200){
					let list = JSON.parse(JSON.stringify(this.checkOptionList));
					let obj = {
					  id:data.data.id,
					  name:data.data.name,
					};
					list.push(obj);
					this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)));
					this.temporaryIdList.push(data.data.id);



					this.$set(this.form.detailsList[this.openIndex],'jcxId',data.data.id);
					this.$set(this.form.detailsList[this.openIndex],'jcxName',data.data.name);
					this.$set(this.form.detailsList[this.openIndex],'isLingshi',1);

					this.$set(this.form.detailsList[this.openIndex],'jcxSstkNum',this.jcxSstkNum);
					this.$set(this.form.detailsList[this.openIndex],'jcxSstkMs',this.jcxSstkMs);


					uni.showToast({
						title: '新增成功',
						icon:"none",
						mask:true,
						duration: 2000
					});
					this.open = false;
				}
			},
        }
    }
</script>

<style lang="stylus" scoped>
    #startChecking{
        height: 100%;
        width: 100%;
        display flex
        .startCheckingPage{
            flex:1;
            .startCheckingPage-top-box{
                flex:1;
                margin:20rpx;
                background #fff
                border-radius:20rpx;
                padding:30rpx;
                .item-picker-box{
                    display: flex
                    margin-bottom:20rpx;
                    .name-p{
                        width:123rpx;
                        line-height:90rpx;
                        text-align right
                    }
                    .span-p{
                        width:36rpx;
                        color:#FF7373;
                        line-height:90rpx;
                    }
                    .picker-big-box{
                        flex:1;
                        border:2rpx solid #E0E0E0;
                        border-radius:10rpx;
                        height:90rpx;
                        .picker-box{
                            flex:1;
                            display flex
                            .picker-text{
                                flex:1;
                                line-height:90rpx;
                                margin-left:20rpx;
                                color:#999;
                                font-size:28rpx;
                            }
                            input{
                                height:90rpx;
                            }
                            .img-box{
                                width:78rpx;
                                height:90rpx;
                                img{
                                    width:30rpx;
                                    height:28rpx;
                                    margin:34rpx 28rpx;
                                }
                            }
                        }
						.picker-back{
							background:#f5f5f5;
						}
                    }
                }
            }
            .startCheckingPage-bottom-button{
                height:100rpx;
                width:650rpx;
                text-align center
                color:#fff;
                background #0183FA
                margin:80rpx auto;
                line-height:100rpx;
                font-size:28rpx;
                border-radius:20rpx;
            }
        }
        .check-item-page{
            flex:1;
            .user-info-box{
                width:710rpx;
                height:200rpx;
                margin:20rpx;
                background #fff
                border-radius:20rpx;
                display flex
                .user-info-left{
                    flex:1;
                    margin:0 25rpx 0 16rpx;
                    .user-info-min-box:nth-child(1){
                        border-bottom:1rpx solid #E0E0E0;
                    }
                    .user-info-min-box{
                        display flex
                        img{
                            height:30rpx;
                            width:30rpx;
                            margin:37rpx 13rpx 0 16rpx;
                        }
                        view{
                            line-height:100rpx;
                        }
                        view:nth-child(2){
                            font-size:30rpx;
							width:190rpx;
                            color:#999999;
                        }
                        view:nth-child(3){
							width:390rpx;
							display:block;
							overflow:hidden;
							text-overflow:ellipsis;
							white-space:nowrap;
							text-align right;
                            font-size:28rpx;
                        }
                    }
                }
                .user-info-right{
                    width:12rpx;
                    height:24rpx;
                    margin:88rpx 27rpx 0 0;
                }
            }
            .check-for-max-box{

                .check-for-big-box{
					width 710rpx;
					//padding-top:30rpx;
                    margin:0 20rpx 20rpx;
                    background #fff
                    border-radius:20rpx;
                    overflow hidden
					position relative;
					padding:20rpx;
					box-sizing border-box;
                    .check-for-img-max-box{
                        //display flex
                        .left-title-p{
                            width:150rpx;
                            line-height:88rpx;
                            text-align right
                            font-size:30rpx;
                        }
                        .right-img-box{
                            margin-top:30rpx;
                            .img-box{
                                display inline-block;
                                height:200rpx;
                                width:200rpx;
                                position relative
                                margin:0 20rpx 20rpx 0;
								border-radius 10rpx;
								overflow hidden;
                                .img-data{
                                    height:200rpx;
                                    width:200rpx;
                                }
                                .position-img{
                                    position absolute
                                    right:0;
                                    top:0;
                                    width:36rpx;
                                    height:36rpx;
                                }
                            }
                            .add-button{
								 margin:0 20rpx 20rpx 0;
								border-radius 10rpx;
								overflow hidden;
                                display inline-block
                                height:200rpx;
                                width:200rpx;
                            }
                        }
                    }
					/* 语音备注 */
					.voice{

						.voice_t{
							width:150rpx;
							line-height:88rpx;
							text-align right
							font-size:30rpx;
						}
						.voice_b{
							display flex;
							justify-content flex-start;
							align-items center;
							margin-bottom :30rpx;
							.voice_b_l{
								width: 400rpx;
								height: 40rpx;
								background:rgba(88,175,255,0.3);
								border-radius: 10rpx;
								display flex;
								justify-content flex-start;
								align-items center;
								>img{
									width: 18rpx;
									height: 24rpx;
									margin-left:16rpx;
									margin-right :20rpx;
								}
							}
							.voice_b_r{
								width: 28rpx;
								height: 28rpx;
								margin-left:20rpx;
							}
						}
					}
					.broadcast_m{
						width: 142rpx;
						height: 142rpx;
						position :fixed;
						right :10rpx;
						bottom:188rpx;
						z-index :100;
						.broadcast_m_t{
							width: 142rpx;
							height: 142rpx;
							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/icon_sskz_skfs.png);
							background-size 100%
							color: #FFFFFF;
						}
						.broadcast_m_t_back_b{
							background:url(@/images/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;
						}
					}
                    .check-for-input-max-box{
                        //display flex
                        margin-top:20rpx;
                        .left-title-p{
                            width:150rpx;
                            line-height:88rpx;
                            text-align right
                            font-size:30rpx;
                        }
                        textarea{
                            border:1rpx solid #E0E0E0;
							width 630rpx;
                            height:210rpx;
                            border-radius:10rpx;
                            line-height :40rpx;
                            padding:20rpx;
                            font-size:28rpx;
                        }
                    }
                    .check-for-button-max-box{
                        display flex
                        margin-top:30rpx;
                        margin-bottom:20rpx;
                        .left-title-p{
                            width:150rpx;
                            line-height:88rpx;
                            text-align right
                            font-size:30rpx;
                        }
                        .button-text-p{
                            border:1rpx solid #E0E0E0;
                            width:440rpx;
                            height:80rpx;
                            border-radius:10rpx;
                            line-height :80rpx;
                            color: #A2A2A2
                            padding:0 20rpx;
                            font-size:28rpx;
							display:block;
							overflow:hidden;
							text-overflow:ellipsis;
							white-space:nowrap;
                        }
                    }
					.check-for-button-add-p{
						text-align center;
						line-height:80rpx;
						color:#007AFF;
						margin-bottom:20rpx;
					}
					.check-for-big-box-position-img-box{
						position absolute
						top:0;
						right:0;
						width:60rpx;
						height:60rpx;
						img{
							width:36rpx;
							height:36rpx;
							margin:12rpx;
						}
					}
                }
            }
            .add-for-item-p{
                width:500rpx;
                height:80rpx;
                border:4rpx dashed #0183FA;
                color:#0183FA;
                font-size:28rpx;
                background #fff
                text-align center
                line-height:80rpx;
                border-radius:10rpx;
                margin:40rpx auto 100rpx;
            }
			.check-button-box-one{
				width:650rpx;
				margin:0 auto 100rpx;
				background: linear-gradient(-45deg, #FA9901, #F28E26);
				text-align:center;
				line-height:100rpx;
				font-size:30rpx;
				color:#fff;
				border-radius:50rpx;
			}
            .check-button-box{
                display flex
                width:650rpx;
                margin:0 auto 100rpx;
                view{
                    text-align center
                    line-height:100rpx;
                    font-size:30rpx;
                    color:#fff;
                }
                view:nth-child(1){
                    width:325rpx;
                    line-height:100rpx;
                    background: linear-gradient(-45deg, #FA9901, #F28E26);
                    border-bottom-left-radius 50rpx
                    border-top-left-radius 50rpx
                }
                view:nth-child(2){
                    width:325rpx;
                    line-height:100rpx;
                    background: linear-gradient(-35deg, #309CFF, #0183FA);
                    border-bottom-right-radius 50rpx
                    border-top-right-radius 50rpx
                }
            }
            .danger-list-box{
                display flex
                background #fff
                margin:0 20rpx;
                border-radius:20rpx;
                .danger-list-left-img{
                    height:30rpx;
                    width:30rpx;
                    margin:37rpx 13rpx 0 30rpx;
                }
                view{
                    line-height:100rpx;
                }
                .danger-list-left-text{
                    font-size:30rpx;
                    flex:1;
                    color:#999999;
                }
                .danger-list-left-num{
                    font-size:28rpx;
                    margin-right:50rpx;
                }
                .danger-list-right-img{
                    width:12rpx;
                    height:24rpx;
                    margin:38rpx 30rpx 0 0
                }
            }
            .danger-title-text-p{
                line-height:80rpx;
                font-size:30rpx;
                color:#333;
                margin-left:40rpx;
            }
            .danger-info-picker-max-box{
                margin:0 20rpx 100rpx;
                background #fff
                border-radius:20rpx;
                padding:30rpx;
                .danger-info-picker-box:nth-child(1){
                    margin-top:0;
                }
                .danger-info-picker-box{
                    display flex
                    margin-top:26rpx;
                    .danger-info-picker-title{

                        line-height:80rpx;
                        font-size:30rpx;
                        color:#333;
                    }
                    .picker-text{
                        width:480rpx;
                        height:80rpx;
                        border: 2rpx solid #E0E0E0;
                        padding-left:20rpx;
                        margin-left:20rpx;
                        color:#A2A2A2;
                        font-size:28rpx;
                        line-height 80rpx
                        border-radius:10rpx;
                    }

                }
            }
			/* 检查名称弹框 */
			.inspect_name{

				.popup-content{
					width: 750rpx;
					height: 350rpx;
					background: #FFFFFF;
					border-radius: 10rpx 10rpx 0px 0px;
					padding :0 50rpx;
					box-sizing :border-box;
					overflow :hidden;
					.inspect_name_t{
						display flex
						margin-top:66rpx;
						.inspect_name_t_l{
							line-height:80rpx;
							font-size:30rpx;
							color:#333;
						}
						>input{
							width:440rpx;
							height:80rpx;
							border: 2rpx solid #E0E0E0;
							padding-left:20rpx;
							margin-left:20rpx;
							color:#A2A2A2;
							font-size:28rpx;
							line-height 80rpx
							border-radius:10rpx;
						}
					}
					.inspect_name_b{
						margin-top :64rpx;
						width: 650rpx;
						height: 80rpx;
						background: linear-gradient(-35deg, #309CFF, #0183FA);
						border-radius: 40rpx;
						font-size: 30rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						line-height: 80rpx;
						text-align :center;
					}

				}

			}

        }
        .search-max-box{
            flex:1;
            display flex
            flex-direction column
            .search-top-input-box{
                overflow hidden
                height:150rpx;
                background #fff
                input{
                    width:670rpx;
                    height:80rpx;
                    border:1rpx solid #E0E0E0;
                    border-radius:10rpx;
                    margin:34rpx auto;
                    padding:0 20rpx;
                    font-size:28rpx;
                    color:#A2A2A2;
                }
            }
            .scroll-box{
                flex:1;
				padding-top:20rpx;
                .search-for-box:nth-child(1){
                    view:nth-child(1){
                        border-top:none;
                    }
                }
                .search-for-box{
                    margin:0 20rpx;
                    background #fff
                    view:nth-child(1){
                        line-height:28rpx;
                        font-size:28rpx;
                        padding-top:20rpx;
                        margin:0 20rpx 20rpx;
                        border-top:1rpx solid #E0E0E0;
                    }
                    view:nth-child(2){
                        line-height:30rpx;
                        font-size:24rpx;
                        color:#666;
                        margin:0 20rpx;
                        padding-bottom:20rpx;
                    }
                }
                .search-add-item{
                    width:680rpx;
                    margin:20rpx auto;
                    height:70rpx;
                    background #dedede;
                    display flex
                    border-radius:10rpx;
                    view{
                        font-size:24rpx;
                        line-height:70rpx;
                    }
                    view:nth-child(1){
                        color:#999;
                        flex:1;
                        margin-left:45rpx;
                    }
                    view:nth-child(2){
                        color:#0183FA;
                        margin-right:45rpx;
                    }
                }
                .search-null-box{
					img{
						width:274rpx;
						height:274rpx;
						margin:100rpx 0 20rpx 270rpx;
					}
					view:nth-child(2){
						margin:40rpx auto 90rpx;
						color:#999;
						font-size:28rpx;
						text-align center
					}
					view:nth-child(3){
						width:300rpx;
						height:70rpx;
						line-height:70rpx;
						text-align center
						font-size:28rpx;
						color:#fff;
						background #0183FA
						border-radius:50rpx;
						margin:0 auto;
					}
                }
            }
        }
		.add-search-max-box{
			background #fff;
			position fixed;
			width:100%;
			height:100%;
			z-index:100;
			.add-search-min-box{
				background #fff
				border-radius:10rpx;
				padding:30rpx 20rpx;
				margin:20rpx;
				.add-search-box:nth-child(1){
					margin-bottom:30rpx;
				}
				.add-search-box{
					display flex
					.add-search-title{
						flex:1;
						line-height:90rpx;
						margin-right:20rpx;
						font-size:30rpx;
					}
					.add-search-picker{
						border:1rpx solid #E0E0E0;
						width:431rpx;
						padding:25rpx 25rpx;
						// height:90rpx;
						// min-height:90rpx;
						line-height:40rpx;
						color:#888;
						border-radius:10rpx;
						font-size:28rpx;
					}
					.add-search-input{
						width:438rpx;
						padding:20rpx 20rpx;
						border:1rpx solid #E0E0E0;
						height:80rpx;
						line-height:40rpx;
						border-radius:10rpx;
						font-size:28rpx;
					}
				}
			}
			.add-search-button{
                display flex
                width:650rpx;
                margin:0 auto 100rpx;
                view{
                    text-align center
                    line-height:100rpx;
                    font-size:30rpx;
                    color:#fff;
                }
                view:nth-child(1){
                    width:325rpx;
                    line-height:100rpx;
                    background: linear-gradient(-45deg, #999, #999);
                    border-bottom-left-radius 50rpx
                    border-top-left-radius 50rpx
                }
                view:nth-child(2){
                    width:325rpx;
                    line-height:100rpx;
                    background: linear-gradient(-35deg, #309CFF, #0183FA);
                    border-bottom-right-radius 50rpx
                    border-top-right-radius 50rpx
                }
			}
		}
		.popup-max-box{
			z-index:10;
			height:100%;
			width:100%;
			position fixed;
			background rgba(0,0,0,0.2)
			display flex;
			flex-direction column
			.popup-null{
				flex:1;
			}
			.popup-big-box{
				border-top-left-radius:20rpx;
				border-top-right-radius:20rpx;
				background #fff
				.popup-input-box{
					padding:30rpx 20rpx;
					display:flex;
					input{
						flex:1;
						height:70rpx;
						border:1rpx solid #e0e0e0;
						border-radius:10rpx;
						margin-right:20rpx;
						padding:0 20rpx;
					}
					view{
						background #0183FA
						color:#fff;
						border-radius:10rpx;
						width:140rpx;
						line-height:70rpx;
						text-align center;
						font-size:28rpx;
					}
				}
				.popup-for-max-box{
					margin:0 20rpx 30rpx;
					height:600rpx;
					overflow-y scroll;
					.popup-for-null{
						line-height:100rpx;
						text-align center
						color:#999;
					}
					.popup-for-box{
						display:flex;
						padding:10px 0;
						.name-p{
							flex:1;
							line-height:60rpx;
						}
						.button-p{
							background #0183FA
							color:#fff;
							text-align center
							width:100rpx;
							line-height:60rpx;
							height:60rpx;
							border-radius:10rpx;
						}
					}
				}
			}
		}
		.popup-max-box-two{
			z-index:10;
			height:100%;
			width:100%;
			position fixed;
			background rgba(0,0,0,0.2)
			display flex;
			flex-direction column
			.popup-null{
				flex:1;
			}
			.popup-big-box{
				border-top-left-radius:20rpx;
				border-top-right-radius:20rpx;
				background #fff
				position relative;
				.popup-two-title-box{
					height:80rpx;
					line-height:80rpx;
					padding:0 20rpx;
					font-size:34rpx;
					text-align center;
					border-bottom:1rpx solid #dedede;
				}
				.popup-position-right{
					position absolute;
					top:0;
					right:20rpx;
					line-height:80rpx;
					font-size:28rpx;
					color:#0183FA;
				}
				.popup-add-name-box{
					display flex;
					padding:0 40rpx;
					margin-top:10rpx;
					view:nth-child(1){
						width:200rpx;
						line-height:80rpx;
					}
					input{
						border:1rpx solid #dedede;
						padding:0 20rpx;
						width:400rpx;
						height:60rpx;
						line-height:60rpx;
						margin:10rpx 0 0 ;
					}
				}
				.popup-top-box{
					height:90rpx;
					line-height:80rpx;
					padding:0 20rpx;
					font-size:30rpx;
					margin:10rpx 20rpx;
					overflow-x scroll
					overflow-y hidden
					white-space: nowrap;
					view{
						display inline-block
					}
					.view-inline-block-color{
						border-bottom:4rpx solid #0183FA;
					}
				}
				.popup-for-max-box{
					padding:20rpx 0 0 0 ;
					margin:0 20rpx 30rpx;
					height:600rpx;
					overflow-y scroll;
					.popup-for-box{
						display flex;
						.left-img{
							width:20rpx;
							height:20rpx;
							margin:30rpx;
						}
						.center-view{
							padding:20rpx 0;
							line-height:40rpx;
							flex:1;
						}
						.right-img-box{
							width:80rpx;
							height:80rpx;
							border-radius:50%;
							.right-img{
								width:18rpx;
								height:36rpx;
								margin:22rpx 31rpx;
							}
						}
					}
				}
				.popup-button{
					margin:20rpx auto;
					width:500rpx;
					height:80rpx;
					line-height:80rpx;
					text-align center;
					color:#fff;
					border-radius:20rpx;
				}
				.popup-button-colorA{
					background #0183FA
				}
				.popup-button-colorB{
					background #999
				}
			}
		}
	}

</style>
