zhangyun hace 4 años
padre
commit
1bf79cf984

+ 2 - 2
components/uni-nav-bar/uni-nav-bar.vue

@@ -116,7 +116,7 @@
 	$nav-height: 44px;
 	.uni-nav-bar-text {
 		/* #ifdef APP-PLUS */
-		font-size: 34rpx;
+		font-size: 16px;
 		/* #endif */
 		/* #ifndef APP-PLUS */
 		font-size: $uni-font-size-lg;
@@ -127,7 +127,7 @@
 	}
 
 	.uni-navbar {
-		width: 750rpx;
+		width: 100%;
 	}
 
 	.uni-navbar__content {

+ 61 - 22
pages.json

@@ -4,6 +4,16 @@
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+		    "path" : "pages/login/login",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "",
+		        "enablePullDownRefresh": false,
+				"navigationStyle":"custom"
+		    }
+		    
+		},
+		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "首页"
@@ -77,16 +87,6 @@
             
         }
         ,{
-            "path" : "pages/login/login",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false,
-				"navigationStyle":"custom"
-            }
-            
-        }
-        ,{
             "path" : "pages/cb/cbd/equip-set/equip-set",
             "style" :                                                                                    
             {
@@ -271,6 +271,45 @@
             }
             
         }
+        ,{
+            "path" : "pages/equipList/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false,
+				"navigationStyle":"custom"	
+            }
+            
+        }
+        ,{
+            "path" : "pages/equipList/search",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false,
+				"navigationStyle":"custom"
+            }
+            
+        }
+        ,{
+            "path" : "pages/equipList/modification",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false,
+				"navigationStyle":"custom"
+            }
+            
+        }
+        ,{
+            "path" : "pages/distribution/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"condition": { //模式配置,仅开发期间生效
 	    "current": 3, //当前激活的模式(list 的索引项)
@@ -306,18 +345,18 @@
 				"selectedIconPath":"static/image/index/12.png",
 	            "text": "首页"
 	        },
-	        // {
-	        //     "pagePath": "pages/afterSale/index",
-	        //     "iconPath":"static/image/index/14.png",
-	        //     "selectedIconPath":"static/image/index/15.png",
-	        //     "text": "设备列表"
-	        // },
-	        // {
-	        //     "pagePath": "pages/equipMange/index/index",
-	        //     "iconPath":"static/image/index/16.png",
-	        //     "selectedIconPath":"static/image/index/17.png",
-	        //     "text": "设备分布"
-	        // },
+	        {
+	            "pagePath": "pages/equipList/index",
+	            "iconPath":"static/image/index/14.png",
+	            "selectedIconPath":"static/image/index/15.png",
+	            "text": "设备列表"
+	        },
+	        {
+	            "pagePath": "pages/distribution/index",
+	            "iconPath":"static/image/index/16.png",
+	            "selectedIconPath":"static/image/index/17.png",
+	            "text": "设备分布"
+	        },
 	        {
 	            "pagePath": "pages/my/index/index",
 	            "iconPath":"static/image/index/18.png",

+ 1 - 1
pages/afterSale/index.vue

@@ -152,7 +152,7 @@
 		width: 100%;
 		height: 154rpx;
 		position: fixed;
-		top: 88rpx;
+		top: 44px;
 		z-index: 100;
 	}
 

+ 23 - 0
pages/distribution/index.vue

@@ -0,0 +1,23 @@
+<template>
+	<view>
+		<map :latitude="latitude" :longitude="longitude" style="width: 100%;height: 85vh;"></map>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				latitude: 39.909,
+				longitude: 116.39742,
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 190 - 0
pages/equipList/index.vue

