浏览代码

首页智慧空调和员工管理接口联调完成,其余四个等待设备接入有数据后再联调

htc 2 月之前
父节点
当前提交
25464fcc1f

+ 37 - 0
components/pageEmpty/index.vue

@@ -0,0 +1,37 @@
+<template>
+	<div class="page-empty" :style="{'height':height,'margin-top':marginTop}">
+		<u-empty text="暂无数据" textSize="26rpx" width="332rpx" height="332rpx" mode="order" :icon="imgBase+'img_empty.jpg'"></u-empty>
+	</div>
+</template>
+
+<script>
+	export default {
+		props:{
+			height:{
+				typeof: String,
+				default: '100vh'
+			},
+			marginTop:{
+				typeof: String,
+				default: '0px'
+			}
+		},
+		data(){
+			return {
+				imgBase:this.$imgBase
+			}
+		},
+		methods:{
+			
+		}
+	}
+</script>
+
+<style scoped lang="less">
+	.page-empty{
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+</style>

+ 2 - 1
pages.json

@@ -38,7 +38,8 @@
 				{
 					"path": "airConditioner/index",
 					"style": {
-						"navigationStyle": "custom"
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": true
 					}
 				},
 				{

+ 187 - 129
pagesHome/airConditioner/index.vue

@@ -3,22 +3,22 @@
 		<cus-header title='智慧空调' bgColor='transparent'></cus-header>
 		<image class="bg" :src="imgBase+'home/kongtiao_bg.png'" mode="widthFix"></image>
 		<div class="nums">
-			<div class="pre">空调:<span class="mr">{{8}}</span></div>
-			<div class="pre">正常:<span class="zc">{{20}}</span></div>
-			<div class="pre">离线:<span class="lx">{{1}}</span></div>
+			<div class="pre">空调:<span class="mr">{{ktNum}}</span></div>
+			<div class="pre">正常:<span class="zc">{{zcNum}}</span></div>
+			<div class="pre">离线:<span class="lx">{{lxNum}}</span></div>
 		</div>
 		<div class="boxs" v-if="list.length">
-			<div class="box" v-for="(item,index) in list" :key="index" :class="bgcolorCfg[item.type]" @tap="showDetail(item)">
-				<image :src="imgCfg[item.type]" class="type" mode="widthFix"></image>
-				<div class="place">{{item.place}}</div>
-				<div class="position">{{item.position}}</div>
-				<div class="temperature" :class="{'off':item.status==2}">{{item.temperature}}℃</div>
+			<div class="box" v-for="(item,index) in list" :key="index" :style="{'background':modeCfg[item.attributeList[2].value].color}" @tap="showDetail(item,index)">
+				<image :src="modeCfg[item.attributeList[2].value].icon.split(';')[0]" class="type" mode="widthFix"></image>
+				<div class="place">{{item.installSite}}{{item.roomNumbers}}</div>
+				<div class="position">{{item.airConditionerName}}</div>
+				<div class="temperature" :class="{'off':item.opStatus==0}">{{item.attributeList[5].value}}℃</div>
 				<div class="text">温度</div>
-				<div class="btn" v-if="item.status==1">
+				<div class="btn" v-if="item.opStatus==1" @tap.stop="switchOpenClose(1,item.deviceId, index,item.attributeList[3].sensorAddress)">
 					<div class="circle"></div>
 					<text style="margin-left: 4rpx;">ON</text>
 				</div>
-				<div class="btn" v-else-if="item.status==2">
+				<div class="btn" v-else-if="item.opStatus==0" @tap.stop="switchOpenClose(0,item.deviceId, index,item.attributeList[3].sensorAddress)">
 					<text style="margin-right: 4rpx;">OFF</text>
 					<div class="circle off"></div>
 				</div>
@@ -33,8 +33,8 @@
 					<div class="left">
 						<image :src="imgBase+'home/kongtiao_kt.png'"></image>
 						<div class="addr">
-							<text>{{ktInfo.place}}</text>
-							<text class="ts">{{ktInfo.position}}</text>
+							<text>{{ktInfo.installSite}}{{ktInfo.roomNumbers}}</text>
+							<text class="ts">{{ktInfo.airConditionerName}}</text>
 						</div>
 					</div>
 					<div class="right" @tap="ktClose">
@@ -42,45 +42,37 @@
 					</div>
 				</div>
 				<template v-if="!setShow">
-					<image class="setting" :src="imgBase+'home/kongtiao_set.png'" @tap="setShow = true"></image>
+					<!-- <image class="setting" :src="imgBase+'home/kongtiao_set.png'" @tap="setShow = true"></image> -->
 					<div class="wendu">
-						<TemperatureControl :temperature="this.ktInfo.temperature" @changeTemperature="changeTemperature" ref="tcRef"></TemperatureControl>
+						<TemperatureControl :temperature="temperature" @changeTemperature="changeTemperature" ref="tcRef"></TemperatureControl>
 					</div>
-					<div class="type">
-						<div class="pre" :class="{'active':ktInfo.type==1}" @tap="changeType(1)">
-							<image :src="imgBase+'home/kongtiao_zl_bai.png'" v-if="ktInfo.type==1"></image>
-							<image :src="imgBase+'home/kongtiao_zl_hui.png'" v-else></image>
-							<text>制冷</text>
-						</div>
-						<div class="pre" :class="{'active':ktInfo.type==2}" @tap="changeType(2)">
-							<image :src="imgBase+'home/kongtiao_zr_bai.png'" v-if="ktInfo.type==2"></image>
-							<image :src="imgBase+'home/kongtiao_zr_hui.png'" v-else></image>
-							<text>制热</text>
-						</div>
-						<div class="pre" :class="{'active':ktInfo.type==3}" @tap="changeType(3)">
-							<image :src="imgBase+'home/kongtiao_cs_bai.png'" v-if="ktInfo.type==3"></image>
-							<image :src="imgBase+'home/kongtiao_cs_hui.png'" v-else></image>
-							<text>除湿</text>
-						</div>
-						<div class="pre" :class="{'active':ktInfo.type==4}" @tap="changeType(4)">
-							<image :src="imgBase+'home/kongtiao_sf_bai.png'" v-if="ktInfo.type==4"></image>
-							<image :src="imgBase+'home/kongtiao_sf_hui.png'" v-else></image>
-							<text>送风</text>
+					<div class="type" v-if="ktInfo.attributeList&&ktInfo.attributeList.length">
+						<div class="pre" v-for="item in modeList" :key="item.id" :style="{'width':'calc(100% / '+modeList.length+' - 20rpx)'}"
+							:class="{'active':temperature&&modeValue==item.dictValue}" @tap="changeType(item.dictValue)">
+							<image :src="item.icon.split(';')[2]" v-if="temperature&&modeValue==item.dictValue"></image>
+							<image :src="item.icon.split(';')[1]" v-else></image>
+							<text>{{item.dictLabel}}</text>
 						</div>
 					</div>
 					<div class="speend">
 						<text>风速</text>
 						<image class="jian" :src="imgBase+'home/kongtiao_jian.png'" @tap="changeWindSpeend(1)"></image>
-						<div class="area">
-							<div class="jd" :style="{'width':speend+'%'}"></div>
+						<div class="area" v-if="speendList.length">
+							<div class="pre" :class="{'active':temperature&&speendValue==item.dictValue}"
+								:style="{'width':'calc(100% / '+speendList.length+' - 3rpx)'}"
+								v-for="item in speendList" :key="item.id">
+								<div class="text" v-if="temperature&&speendValue==item.dictValue">{{item.dictLabel}}</div>
+							</div>
 						</div>
 						<image class="jia" :src="imgBase+'home/kongtiao_jia.png'" @tap="changeWindSpeend(2)"></image>
 					</div>
 					<div class="btns">
-						<div class="btn" :class="{'blue':wtype==1}" @tap="changeWindFx(1)">左右扫风</div>
-						<image :src="imgBase+'home/kongtiao_open1.png'" v-if="ktInfo.status==1" @tap="control(1)"></image>
-						<image :src="imgBase+'home/kongtiao_open2.png'" v-else-if="ktInfo.status==2" @tap="control(2)"></image>
-						<div class="btn" :class="{'blue':wtype==2}" @tap="changeWindFx(2)">上下扫风</div>
+						<!-- <div class="btn" :class="{'blue':wtype==1}" @tap="changeWindFx(1)">左右扫风</div> -->
+						<div></div>
+						<image :src="imgBase+'home/kongtiao_open1.png'" v-if="ktInfo.opStatus==1" @tap="control(1)"></image>
+						<image :src="imgBase+'home/kongtiao_open2.png'" v-else-if="ktInfo.opStatus==0" @tap="control(0)"></image>
+						<!-- <div class="btn" :class="{'blue':wtype==2}" @tap="changeWindFx(2)">上下扫风</div> -->
+						<div></div>
 					</div>
 				</template>
 				<template v-else>
@@ -137,95 +129,114 @@
 
 <script>
 	import TemperatureControl from '@/pagesHome/components/TemperatureControl/index.vue'
+	import pageEmpty from '@/components/pageEmpty/index.vue'
 	export default {
 		components:{
-			TemperatureControl
+			TemperatureControl,
+			pageEmpty
 		},
 		data(){
 			return {
-				imgCfg:{
-					1:this.$imgBase+'home/kongtiao_cold.png',
-					2:this.$imgBase+'home/kongtiao_sun.png',
-					3:this.$imgBase+'home/kongtiao_water.png',
-					4:this.$imgBase+'home/kongtiao_wind.png'
-				},
-				bgcolorCfg:{
-					1:'cold',
-					2:'hot',
-					3:'water',
-					4:'wind'
+				ktNum:0,
+				zcNum:0,
+				lxNum:0,
+				params:{
+					page:1,
+					limit:9999,
+					controlCategory:'CommonLighting'
 				},
-				list:[
-					{
-						place:'B#/13F1301',
-						position:'传秀-指挥中心东',
-						temperature:18,
-						status:1,//1开启 2关闭
-						type:1//1制冷 2制热 3除湿 4送风
-					},
-					{
-						place:'B#/13F1302',
-						position:'传秀-指挥中心南',
-						temperature:20.5,
-						status:2,//1开启 2关闭
-						type:3//1制冷 2制热 3除湿 4送风
-					},
-					{
-						place:'B#/13F1303',
-						position:'传秀-指挥中心西',
-						temperature:28,
-						status:1,//1开启 2关闭
-						type:4//1制冷 2制热 3除湿 4送风
-					},
-					{
-						place:'B#/13F1304',
-						position:'传秀-指挥中心北',
-						temperature:28,
-						status:1,//1开启 2关闭
-						type:2//1制冷 2制热 3除湿 4送风
-					}
-				],
+				modeList:[],
+				modeCfg:{},
+				modeValue:'',
+				speendList:[],
+				speendCfg:{},
+				speendValue:'',
+				ktStatus:'',
+				temperature:0,
+				list:[],
+				lIndex:'',
 				show:false,
 				setShow:false,
 				ktInfo:{},
-				speend:20,
 				wtype:1,
+				canClick:true
 			}
 		},
+		async onLoad() {
+			await this.getModeList();
+			await this.getSpeendList();
+			this.getList();
+		},
+		onPullDownRefresh() {
+			this.getList();
+		},
 		methods:{
-			showDetail(item){
+			async getModeList(){
+				let res = await this.$api.get('/sys/dict/data/getListByType/air_mode');
+				if(res.data.code===0){
+					this.modeList = res.data.data;
+					res.data.data.map(d=>this.modeCfg[d.dictValue]=d);
+				}else this.$showToast(res.data.msg)
+			},
+			async getSpeendList(){
+				let res = await this.$api.get('/sys/dict/data/getListByType/air_fan');
+				if(res.data.code===0){
+					this.speendList = res.data.data;
+					res.data.data.map(d=>this.speendCfg[d.dictValue]=d);
+				}else this.$showToast(res.data.msg)
+			},
+			getList(){
+				this.$api.get('/airconditioner/page',this.params).then(res=>{
+					if(res.data.code===0){
+						this.list = res.data.data.list;
+						this.ktNum = res.data.data.total;
+						this.zcNum = this.list.filter(l=>l.opStatus==1).length;
+						this.lxNum = this.list.filter(l=>l.opStatus==0).length;
+					}else this.$showToast(res.data.msg)
+				})
+			},
+			showDetail(item,index){
 				this.ktInfo = JSON.parse(JSON.stringify(item));
-				if(item.status==2){
-					this.speend = 0;
-					this.wtype = '';
-					this.ktInfo.type = '';
-				} 
+				this.ktStatus = item.opStatus;
+				this.modeValue = this.ktInfo.attributeList[2].value;
+				this.temperature = this.ktInfo.attributeList[5].value;
+				this.speendValue = this.ktInfo.attributeList[0].value;
+				this.lIndex = index;
+				
 				this.show = true;
-				this.$refs.tcRef.sjTemperature = item.temperature;
+				this.$refs.tcRef.status = this.ktStatus;
+				this.$refs.tcRef.sjTemperature = this.temperature;
 				this.$refs.tcRef.init();
 			},
 			changeType(type){
-				if(this.ktInfo.status==2) return
-				this.ktInfo.type = type;
+				if(this.ktInfo.opStatus==0) return
+				if(this.modeValue == type) return
+				this.modeValue = type;
+				this.updateAirConditioner(type,this.ktInfo.attributeList[2].sensorAddress)
 			},
 			changeWindSpeend(type){
-				if(this.ktInfo.status==2) return
-				if(type==1){
-					if(this.speend<=20) return
-					this.speend-=20;
-				}else if(type==2){
-					if(this.speend==100) return
-					this.speend+=20;
+				if(this.ktInfo.opStatus==0) return
+				let idx = this.speendList.findIndex(s=>s.dictValue==this.speendValue)
+				
+				if(idx>-1){
+					if(type==1){
+						if(idx==0) return
+						this.speendValue = this.speendList[idx-1].dictValue;
+					}else if(type==2){
+						if(idx==this.speendList.length-1) return
+						this.speendValue = this.speendList[idx+1].dictValue;
+					}
 				}
+				this.updateAirConditioner(this.speendValue,this.ktInfo.attributeList[0].sensorAddress)
 			},
-			changeWindFx(type){
-				if(this.ktInfo.status==2) return
-				this.wtype = type;
-			},
-			control(type){
-				this.show = false;
+			// changeWindFx(type){
+			// 	if(this.ktInfo.opStatus==0) return
+			// },
+			control(status){
+				this.openCloseAirConditioner(status,this.ktInfo.deviceId,this.lIndex,this.ktInfo.attributeList[3].sensorAddress);
 			},
 			ktClose(){
+				this.ktInfo = {};
 				this.setShow = false;
 				this.show = false;
 			},
@@ -233,7 +244,56 @@
 				this.setShow = false;
 			},
 			changeTemperature(temperature){
-				console.log(temperature,'temperature');
+				this.updateAirConditioner(temperature,this.ktInfo.attributeList[5].sensorAddress)
+			},
+			switchOpenClose(status,deviceId,index,identifier){
+				this.openCloseAirConditioner(status,deviceId,index,identifier);
+			},
+			openCloseAirConditioner(status,deviceId,index,identifier){
+				let msg = status?'关闭':'开启';
+				uni.showModal({
+					title:'温馨提示',
+					content:`是否确认【${msg}】此设备`,
+					success: (res) => {
+						if(res.confirm){
+							this.$api.post('/airconditioner/command',{
+								identifier,
+								action: 0,
+								value: status? 0 : 1,
+								deviceId,
+							}).then(resu=>{
+								if(resu.data.code===0){
+									this.show = false;
+									this.$showToast('操作成功');
+									setTimeout(()=>{
+										this.getList();
+									},3000)
+								}else this.$showToast(resu.data.msg)
+							})
+						}
+					}
+				})
+			},
+			updateAirConditioner(value, identifier){
+				if(!this.canClick) return
+				this.canClick = false;
+				this.$api.post('/airconditioner/command',{
+					action: 0,
+					identifier,
+					value,
+					deviceId:this.ktInfo.deviceId,
+				}).then(resu=>{
+					if(resu.data.code===0){
+						this.show = false;
+						this.$showToast('操作成功');
+						setTimeout(()=>{
+							this.getList();
+						},3000)
+					}else this.$showToast(resu.data.msg)
+					this.canClick = true;
+				}).catch(err=>{
+					this.canClick = true;
+				})
 			}
 		}
 	}
@@ -304,18 +364,6 @@
 				padding: 32rpx 21rpx 42rpx 29rpx;
 				box-sizing: border-box;
 				position: relative;
-				&.cold{
-					background: linear-gradient( 180deg, #D7EBFF 0%, #FFFFFF 100%);
-				}
-				&.hot{
-					background: linear-gradient( 180deg, #FFE7E4 0%, #FFFFFF 100%);
-				}
-				&.water{
-					background: linear-gradient( 180deg, #ECF2F7 0%, #FFFFFF 100%);
-				}
-				&.wind{
-					background: linear-gradient( 180deg, #ECF2F7 0%, #FFFFFF 100%);
-				}
 				
 				.type{
 					width: 164rpx;
@@ -452,7 +500,6 @@
 				justify-content: space-around;
 				margin-top: 20rpx;
 				.pre{
-					width: calc(25% - 20rpx);
 					margin: 0 10rpx;
 					padding: 36rpx 0;
 					display: flex;
@@ -507,17 +554,28 @@
 				.area{
 					width: calc(100% - 200rpx);
 					height: 20rpx;
-					background: #EDF4FF;
 					border-radius: 16rpx;
-					position: relative;
-					.jd{
-						height: 100%;
-						border-radius: 16rpx;
-						background: linear-gradient( 90deg, #3A8DFF 0%, #0BC6FF 100%);
-						box-shadow: 0rpx 4rpx 16rpx 4rpx #EFEFEF;
-						position: absolute;
-						left: 0;
-						top: 0;
+					display: flex;
+					justify-content: space-between;
+					.pre{
+						height: 20rpx;
+						background: #EDF4FF;
+						position: relative;
+						&.active{
+							background: linear-gradient( 90deg, #3A8DFF 0%, #0BC6FF 100%);
+							box-shadow: 0rpx 4rpx 16rpx 4rpx #EFEFEF;
+						}
+						.text{
+							width: 100%;
+							font-family: PingFangSC, PingFang SC;
+							font-weight: 400;
+							font-size: 24rpx;
+							color: #86909C;
+							line-height: 33rpx;
+							text-align: center;
+							position: absolute;
+							top: -33rpx;
+						}
 					}
 				}
 			}

+ 7 - 7
pagesHome/components/TemperatureControl/index.vue

@@ -40,6 +40,7 @@
 		},
 		data(){
 			return {
+				status:'',
 				sjTemperature:0,
 				tLength:0,
 				tGrap:0,
@@ -48,23 +49,22 @@
 		},
 		methods:{
 			init(){
+				this.tLength = (this.$props.maxT-this.$props.minT)*2+1;
+				this.tGrap = (240/(this.tLength-1)).toFixed(2);
 				if(this.sjTemperature<=this.$props.maxT&&this.sjTemperature>=this.$props.minT){
-					this.tLength = (this.$props.maxT-this.$props.minT)*2+1;
-					
-					this.tGrap = (240/(this.tLength-1)).toFixed(2);
-					
 					if(this.sjTemperature==this.$props.minT) this.tIdx = 0;
 					else if(this.sjTemperature==this.$props.maxT) this.tIdx = this.tLength-1;
 					else this.tIdx = (this.sjTemperature-this.$props.minT)/0.5
-				}
+				} 
 			},
 			changeTemperature(type){
+				if(this.status==0) return;
 				if(type==1){
 					if(this.sjTemperature==this.$props.minT) return
-					this.sjTemperature-=0.5
+					this.sjTemperature-=1
 				} else if(type==2){
 					if(this.sjTemperature==this.$props.maxT) return
-					this.sjTemperature+=0.5
+					this.sjTemperature+=1
 				}
 				this.init();
 				this.$emit('changeTemperature',this.sjTemperature)

+ 33 - 22
pagesHome/employee/detail.vue

@@ -11,32 +11,32 @@
 			<div class="item">
 				<div class="left">工号</div>
 				<div class="right">
-					<input type="text" v-model="userInfo.workno" placeholder="请输入工号">
+					<input type="text" v-model="userInfo.jobNumber" placeholder="请输入工号">
 				</div>
 			</div>
 			<div class="item">
 				<div class="left">身份证</div>
 				<div class="right">
-					<input type="text" v-model="userInfo.idcard" placeholder="请输入身份证">
+					<input type="text" v-model="userInfo.idCard" placeholder="请输入身份证">
 				</div>
 			</div>
 			<div class="item">
 				<div class="left">性别</div>
 				<div class="right" @tap="sexShow = true">
-					{{userInfo.sex==1?'男':(userInfo.sex==2?'女':'未知')}}
+					{{userInfo.gender==1?'男':(userInfo.gender==2?'女':'保密')}}
 					<u-icon name="arrow-right" color="#198CFF" size="32" style="margin-left: 10rpx;"></u-icon>
 				</div>
 			</div>
 			<div class="item">
 				<div class="left">手机号</div>
 				<div class="right">
-					<input type="text" v-model="userInfo.phone" placeholder="请输入手机号">
+					<input type="text" v-model="userInfo.mobile" placeholder="请输入手机号">
 				</div>
 			</div>
 			<div class="item">
 				<div class="left">职位</div>
 				<div class="right">
-					<input type="text" v-model="userInfo.worklevel" placeholder="请输入职位">
+					<input type="text" v-model="userInfo.postName" placeholder="请输入职位">
 				</div>
 			</div>
 			<div class="item">
@@ -54,7 +54,7 @@
 			<div class="item">
 				<div class="left">入职时间</div>
 				<div class="right" @tap="dateShow = true">
-					{{userInfo.workdate2}}
+					{{userInfo.entryDate}}
 					<u-icon name="arrow-right" color="#198CFF" size="32" style="margin-left: 10rpx;"></u-icon>
 				</div>
 			</div>
@@ -69,35 +69,46 @@
 	export default {
 		data(){
 			return {
-				userInfo:{
-					name:'梁惠美',
-					workno:'0103',
-					idcard:'341321 **** **** 9808',
-					sex:2,
-					phone:'18755113276',
-					worklevel:'总经理',
-					email:'9128377409@qq.com',
-					address:'合肥市蜀山区红皖家园1号楼',
-					workdate:'2022-09-02',
-					workdate2:'2022-09-02'
-				},
+				userInfo:{},
 				sexShow:false,
-				sexColumns:[[{id:1,name:'男'},{id:2,name:'女'}]],
+				sexColumns:[[{id:1,name:'男'},{id:2,name:'女'},{id:3,name:'保密'}]],
 				dateShow:false
 			}
 		},
+		onLoad(options) {
+			this.getDetail(options.id||'')
+		},
 		methods:{
+			getDetail(id){
+				this.$api.get('/staff/info/'+id).then(res=>{
+					if(res.data.code===0){
+						this.userInfo = res.data.data;
+						this.userInfo.workdate = new Date(this.userInfo.entryDate);
+					}else this.$showToast(res.data.msg)
+				})
+			},
 			sexConfirm(e){
-				this.userInfo.sex = e.value[0].id;
+				this.userInfo.gender = e.value[0].id;
 				this.sexShow = false;
 			},
 			dateConfirm(e){
 				this.userInfo.workdate = new Date(e.value);
-				this.userInfo.workdate2 = new Date(this.userInfo.workdate).Format('yyyy-MM-dd');
+				this.userInfo.entryDate = new Date(this.userInfo.workdate).Format('yyyy-MM-dd');
 				this.dateShow = false;
 			},
 			confirm(){
-				uni.navigateBack()
+				if(!this.$reg.idCard(this.userInfo.idCard)) return this.$showToast('请输入正确的身份证号')
+				if(!this.$reg.mobile(this.userInfo.mobile)) return this.$showToast('请输入正确的手机号')
+				if(!this.$reg.email(this.userInfo.email)) return this.$showToast('请输入正确的邮箱')
+				
+				this.$api.put('/staff/info',this.userInfo).then(res=>{
+					if(res.data.code===0){
+						this.$showToast('操作成功');
+						setTimeout(()=>{
+							uni.navigateBack();
+						},1500)
+					}else this.$showToast(res.data.msg)
+				})
 			}
 		}
 	}

+ 34 - 30
pagesHome/employee/index.vue

@@ -5,15 +5,15 @@
 			<div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
 				<div class="top">
 					<div class="left">
-						<text>{{item.name}}</text>
-						<image :src="imgBase+'home/staff_man.png'" v-if="item.sex==1"></image>
-						<image :src="imgBase+'home/staff_women.png'" v-else-if="item.sex==2"></image>
+						<text>{{item.name||''}}</text>
+						<image :src="imgBase+'home/staff_man.png'" v-if="item.gender==1"></image>
+						<image :src="imgBase+'home/staff_women.png'" v-else-if="item.gender==2"></image>
 					</div>
-					<div class="right">{{item.date}}入职</div>
+					<div class="right">{{item.entryDate||''}}入职</div>
 				</div>
 				<div class="bottom">
-					<div class="left">手机号:{{item.phone}}</div>
-					<div class="right">工号:{{item.workno}}</div>
+					<div class="left">手机号:{{item.mobile||''}}</div>
+					<div class="right">工号:{{item.jobNumber||''}}</div>
 				</div>
 			</div>
 		</div>
@@ -24,38 +24,42 @@
 </template>
 
 <script>
+	import pageEmpty from '@/components/pageEmpty/index.vue'
 	export default {
+		components:{
+			pageEmpty
+		},
 		data(){
 			return {
-				list:[
-					{
-						name:'梁惠美',
-						sex:1,
-						date:'2022-09-22',
-						phone:'18755223476',
-						workno:'0103'
-					},
-					{
-						name:'周佳玉',
-						sex:1,
-						date:'2023-09-22',
-						phone:'18755264476',
-						workno:'0123'
-					},
-					{
-						name:'魏琳琳',
-						sex:2,
-						date:'2024-09-22',
-						phone:'18935223476',
-						workno:'0243'
-					}
-				]
+				isOver:false,
+				params:{
+					page:1,
+					limit:10
+				},
+				list:[]
 			}
 		},
+		onReachBottom() {
+			if(this.isOver) return
+			this.getList();
+		},
+		onLoad() {
+			this.getList();
+		},
 		methods:{
+			getList(){
+				this.$api.get('/staff/info/page',this.params).then(res=>{
+					if(res.data.code===0){
+						if(this.list.length<res.data.data.total){
+							this.params.page++;
+							this.list = [...this.list,...res.data.data.list];
+						}else this.isOver = true
+					}else this.$showModal(res.data.msg)
+				});
+			},
 			toDetail(item){
 				uni.navigateTo({
-					url:'/pagesHome/employee/detail'
+					url:'/pagesHome/employee/detail?id='+item.id
 				})
 			}
 		}

+ 4 - 0
pagesHome/energyMeter/index.vue

@@ -27,7 +27,11 @@
 </template>
 
 <script>
+	import pageEmpty from '@/components/pageEmpty/index.vue'
 	export default {
+		components:{
+			pageEmpty
+		},
 		data(){
 			return {
 				list:[

+ 4 - 0
pagesHome/entranceGuard/index.vue

@@ -25,7 +25,11 @@
 </template>
 
 <script>
+	import pageEmpty from '@/components/pageEmpty/index.vue'
 	export default {
+		components:{
+			pageEmpty
+		},
 		data(){
 			return {
 				list:[

+ 4 - 0
pagesHome/video/index.vue

@@ -30,7 +30,11 @@
 </template>
 
 <script>
+	import pageEmpty from '@/components/pageEmpty/index.vue'
 	export default {
+		components:{
+			pageEmpty
+		},
 		data(){
 			return {
 				list:[

+ 2 - 2
pagesStorage/components/pageEmpty/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="page-empty" :style="{'height':height,'margin-top':marginTop}">
-		<u-empty text="暂无数据" textSize="26rpx" width="332rpx" height="332rpx" mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png"></u-empty>
+		<u-empty text="暂无数据" textSize="26rpx" width="332rpx" height="332rpx" mode="order" :icon="imgBase+'img_empty.jpg'"></u-empty>
 	</div>
 </template>
 
@@ -18,7 +18,7 @@
 		},
 		data(){
 			return {
-				
+				imgBase:this.$imgBase
 			}
 		},
 		methods:{