zhangyun 4 lat temu
rodzic
commit
356d046da9

+ 22 - 5
pages/afterSale/index.vue

@@ -9,7 +9,10 @@
 			<u-icon name="plus" class="sp_icon" @click="addf"></u-icon>
 		</view>
 		<image src="../../static/image/afterSale/dcd7147f4b15d00c5c90006738b8453.png" class="expertimages"></image>
-		<view class="aftersale">
+		<view class="aftersaleTF" v-if="aftersaleTF">
+			暂无数据
+		</view>
+		<view class="aftersale" v-else>
 			<view class="aftersale_item" v-for="(item,index) in faultdata" :key="index">
 				<view class="aftersale_item_title">
 					<u-icon name="calendar" color="#71D8AF" size="34"></u-icon>
@@ -75,7 +78,8 @@
 				faultvideo_tf:false,//故障视频显示
 				faultimg: [],//故障图片
 				faultimg_tf: false,//故障图片显示
-				page:1
+				page:1,
+				aftersaleTF:true
 			}
 		},
 		methods: {
@@ -86,6 +90,11 @@
 						page:this.page
 					}
 				})
+				if(res.counts == 0){
+					this.aftersaleTF = true
+				}else{
+					this.aftersaleTF = false
+				}
 				this.faultdata =this.faultdata.concat(res.data)
 				for (var i = 0; i < this.faultdata.length; i++) {
 					this.faultdata[i].errorimg = JSON.parse(this.faultdata[i].errorimg)
@@ -93,7 +102,7 @@
 						this.faultdata[i].errorimg = []
 					}
 				}
-				console.log(res.data)
+				console.log(res)
 			}, 
 			fault(info) { //查看故障信息
 				this.title="故障信息"
@@ -118,7 +127,7 @@
 				this.faultvideo_tf=false
 			},
 			faultVideo(info) { //查看故障视频
-				this.title="故障视频"
+				this.title="故障视频" 
 				if(info.indexOf("[")!=-1){
 					this.faultvideo=JSON.parse(info)[0]
 				}else{
@@ -186,7 +195,15 @@
 			margin-left: 16rpx;
 		}
 	}