@@ -0,0 +1,190 @@
+<template>
+	<view>
+		<view style="position: fixed;z-index: 100;width: 100%;">
+			<uni-nav-bar right-icon="search" title="设备列表" @clickRight="clickRight"></uni-nav-bar>
+		</view>
+		<view class="utabs">
+			<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" item-width="140" font-size="24" gutter="20"
+			 bar-width="60" active-color="#42b983"></u-tabs>
+		</view>
+		<view class="list">
+			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index">
+				<view class="list_item_top">
+					<p class="p1">
+						<image :src="images[current].path" mode=""></image>
+						{{item.device_name}}
+					</p>
+					<p :class="[item.device_status?'p2':'p_out']">{{item.device_status?"在线":"离线"}}</p>
+				</view>
+				<view class="list_item_text">
+					<p>设备ID:{{item.device_id}}</p>
+					<p>适配用户:无</p>
+					<p>添加设备时间:{{item.status_time|timeFormat()}}</p>
+				</view>
+				<view class="list_item_btn" @click="modification(item)">
+					修改名称
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				list: [{
+					name: "杀虫灯"
+				}, {
+					name: "测报灯"
+				}, {
+					name: "智能性诱"
+				}, {
+					name: "环境检测"
+				}, {
+					name: "监控设备"
+				}, {
+					name: "孢子仪"
+				}],
+				current: 0,
+				page:1,
+				size:10,
+				images: [{
+						path: "../../static/image/fourMoodBase/杀虫灯.png",
+						id: 2
+					},
+					{
+						path: "../../static/image/fourMoodBase/测报灯.png",
+						id: 3
+					}, {
+						path: "../../static/image/fourMoodBase/性诱测报.png",
+						id: 4
+					}, {
+						path: "../../static/image/fourMoodBase/环境监测.png",
+						id: 5
+					}, {
+						path: "../../static/image/fourMoodBase/监控.png",
+						id: 6
+					}, {
+						path: "../../static/image/fourMoodBase/孢子仪.png",
+						id: 7
+					}
+				],
+				eqlistdata:[]
+			}
+		},
+		methods: {
+			async eqlist() { //设备列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: this.current+2,
+						page:this.page,
+						size:this.size,
+					}
+				})
+				this.eqlistdata=this.eqlistdata.concat(res.data) 
+				console.log(this.eqlistdata)
+			},
+			change(index) { //头部导航栏的点击
+				console.log(index)
+				this.page=1
+				this.eqlistdata=[]
+				this.current = index
+				this.eqlist()
+			},
+			clickRight(){//搜索
+				uni.navigateTo({
+					url:"./search"
+				})
+			},
+			modification(item){
+				uni.navigateTo({
+					url:"./modification?data="+JSON.stringify(item)
+				})
+			}
+		},
+		onLoad(){
+			this.eqlist()
+		},
+		onReachBottom() {
+			this.page++
+			this.eqlist()
+		}
+	}
+</script>
+<style lang="scss">
+	.utabs {
+		width: 95%;
+		position: fixed;
+		top: 44px;
+		z-index: 100;
+	}
+	.list{
+		width: 100%;
+		background-color: #FDFDFD;
+		position: absolute;
+		top: 180rpx;
+		margin-bottom: 100rpx;
+		.list_item{
+			width: 95%;
+			margin: 20rpx auto;
+			padding: 10rpx 20rpx;
+			position: relative;
+			background-color: #FFFFFF;
+			.list_item_top{
+				display: flex;
+				justify-content: space-between;
+				.p1{
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					image{
+						width: 40rpx;
+						height: 40rpx;
+						vertical-align:text-top;
+						margin-right: 20rpx;
+					}
+				}
+				.p2{
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: #42b983;
+				}
+				.p_out{
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: red;
+				}
+			}
+			.list_item_text{
+				margin-top: 20rpx;
+				p{
+					font-size: 24rpx;
+					color: #636363;
+					margin-top: 10rpx;
+				}
+				p:first-child{
+					font-size: 28rpx;
+					font-weight: 700;
+				}
+			}
+			.list_item_btn{
+				width: 126rpx;
+				color: #42b983;
+				height: 40rpx;
+				text-align: center;
+				border: 1rpx solid #42b983;
+				border-radius: 25rpx;
+				font-size: 24rpx;
+				line-height: 35rpx;
+				position: absolute;
+				top: 136rpx;
+				right: 20rpx;
+			}
+		}
+	}
+</style>
+

+ 95 - 0
pages/equipList/modification.vue

@@ -0,0 +1,95 @@
+<template>
+	<view>
+		<view style="position: fixed;z-index: 100;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="修改名称"></uni-nav-bar>
+		</view>
+		<view class="mod">
+			<view class="mod_name">
+				<p>设备名称</p>
+				<input type="text" v-model="moddata.device_name" style="background-color: #FAFAFA;"/>
+			</view>
+			<view class="mod_id">
+				<p>设备ID</p>
+				<input type="text" :value="moddata.device_id" disabled/>
+			</view>
+			<view class="mod_user">
+				<p>适配用户</p>
+				<input type="text" value="无" disabled/>
+			</view>
+			<view class="mod_time">
+				<p>设备添加时间</p>
+				<input type="text" :value="moddata.status_time|timeFormat()" disabled />
+			</view>
+			<view class="sub" @click="btn">
+				提 交
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				moddata:[]
+			}
+		},
+		methods: {
+			async eqlist() { //设备列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
+					data: {
+						device_id: this.moddata.device_id,
+						device_name:this.moddata.device_name
+					}
+				})
+			},
+			btn(){
+				this.eqlist()
+			},
+			clickLeft(){
+				uni.switchTab({
+					url:"./index"
+				})
+			}
+		},
+		onLoad(option){
+			this.moddata=JSON.parse(option.data)
+			console.log(this.moddata)
+		}
+	}
+</script>
+
+<style lang="scss">
+.mod{
+	width: 100%;
+	position: absolute;
+	top: 44px;
+	height: 92vh;
+	background-color: #FAFAFA;
+	.mod_name,.mod_id,.mod_user,.mod_time{
+		width: 90%;
+		margin: 30rpx auto;
+		display: flex;
+		justify-content: space-between;
+		background-color: #FFFFFF;
+		padding: 30rpx 10rpx;
+		color: #57C77A;
+		input{
+			text-align: right;
+			font-size: 28rpx;
+			padding: 10rpx;
+		}
+	}
+}
+.sub{
+	width: 90%;
+	margin: 30rpx auto;
+	text-align: center;
+	height: 70rpx;
+	line-height: 70rpx;
+	background-color: #57C77A;
+	border-radius: 35rpx;
+	color: #FFFFFF;
+}
+</style>

+ 256 - 0
pages/equipList/search.vue