-
+	
+	.aftersaleTF{
+		width: 100%;
+		position: relative;
+		top: 340rpx;
+		text-align: center;
+		padding-top: 40rpx;
+		font-size: 20px;
+	}
 	.aftersale {
 		width: 100%;
 		// margin-top: 20rpx;

+ 1 - 1
pages/cb/cbd/equip-set/historyfile.vue

@@ -207,7 +207,7 @@
 				var now = new Date()
 				this.$forceUpdate()
 				if (index == 0) {
-					this.start_time = strrttime
+					this.start_time = this.end_time - 24 * 60 * 60 * 1000
 					this.history()
 					this.historylist()
 				} else if (index == 1) {

+ 33 - 18
pages/cb/equip-detail/equip-detail.vue

@@ -67,7 +67,10 @@
 		<view class="tit">
 			实时数据
 		</view>
-		<view class="newState">
+		<view class="newtishi" v-if="!newtishitf">
+			暂无数据
+		</view>
+		<view class="newState" v-else>
 			<view class="item" v-for="item in curState">
 				<image :src="item.icon" mode="widthFix"></image>
 				<view class="info-con">
@@ -157,7 +160,8 @@
 				culErr: '',
 				yxShow: false, //诱芯弹框
 				xyErr: '',
-				decoy: ''
+				decoy: '',
+				newtishitf:false
 			}
 		},
 		computed: {
@@ -193,22 +197,22 @@
 						return [{
 								icon: '/static/image/cb/icon02.png',
 								txt: '在线状态',
-								value: this.equipInfo.is_online == 1 ? '在线' : '离线',
+								value: Number(this.device_status) == 1 ? '在线' : '离线',
 							},
 							{
 								icon: '/static/image/cb/icon05.png',
 								txt: '开关状态',
-								value: this.newState.ds == 1 ? '关机' : '开机'
+								value: Number(this.newState.ds) == 1 ? '开机' : '关机'
 							},
 							{
 								icon: '/static/image/cb/icon13.png',
 								txt: '通道状态',
-								value: this.newState.upds == 1 ? '落虫' : '排水'
+								value: Number(this.newState.upds) == 1 ? '落虫' : '排水'
 							},
 							{
 								icon: '/static/image/cb/icon10.png',
 								txt: '加热状态',
-								value: this.newState.hs == 1 ? '加热' : '正常'
+								value: Number(this.newState.hs) == 1 ? '加热' : '正常'
 							}, {
 								icon: '/static/image/cb/icon08.png',
 								txt: '环境温度(℃)',
@@ -229,15 +233,15 @@
 							{
 								icon: '/static/image/cb/icon17.png',
 								txt: '雨控状态',
-								value: this.newState.rps == 1 ? "雨控" : '正常'
+								value: Number(this.newState.rps) == 1 ? "雨控" : '正常'
 							}, {
 								icon: '/static/image/cb/icon14.png',
 								txt: '温控状态',
-								value: this.newState.tps == 1 ? "温控" : '正常'
+								value: Number(this.newState.tps) == 1 ? "温控" : '正常'
 							}, {
 								icon: '/static/image/cb/icon06.png',
 								txt: '光控状态',
-								value: this.newState.lps == 1 ? "光控" : '正常'
+								value: Number(this.newState.lps) == 1 ? "光控" : '正常'
 							}, {
 								icon: '/static/image/cb/icon01.png',
 								txt: '灯管状态',
@@ -245,23 +249,23 @@
 							}, {
 								icon: '/static/image/cb/icon11.png',
 								txt: '上仓门',
-								value: this.newState.upds == 1 ? "打开" : '关闭'
+								value: Number(this.newState.upds) == 1 ? "打开" : '关闭'
 							}, {
 								icon: '/static/image/cb/icon15.png',
 								txt: '下仓门',
-								value: this.newState.dnds == 1 ? "打开" : '关闭'
+								value: Number(this.newState.dnds) == 1 ? "打开" : '关闭'
 							}
 						]
 					case 7:
 						return [{
 								icon: '/static/image/cb/icon02.png',
 								txt: '在线状态',
-								value: this.device_status == 1 ? '在线' : '离线',
+								value: Number(this.device_status) == 1 ? '在线' : '离线',
 							},
 							{
 								icon: '/static/image/cb/icon05.png',
 								txt: '设备开关',
-								value: this.newState.on_off == 1 ? '开启' : '关闭'
+								value: Number(this.newState.ds) == 1 ? '开启' : '关闭'
 							},
 							{
 								icon: '/static/image/cb/bzy/3.png',
@@ -314,7 +318,7 @@
 						return [{
 								icon: '/static/image/cb/icon02.png',
 								txt: '在线状态',
-								value: this.device_status == 1 ? '在线' : '离线',
+								value: Number(this.device_status) == 1 ? '在线' : '离线',
 							},
 							{
 								icon: '/static/image/cb/icon05.png',
@@ -359,7 +363,7 @@
 							{
 								icon: '/static/image/cb/xy/9.png',
 								txt: '充电状态',
-								value: this.newState.cs == 1 ? '充电' : '正常'
+								value: Number(this.newState.cs) == 1 ? '充电' : '正常'
 							},
 							{
 								icon: '/static/image/cb//xy/10.png',
@@ -404,7 +408,7 @@
 		onLoad(option) {
 			this.equipInfo = JSON.parse(option.info)
 			this.type = Number(this.equipInfo.type)
-			this.device_status = this.equipInfo.device_status
+			this.device_status = this.equipInfo.is_online
 			this.getState()
 			console.log(this.equipInfo)
 			this.selectaddress(this.lat,this.lng)
@@ -420,7 +424,12 @@
 						page_size: 1,
 					}
 				})
-				this.newState = res.data[0].d_h_t
+				if(res.counts!=0){
+					this.newState = res.data[0].d_h_t
+					this.newtishitf = true
+				}else{
+					this.newtishitf = false
+				}
 			},
 			partClick(path) {
 				uni.navigateTo({
@@ -578,7 +587,13 @@
 			font-size: 30rpx;
 			margin-bottom: 20rpx;
 		}
-
+		.newtishi{
+			width: 90%;
+			margin: 0 auto;
+			text-align: center;
+			padding-top: 40rpx;
+			font-size: 32rpx;
+		}
 		.newState {
 			display: flex;
 			flex-wrap: wrap;

+ 121 - 3
pages/login/login.vue

@@ -1,9 +1,12 @@
 <template>
 	<view style="height: 100vh;">
 		<view class="status_bar"></view>
-		<view class="logo">
+		<view class="logo" @longpress="logoTime">
 			<image src="../../static/image/login/8eef2e54055a5b072a5dc000919a7ae.png" mode=""></image>
 		</view>
+		<view class="set" @click="set" v-if="setTF">
+			<u-icon name="setting-fill" size="40" color="#72CD9C"></u-icon>
+		</view>
 		<form @submit="formSubmit">
 			<view class="uni-form-item uni-column">
 				<view class="username">
@@ -29,6 +32,26 @@
 		<view class="bg">
 			<image src="../../static/image/login/850c9307f4ef2d7dc6db1049711ab55.jpg" mode=""></image>
 		</view>
+		<view class="setbg" v-if="setbgtf" >
+			<view class="mengban" @click.stop="setbgtf = !setbgtf"></view>
+			<view class="set_http">
+				<view class="set_http_top">
+					<u-icon name="close" size="40" @click="setbgtf = !setbgtf"></u-icon>
+					<p>设置服务器地址</p>
+					<u-icon name="checkbox-mark" size="40" @click="sethttp"></u-icon>
+				</view>
+				<view class="set_http_bot">
+					<p>服务器访问地址</p>
+					<view class="set_http_bot_input">
+						<input type="text" v-model="value" placeholder="请在此处输入服务器地址(http://...)"/>
+						<u-icon :name="arrowtf?'arrow-up':'arrow-down'" @click="arrow"></u-icon>
+					</view>
+					<scroll-view  scroll-y="true" class="scroll-Y" v-if="arrowtf">
+					    <view :id="'demo'+index" class="scroll-view-item uni-bg-red" v-for="item,index in httparr" :key="index" @click="value = item">{{item}}</view>
+					</scroll-view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -40,7 +63,12 @@
 				formdata: {
 					username: '',
 					passwold: ''
-				}
+				},
+				setbgtf:false,
+				setTF:false,
+				value:"http://8.136.98.49:8002",
+				httparr:["http://8.136.98.49:8002","http://182.92.193.64:8002"],
+				arrowtf:false
 			}
 		},
 		onLoad() {
@@ -61,6 +89,12 @@
 					this.formdata.username = res.data
 				}
 			})
+			uni.getStorage({
+				key: 'http',
+				success: (res) => {
+					this.value = res.data
+				}
+			})
 		},
 		onShow(){
 			uni.getStorage({
@@ -124,6 +158,25 @@
 						console.log('success');
 					}
 				})
+			},
+			logoTime(){
+				this.setTF = true
+			},
+			set(){
+				this.setbgtf = true
+			},
+			sethttp(){
+				uni.setStorage({
+				    key: 'http',
+				    data: this.value,
+				    success: function () {
+				        console.log('success');
+				    }
+				});
+				this.setbgtf = false
+			},
+			arrow(){
+				this.arrowtf = !this.arrowtf
 			}
 		}
 	}
@@ -143,7 +196,11 @@
 			height: 120rpx;
 		}
 	}
-
+	.set{
+		position: absolute;
+		right: 50rpx;
+		top: 100rpx;
+	}
 	.bg {
 		width: 100%;
 		position: fixed;
@@ -213,4 +270,65 @@
 			}
 		}
 	}
+	.setbg{
+		width: 100%;
+		height: 100vh;
+		position: absolute;
+		top: 0;
+		z-index: 99999;
+		.mengban{
+			width: 100%;
+			height: 100vh;
+			position: absolute;
+			top: 0;
+			background-color: rgba($color: #000000, $alpha: 0.5);
+		}
+		.set_http{
+			position: absolute;
+			width: 90%;
+			left: 5%;
+			top:30%;
+			.set_http_top{
+				display: flex;
+				justify-content: space-around;
+				background-color: #5DC18B;
+				height: 60px;
+				line-height: 60px;
+				color: #FFFFFF;
+				border-top-right-radius: 20px;
+				border-top-left-radius: 20px;
+				font-size: 32rpx;
+			}
+			.set_http_bot{
+				height: 150px;
+				background-color: #FFFFFF;
+				border-bottom-right-radius: 20px;
+				border-bottom-left-radius: 20px;
+				padding: 30px;
+				.set_http_bot_input{
+					margin-top: 20rpx;
+					border: 2rpx solid #bdb6a6;
+					border-radius: 20rpx;
+					padding: 10rpx 40rpx 0  20rpx;
+					font-size: 32rpx;
+					height: 30px;
+					display: flex;
+					justify-content: space-between;
+					input{
+						width: 90%;
+					}
+				}
+			}
+			.scroll-Y{
+				border: 2rpx solid #d0d0d0;
+				border-radius: 20rpx;
+				.scroll-view-item{
+					padding-left: 20rpx;
+					height: 50rpx;
+					font-size: 28rpx;
+					line-height: 50rpx;
+				}
+			}
+		}
+	}
 </style>

+ 20 - 2
pages/monitor/index.vue

@@ -8,7 +8,10 @@
 					<image src="../../static/image/monitor/banner.png" mode="widthFix"></image>
 				</view>
 			</view>
-			<view class="content">
+			<view class="contenttf" v-if="contenttf">
+				暂无数据
+			</view>
+			<view class="content" v-else>
 				<template v-for="(item,index) in listArr">
 					<equipItem @click.native="itemClick(item)" v-bind:item="item" :key="index">
 						<view class="type-name">
@@ -36,7 +39,8 @@
 				page: 1,
 				accessToken: '',
 				counts: '',
-				isTop:false
+				isTop:false,
+				contenttf:false
 			}
 		},
 		onLoad() {
@@ -73,6 +77,12 @@
 						page: this.page
 					}
 				})