@@ -0,0 +1,256 @@
+<template>
+	<view>
+		<view style="position: fixed;z-index: 100;height: 160rpx;background-color: #FFFFFF;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" style="margin-top: 36rpx;"></uni-nav-bar>
+			<view class="">
+				<view class="search_top_input">
+					<input type="text" v-model="value" placeholder="请选择设备类型" disabled @click="show = true"/>
+					<u-icon name="arrow-down-fill" size="20" class="icon" @click="show = true"></u-icon>
+					<u-action-sheet :list="options1" v-model="show" @click="actionSheetCallback"></u-action-sheet>
+				</view>
+				<view class="search_bot_input">
+					<input type="text" value="" placeholder="请输入设备ID" v-model="imports" />
+					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="list">
+			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index">
+				<view class="list_item_top">
+					<p class="p1">
+						<image :src="images[current].path" mode=""></image>
+						{{item.device_name}}
+					</p>
+					<p :class="[item.device_status?'p2':'p_out']">{{item.device_status?"在线":"离线"}}</p>
+				</view>
+				<view class="list_item_text">
+					<p>设备ID:{{item.device_id}}</p>
+					<p>适配用户:无</p>
+					<p>添加设备时间:{{item.status_time|timeFormat()}}</p>
+				</view>
+				<view class="list_item_btn">
+					修改名称
+				</view>
+			</view>
+			<view class="none" v-if="eqlistdatatf">
+				暂无数据
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				options1: [{
+						text: '杀虫灯',
+					},
+					{
+						text: '测报灯',
+					},
+					{
+						text: '智能性诱',
+					},
+					{
+						text: '环境检测',
+					},
+					{
+						text: '监控设备',
+					},
+					{
+						text: '孢子仪',
+					},
+				],
+				imports: '',
+				eqlistdata: [],
+				current: 0,
+				images: [{
+						path: "../../static/image/fourMoodBase/杀虫灯.png",
+						id: 2
+					},
+					{
+						path: "../../static/image/fourMoodBase/测报灯.png",
+						id: 3
+					}, {
+						path: "../../static/image/fourMoodBase/性诱测报.png",
+						id: 4
+					}, {
+						path: "../../static/image/fourMoodBase/环境监测.png",
+						id: 5
+					}, {
+						path: "../../static/image/fourMoodBase/监控.png",
+						id: 6
+					}, {
+						path: "../../static/image/fourMoodBase/孢子仪.png",
+						id: 7
+					}
+				],
+				eqlistdatatf: false,//暂无数据
+				show: false,//选择框
+				value:'',//选择框值
+				indexs:2//设备id
+			}
+		},
+		methods: {
+			async eqlist() { //设备列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: this.indexs,
+						device_id: this.imports
+					}
+				})
+				this.eqlistdata = res.data
+				if (this.eqlistdata.length == 0) {
+					this.eqlistdatatf = true
+				} else {
+					this.eqlistdatatf = false
+				}
+			},
+			clickLeft() {//返回
+				uni.switchTab({
+					url: "./index"
+				})
+			},
+			search() {//搜索
+				this.eqlist()
+			},
+			actionSheetCallback(index) {//选择框
+				this.value = this.options1[index].text;
+				this.indexs = index+2
+			}
+		}
+	}
+</script>
+<style lang="scss">
+	.search_top_input {
+		width: 80%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		position: absolute;
+		top: 18rpx;
+		right: 18rpx;
+		padding-top: 8rpx;
+
+		input {
+			width: 85%;
+			text-indent: 1rem;
+			font-size: 26rpx;
+		}
+
+		.icon {
+			position: absolute;
+			top: 18rpx;
+			right: 32rpx;
+		}
+	}
+
+	.search_bot_input {
+		width: 80%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		position: absolute;
+		top: 44px;
+		right: 18rpx;
+		padding-top: 8rpx;
+
+		input {
+			width: 85%;
+			text-indent: 1rem;
+			font-size: 26rpx;
+		}
+
+		.icon {
+			position: absolute;
+			top: 8rpx;
+			right: 26rpx;
+		}
+	}
+
+	.list {
+		width: 100%;
+		background-color: #FDFDFD;
+		position: absolute;
+		top: 160rpx;
+
+		.list_item {
+			width: 95%;
+			margin: 20rpx auto;
+			padding: 10rpx 20rpx;
+			position: relative;
+			background-color: #FFFFFF;
+
+			.list_item_top {
+				display: flex;
+				justify-content: space-between;
+
+				.p1 {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+
+					image {
+						width: 40rpx;
+						height: 40rpx;
+						vertical-align: text-top;
+						margin-right: 20rpx;
+					}
+				}
+
+				.p2 {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: #42b983;
+				}
+
+				.p_out {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: red;
+				}
+			}
+
+			.list_item_text {
+				margin-top: 20rpx;
+
+				p {
+					font-size: 24rpx;
+					color: #636363;
+					margin-top: 10rpx;
+				}
+
+				p:first-child {
+					font-size: 28rpx;
+					font-weight: 700;
+				}
+			}
+
+			.list_item_btn {
+				width: 126rpx;
+				color: #42b983;
+				height: 40rpx;
+				text-align: center;
+				border: 1rpx solid #42b983;
+				border-radius: 25rpx;
+				font-size: 24rpx;
+				line-height: 35rpx;
+				position: absolute;
+				top: 136rpx;
+				right: 20rpx;
+			}
+		}
+
+		.none {
+			width: 100%;
+			height: 100rpx;
+			line-height: 100rpx;
+			font-size: 32rpx;
+			text-align: center;
+		}
+	}
+</style>

+ 1 - 1
pages/equipMange/index/addusers.vue