+				console.log(res)
+				if(res.counts==0){
+					this.contenttf = true
+				}else{
+					this.contenttf = false
+				}
 				let data = res.data
 				let arr = data.map(item => {
 					item.imei=item.device_id
@@ -137,6 +147,14 @@
 			margin-left: 10px;
 		}
 	}
+	.contenttf{
+		position: absolute;
+		top: 170px;
+		width: 95%;
+		left: 2.5%;
+		text-align: center;
+		font-size: 20px;
+	}
 	.content{
 		position: absolute;
 		top: 130px;

+ 32 - 10
pages/prevention/equipmentdetails.vue

@@ -7,7 +7,7 @@
 			</view>
 			<view class="info">
 				<view class="info_item">
-					<image :src="eqinfo.item.device_status==1?'../../static/image/cb/onBg.png':'../../static/image/cb/offBg.png'" mode=""
+					<image :src="eqinfo.item.is_online==1?'../../static/image/cb/onBg.png':'../../static/image/cb/offBg.png'" mode=""
 					 class="bgi"></image>
 					<p style="font-size: 32rpx;">设备 ID:{{eqinfo.item.imei}}</p>
 					<p>设备名称:{{eqinfo.item.device_name}}</p>
@@ -32,7 +32,7 @@
 			</view>
 			<view class="realtime">
 				<p class="realtime_title">实时数据</p>
-				<view class="realtime_text">
+				<view class="realtime_text" v-if="newdatesTF">
 					<view class="realtime_text_item">
 						<view class="realtime_text_item_info" v-for="item,index in olddatas" :key="index">
 							<view class="item_info_img">
@@ -45,6 +45,9 @@
 						</view>
 					</view>
 				</view>
+				<view class="realtime_tishi" v-else>
+					暂无数据
+				</view>
 			</view>
 		</view>
 	</view>
@@ -56,6 +59,8 @@
 				eqinfo: {},
 				olddata: {},
 				olddatas: [],
+				newdatesTF:false,
+				work:""
 			}
 		},
 		methods: {
@@ -63,12 +68,12 @@
 				this.olddatas = [{
 						icon: '../../static/image/cb/icon02.png',
 						txt: '设备开关',
-						value: this.olddata.ds == 1 ? '在线' : '离线',
+						value: Number(this.olddata.ds) == 1 ? '开机' : "关机",
 					},
 					{
 						icon: '../../static/image/cb/icon05.png',
 						txt: '工作状态',
-						value: this.olddata.ws == 1 ? "工作" : "待机"
+						value:this.work
 					},
 					{
 						icon: '../../static/image/prevention/44.png',
@@ -98,11 +103,11 @@
 					}, {
 						icon: '../../static/image/prevention/101.png',
 						txt: '雨控状态',
-						value: this.olddata.rps == 1 ? "雨控" : '正常'
+						value: Number(this.olddata.rps) == 1 ? "雨控" : '正常'
 					}, {
 						icon: '../../static/image/prevention/102.png',
 						txt: '温控状态',
-						value: this.olddata.tps == 1 ? "温控" : '正常'
+						value: Number(this.olddata.tps) == 1 ? "温控" : '正常'
 					},
 					{
 						icon: '../../static/image/prevention/105.png',
@@ -112,7 +117,7 @@
 					{
 						icon: '../../static/image/prevention/106.png',
 						txt: '电压状态',
-						value: this.olddata.batStatus == 1 ? "欠压" : '正常'
+						value: Number(this.olddata.batStatus) == 1 ? "欠压" : '正常'
 					},
 					{
 						icon: '../../static/image/prevention/107.png',
@@ -134,8 +139,19 @@
 						device_id: this.eqinfo.item.imei
 					}
 				})
-				this.olddata = res.data[0].d_h_t
-				console.log(res)
+				if(res.data.length !=0){
+					this.olddata = res.data[0].d_h_t
+					this.newdatesTF =true
+					if(Number(this.olddata.ws) == 0){
+						this.work = "待机"
+					}else if(Number(this.olddata.ws) == 1){
+						this.work = "工作"
+					}else{
+						this.work = "充电"
+					}
+				}else{
+					this.newdatesTF =false
+				}
 				this.modification()
 			},
 			clickLeft() {
@@ -236,7 +252,13 @@
 			width: 90%;
 			margin: 0 auto;
 		}
-
+		.realtime_tishi{
+			width: 90%;
+			margin: 0 auto;
+			text-align: center;
+			font-size: 32rpx;
+			padding-top: 40rpx;
+		}
 		.realtime_text {
 			width: 90%;
 			margin: 0 auto;

+ 6 - 4
pages/prevention/sim.vue

@@ -36,7 +36,7 @@
 						data_plan: "--",
 						data_usage: "--",
 						data_balance: "--",
-						outbound_date: +new Date() / 1000
+						outbound_date: ""
 					}
 				},
 				state: ['未知', '测试期', '沉默期', '使用中', '停机', '停机保号', '预销号', '销号'],
@@ -52,9 +52,11 @@
 						type: 'sim'
 					}
 				})
-				this.iccid = res[0].iccid
-				this.simdata(this.iccid)
-				console.log(this.iccid)
+				if(res.length!=0){
+					this.iccid = res[0].iccid
+					this.simdata(this.iccid)
+				}
+				
 			},
 
 			async simdata(data) { //设备列表

Plik diff jest za duży
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-service.js


Plik diff jest za duży
+ 1 - 1
unpackage/cache/wgt/__UNI__DBA6730/app-view.js


Plik diff jest za duży
+ 1 - 1
unpackage/dist/build/app-plus/app-service.js


Plik diff jest za duży
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


Plik diff jest za duży
+ 573 - 383
unpackage/dist/dev/app-plus/app-service.js


Plik diff jest za duży
+ 432 - 263
unpackage/dist/dev/app-plus/app-view.js


BIN
unpackage/release/apk/__UNI__DBA6730_20210402114507.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210402165806.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210402115159.apk


BIN
unpackage/release/apk/__UNI__DBA6730_20210408090006.apk


+ 13 - 1
util/api.js

@@ -1,5 +1,17 @@
-const BASE_URL='http://182.92.193.64:8002'
+// const BASE_URL='http://8.136.98.49:8002'
+let BASE_URL = ''
 export const myRequest=(options)=>{
+	uni.getStorage({
+	    key: 'http',
+	    success: (res)=> {
+			console.log(res)
+	        BASE_URL = res.data
+	    },
+		fail: (res) => {
+			console.log(res)
+			BASE_URL = 'http://8.136.98.49:8002'
+		}
+	});
 	var session_key=""
 	// uni.getStorage({
 	// 	key:'session_key',