@@ -230,7 +230,7 @@
 		justify-content: center;
 
 		.uForm {
-			margin-top: 88rpx;
+			margin-top: 44px;
 			width: 90%;
 
 			.uFormbg {

+ 9 - 8
pages/equipMange/index/assignment.vue

@@ -1,11 +1,13 @@
 <template>
 	<view>
-		<view style="position: fixed;z-index: 100;top: 0;">
+		<view style="position: fixed;z-index: 100;top: 0;width: 100%;">
 			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="设备分配"></uni-nav-bar>
 		</view>
 		<view class="utabs">
-			<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" item-width="140" font-size="24" gutter="20"
-			 bar-width="60" active-color="#42b983"></u-tabs>
+			<view style="width: 95%;margin: 0 auto;">
+				<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" item-width="140" font-size="24" gutter="20"
+				 bar-width="60" active-color="#42b983"></u-tabs>
+			</view>
 		</view>
 		<view class="ass_list">
 			<checkbox-group class="che_group" @change="checkboxchange">
@@ -211,7 +213,7 @@
 			cancel() { //取消分配
 				uni.navigateTo({
 					url: './useroperation?item=' + JSON.stringify(this.user_info)
-				})
+				}) 
 			},
 
 		},
@@ -228,10 +230,9 @@
 
 <style lang="scss">
 	.utabs {
-		width: 95%;
+		width: 100%;
 		position: fixed;
-		top: 90rpx;
-		left: 2.5%;
+		top: 44px;
 		z-index: 100;
 	}
 
@@ -262,7 +263,7 @@
 				}
 
 				.equipment_top_name {
-					font-size: 12rpx;
+					font-size: 24rpx;
 					margin-left: 60rpx;
 				}
 

+ 1 - 1
pages/equipMange/index/changepasswold.vue

@@ -115,7 +115,7 @@
 	.uForm {
 		width: 100%;
 		position: relative;
-		top: 90rpx;
+		top: 44px;
 
 		.uFormbg {
 			width: 90%;

+ 1 - 1
pages/equipMange/index/index.vue

@@ -105,7 +105,7 @@
 <style lang="scss">
 	.uinput-box {
 		position: fixed;
-		top: 89rpx;
+		top: 44px;
 		z-index: 100;
 		background-color: white;
 		width: 100%;

+ 1 - 1
pages/equipMange/index/useroperation.vue

@@ -268,7 +268,7 @@
 		justify-content: center;
 
 		.uForm {
-			margin-top: 88rpx;
+			margin-top: 44px;
 			width: 95%;
 
 			.uFormbg {

+ 10 - 7
pages/login/login.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view style="height: 100vh;">
 		<view class="logo">
 			<image src="../../static/image/login/8eef2e54055a5b072a5dc000919a7ae.png" mode=""></image>
 		</view>
@@ -17,9 +17,9 @@
 				</view>
 				<view class="aboutpass">
 					<p>忘记密码?</p>
-					<u-radio-group>
-						<u-checkbox v-model="checked"  :label-disabled="true" size="22">记住密码</u-checkbox>
-					</u-radio-group>
+					<u-checkbox-group>
+						<u-checkbox v-model="checked"  :label-disabled="false" size="22">记住密码</u-checkbox>
+					</u-checkbox-group>
 				</view>
 				<view class="uni-btn-v">
 					<button form-type="submit">登 录</button>
@@ -88,9 +88,9 @@
 		width: 100%;
 		position: absolute;
 		bottom: 0;
-
+		z-index: -1;
 		image {
-			width: 100%;
+			width: 100%; 
 		}
 	}
 	.uni-form-item {
@@ -121,13 +121,16 @@
 				color: #C0C0C0;
 			}
 			/deep/.u-checkbox__label{
-				font-size: 14rpx;
+				font-size: 28rpx;
 				color: #C0C0C0;
+				margin-right: 0;
 			}
 		}
 		.uni-btn-v{
 			width: 80%;
 			margin: 112rpx auto 0;
+			position: relative;
+			z-index: 100;
 			button{
 				width: 100%;
 				height: 72rpx;

+ 2 - 2
pages/my/index/index.vue

@@ -114,7 +114,7 @@
 			this.getUserlogin()
 			setTimeout(() => {
 				this.getUsermsg(this.usernames)
-			}, 100)
+			}, 200)
 
 		}
 	}
@@ -122,7 +122,7 @@
 <style lang="scss">
 	.subject {
 		width: 100%;
-		height: 100vh;
+		height: 93vh;
 		background-color: #F9F9F9;
 	}