Преглед на файлове

feat: 色诱1.0 2.0迭代

yf_elsa.cui преди 5 месеца
родител
ревизия
266f490c64

Файловите разлики са ограничени, защото са твърде много
+ 4278 - 2259
components/js_sdk/u-charts/u-charts/u-charts.js


+ 8 - 8
pages.json

@@ -1145,8 +1145,8 @@
 		"getFuzzyLocation"
 	],
 	"tabBar": {
-		"color": "#cdcdcd",
-		"selectedColor": "#56C979",
+		"color": "#5C5C5C",
+		"selectedColor": "#018B3F",
 		"borderStyle": "white",
 		"list": [{
 				"pagePath": "pages/index/index",
@@ -1156,20 +1156,20 @@
 			},
 			{
 				"pagePath": "pages/equipList/index",
-				"iconPath": "static/images/tabBar/shebeiliebiao.png",
-				"selectedIconPath": "static/images/tabBar/shebeiliebiaosel.png",
+				"iconPath": "static/images/tabBar/device.png",
+				"selectedIconPath": "static/images/tabBar/devicesel.png",
 				"text": "设备列表"
 			},
 			{
 				"pagePath": "pages/distribution/index",
-				"iconPath": "static/images/tabBar/shebeifenbu.png",
-				"selectedIconPath": "static/images/tabBar/shebeifenbusel.png",
+				"iconPath": "static/images/tabBar/fenbu.png",
+				"selectedIconPath": "static/images/tabBar/fenbusel.png",
 				"text": "设备分布"
 			},
 			{
 				"pagePath": "pages/my/index/index",
-				"iconPath": "static/images/tabBar/gerenzhongxin.png",
-				"selectedIconPath": "static/images/tabBar/gerenzhongxinsel.png",
+				"iconPath": "static/images/tabBar/user.png",
+				"selectedIconPath": "static/images/tabBar/usersel.png",
 				"text": "个人中心"
 			}
 		]

+ 9 - 0
pages/afterSale/addafter.vue

@@ -137,6 +137,15 @@
 					},{
 						text: '天牛监测设备',
 						id:32
+					},{
+						text: '色诱测报设备2.0',
+						id:33
+					},{
+						text: '色诱测报设备1.0',
+						id:34
+					},{
+						text: '虫情测报设备5.0',
+						id:35
 					},
 				],
 				show:false,//选择器的显示

+ 106 - 27
pages/cb/cbd/equip-set/equip-set-new.vue

@@ -26,20 +26,23 @@
 			<u-line color="#E5EBE9" />
 		</view>
 
-		<view class="uni-list-cell" @click="modeShow = true">
+		<view class="uni-list-cell" v-if="device_type==32" @click="modeShow = true">
 			<span class="tit">定时模式</span>
 			<view class="right-data" style="float: right;">
 				<span>{{tsArrLabel}}</span>
 				<u-icon class="arrow" name="arrow-right"></u-icon>
 			</view>
 		</view>
-		<view >
-			<u-select v-model="modeShow" :list="tsArr" @confirm="tsArrConfirm"></u-select>
-			<u-select v-model="shikongshow" mode="mutil-column" :list="shikonglist" @confirm="shikongconfirm"></u-select>
+		<view class="uni-list-cell" v-if="device_type==33||device_type==34" @click="syModeShow = true">
+			<span class="tit">控制模式</span>
+			<view class="right-data" style="float: right;">
+				<span>{{tsArrLabel}}</span>
+				<u-icon class="arrow" name="arrow-right"></u-icon>
+			</view>
 		</view>
-		<view class="uni-list-cell" @click="shikongshow = true">
+		<view class="uni-list-cell" @click="shikongshow = true" v-if="equipContrlForm.CONTROL==0">
 			<span class="tit">
-				开始结束时间
+				时控时长
 			</span>
 			<view class="right-data" style="float: right;">
 				<span>{{shikongLabel}}</span>
@@ -47,9 +50,38 @@
 			</view>
 			
 		</view>
-
-		<u-select v-model="dataSelectShow"  :list="singleSelectList" @confirm="dataconfirm"></u-select>
-		<view class="uni-list-cell" @click="selectOperate('dataList','DATT')">
+		<view class="uni-list-cell" @click="gkongShow = true" v-if="equipContrlForm.CONTROL==1">
+			<span class="tit">
+				光控时长
+			</span>
+			<view class="right-data" style="float: right;">
+				<span>{{gkongLabel}}</span>
+				<u-icon class="arrow" name="arrow-right"></u-icon>
+			</view>
+			
+		</view>
+		
+		<view class="uni-list-cell" @click="photoShow = true" v-if="device_type==33||device_type==34">
+			<span class="tit">
+				拍照时间
+			</span>
+			<view class="right-data" style="float: right;">
+				<span>{{photoLabel}}</span>
+				<u-icon class="arrow" name="arrow-right"></u-icon>
+			</view>
+			
+		</view>
+		<view class="uni-list-cell" v-if="device_type==33||device_type==34"  @click="selectOperate(5,1440,'P_DATT')">
+			<span class="tit">
+				拍照频率(min)
+			</span>
+			<view class="right-data" style="float: right;">
+				<span>{{equipContrlForm.P_DATT}}</span>
+				<u-icon class="arrow" name="arrow-right"></u-icon>
+			</view>
+			
+		</view>
+		<view class="uni-list-cell" @click="selectOperate(5,device_type==32?60:1440,'DATT')">
 			<span class="tit">
 				数据上传频率(min)
 			</span>
@@ -59,7 +91,7 @@
 			</view>
 			
 		</view>
-		<view class="uni-list-cell" @click="selectOperate('photoList','PHO_T')">
+		<view v-if="device_type==32" class="uni-list-cell" @click="selectOperate(5,180,'PHO_T')">
 			<span class="tit">
 				照片上传频率(min)
 			</span>
@@ -69,6 +101,14 @@
 			</view>
 			
 		</view>
+		<view >
+			<u-select v-model="modeShow" :list="tsArr" @confirm="tsArrConfirm"></u-select>
+			<u-select v-model="syModeShow" :list="syArr" @confirm="tsArrConfirm"></u-select>
+			<u-select v-model="shikongshow" mode="mutil-column" :list="shikonglist" @confirm="shikongconfirm"></u-select>
+			<u-select v-model="photoShow" mode="mutil-column" :list="shikonglist" @confirm="photoConfirm"></u-select>
+			<u-select v-model="gkongShow" :list="gkongArr" @confirm="gkArrConfirm"></u-select>
+			<u-select v-model="dataSelectShow"  :list="singleSelectList" @confirm="dataconfirm"></u-select>
+		</view>
 		<view class="submit-box">
 			<u-button :custom-style="customStyle" @click="submit" :disabled="submitBtnDisabled" >确定</u-button>
 		</view>
@@ -114,18 +154,28 @@
 				dsIndex: 0,
 				wsArr: ['待机', '工作'],
 				wsIndex: 0,
-				tsArr: [ { value: '1', label: '时控触发' },
-        { value: '0', label: '时控模式' }],
+				tsArr: [ 
+					{ value: 1, label: '时控触发' },
+					{ value: 0, label: '时控模式' },
+				],
+				syArr:[
+					{ value: 1, label: '光控模式' },
+					{ value: 0, label: '时控模式' }
+				  ],
 				tsIndex: 0,
 				imgresArr: ['高', '中', '低'],
 				imgresIndex: "",
 				wsModelShow: false,
 				equipContrlForm: {
 					END_TIME: '',
-					CONTROL: '0',
+					CONTROL: 0,
 					DATT: 5,
 					START_TIME: '',
-					PHO_T: 5
+					PHO_T: 5,
+					P_DATT:1,
+					TT: '',
+					P_START:'',
+					P_END:''
 				},
 
 				shikongLabel:'00:00-00:00',
@@ -225,6 +275,8 @@
 				],
 				mqttShow: false,
 				shikongshow:false,
+				gkongLabel:'0h',
+				gkongShow:false,
 				mqttConfig: {
 					muid: '',
 					mpwd: '',
@@ -242,12 +294,28 @@
 				dataSelectShow:false,
 				currentFormKey:'',
 				tsArrLabel:'时控模式',
+			
 				modeShow:false,
-				submitBtnDisabled:false
+				syModeShow:false,
+				submitBtnDisabled:false,
+				photoShow:false,
+				photoLabel:'00:00-00:00'
+				
 			}
 		},
 		
 		computed:{
+			gkongArr(){
+				const list = []
+				      const count = 24
+				      for (let i = 0; i < count; i++) {
+				        list.push({
+				          value: i + 1 + '',
+				          label: i + 1 + 'h'
+				        })
+				      }
+				      return list
+			},
 			customStyle(){
 				return {
 					background: '#14A478',
@@ -334,17 +402,11 @@
 			})
 		},
 		methods: {
-			selectOperate(selectList,formKey){
+			selectOperate(min,max,formKey){
 				this.dataSelectShow = true
-				let length = 0
-				if(selectList=='photoList'){
-					length = 60
-				}
-				if(selectList=='dataList'){
-					length = 180
-				}
+		
 				this.singleSelectList = []
-				for (let i = 5; i < length; i++) {
+				for (let i = min; i < max; i+=5) {
 					this.singleSelectList.push({
 						value:i,
 						label:i.toString()
@@ -357,6 +419,10 @@
 				this.tsArrLabel = e[0].label
 				this.equipContrlForm.CONTROL = e[0].value
 			},
+			gkArrConfirm(e){
+				this.gkongLabel = e[0].label
+				this.equipContrlForm.TT = e[0].value
+			},
 			dataconfirm(e){
 				this.equipContrlForm[this.currentFormKey] = e[0].value
 			},
@@ -366,7 +432,12 @@
 				this.equipContrlForm.START_TIME = e[0].value
 				this.equipContrlForm.END_TIME = e[1].value
 			},
-			
+			photoConfirm(e){
+				
+				this.photoLabel = e[0].label+'-'+e[1].label
+				this.equipContrlForm.P_START = e[0].value
+				this.equipContrlForm.P_END = e[1].value
+			},
 			turnChange(e, a) {
 				this.equipContrlForm.ts = e.target.value
 
@@ -376,7 +447,7 @@
 					url: '/api/api_gateway?method=new_gateway.device_info.get_device_config',
 					data: {
 						device_type_id:this.device_type,
-						d_id: this.d_id
+						id: this.d_id
 					}
 				})
 				if(res.code==4000){
@@ -387,7 +458,9 @@
 					})
 					return 
 				}
-	
+				this.equipContrlForm = res
+				this.photoLabel = (res.P_START||'00:00')+' - '+ (res.P_END||'00:00')
+				this.shikongLabel = res.START_TIME + ':00' +  ' - '+res.END_TIME + ':00' 
 				console.log(this.equipContrlForm)
 			},
 			async submit() {
@@ -401,6 +474,12 @@
 						
 					}
 				})
+				if(res){
+					this.$refs.toast.show({
+						title: '修改成功!',
+						type: 'success',
+					})
+				}
 				if(res.code==4000){
 					this.$refs.toast.show({
 						title: res.msg+'无法修改',

+ 60 - 25
pages/cb/cbd/equip-set/newhistoryfile.vue

@@ -5,8 +5,8 @@
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="历史数据" backgroundColor="#f7f7f7"></uni-nav-bar>
 			</view>
 			<view style="padding: 0 48rpx; background-color: #f7f7f7;">
+			<u-calendar v-model="dataShow" :mode="mode" @change="tiemchange" :maxDate="maxDate"></u-calendar>
 			<view class="date" @click="dataShow = true">
-				<u-calendar v-model="dataShow" :mode="mode" @change="tiemchange" :maxDate="maxDate"></u-calendar>
 				<span>选择日期 </span>
 				<span style="color: #cccccc;">
 					{{start_time}} <span style="margin: 0 10rpx;"> /</span> {{end_time}} 
@@ -25,6 +25,14 @@
 				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
 				 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
+			<!-- <pest-line
+				:device_type_id="device_type"
+				:d_id="d_id"
+				:start_time="start_time"
+				:end_time="end_time"
+				:notify="notify"
+			></pest-line> -->
+			
 			<view class="title">监测数据 
 			
 				<u-button size="mini" :loading='refreshLoading' class="refresh" throttle-time="500" @click="refresh" :customStyle="customStyle">刷 新</u-button>
@@ -63,6 +71,7 @@
 
 <script>
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	import pestLine from './pestLine';
 	var canvaColumnA = null;
 	export default {
 		data() {
@@ -93,9 +102,11 @@
 				device_type:"",
 				dataShow: false,
 				mode: 'range',
-				refreshLoading:false
+				refreshLoading:false,
+				notify:0
 			}
 		},
+		components:{pestLine},
 		computed:{
 			customStyle(){
 				return {
@@ -119,7 +130,8 @@
 				this.end_time = e.endDate 
 
 				this.history()
-				this.historylist() 
+				this.historylist()
+				this.notify++
 		
 			},
 			async history() { //历史数据列表折线图
@@ -129,30 +141,34 @@
 					data: {
 						device_type_id: this.device_type,
 						id: this.d_id,
-						start: +new Date(this.start_time+' 00:00:00') / 1000,
-						end: +new Date(this.end_time+' 23:59:59') / 1000  
+						start: +new Date(this.start_time + ' 00:00:00') / 1000,
+						end: +new Date(this.end_time + ' 23:59:59') / 1000
 					}
 				})
 				this.dataloadingtf = false
 				this.historydatas = res || []
+				console.log(this.historydatas)
 				if (this.historydatas.length == 0) {
 					this.canvastishiTF = false
 				} else {
 					this.canvastishiTF = true
-
-					var arr1 = []
-					var arr2 = []
-				
-					var xtitle = []
-					for (var i = 0; i < res.length; i++) {
-						// var times = new Date(res[i].addtime * 1000)
+			
+					let arr1 = []
+					let arr2 = []
+					let arr3 = []
+					let xtitle = []
+					for (let i = 0; i < res.length; i++) {
+						// let times = new Date(res[i].addtime * 1000)
 						xtitle.push(res[i].addtime.split(' ')[0])
 						arr1.push(res[i].tem)
 						arr2.push(res[i].hum)
-					
+						if ('lux' in res[i]) {
+							arr3.push(res[i].lux)
+						}
 					}
 					// console.log(arr1)
-					var obj = [{
+					let obj = [{
+			
 						name: '温度',
 						data: arr1,
 						color: '#00E29D'
@@ -161,9 +177,27 @@
 						data: arr2,
 						color: '#6CBBFF'
 					}]
-					this.showColumn("canvasColumnA", xtitle, obj)
+					if (arr3.length > 0) {
+						obj.push({
+							index: 1,
+							name: '光照',
+							data: arr3,
+							color: '#E67B3E'
+						})
+					}
+					let yAxis = {
+						data: [{
+							position: 'left'
+						}, {
+							position: 'right'
+						}]
+			
+					}
+					// console.log('----温度:',obj)
+					this.showColumn("canvasColumnA", xtitle, obj, yAxis)
 				}
 			},
+			
 			//历史数据列表
 			async historylist() { 
 				const res = await this.$myRequest({
@@ -243,8 +277,8 @@
 					delta: 1
 				})
 			},
-			showColumn(id, xtitle, xinfo) {
-				var _self = this
+			showColumn(id, xtitle, xinfo, yAxis) {
+				let _self = this
 				const ctx = uni.createCanvasContext(id, this);
 				canvaColumnA = new uCharts({
 					context: ctx,
@@ -270,7 +304,7 @@
 						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
 						scrollColor: '#DEE7F7', //默认为 #A6A6A6
 					},
-					yAxis: {},
+					yAxis: yAxis || {},
 					width: _self.cWidth * 1,
 					height: _self.cHeight * 1,
 					extra: {
@@ -334,6 +368,14 @@
 </script>
 
 <style lang="scss" scoped>
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+	
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
 	page{
 		background: #f7f7f7;
 	}
@@ -351,14 +393,7 @@
 		margin-top: 16rpx;
 		padding: 0 48rpx;
 		position: relative;
-		/deep/.u-calendar__action {
-			display: flex;
-			justify-content: space-around;
 		
-			.u-calendar__action__text {
-				line-height: 25px;
-			}
-		}
 	}
 	
 	.shuju_one,

+ 135 - 30
pages/cb/equip-detail/equip-detail-new.vue

@@ -12,6 +12,9 @@
 				</view>
 			</view>
 			<view class="info-list">
+				<span class="float-left">设备名称:</span> <span class="float-right">{{equipInfo.device_name}}</span>
+			</view>
+			<view class="info-list" v-if="equipInfo.type==32">
 				<span class="float-left">诱虫量:</span> <span class="float-right">{{equipInfo.bug_count?equipInfo.bug_count.join('/'):'0/0/0'}}</span>
 			</view>
 			<view class="info-list">
@@ -20,7 +23,29 @@
 			<view class="info-list">
 				<span class="float-left">设备地址:</span> <span class="float-right">{{equipInfo.address?equipInfo.address:"--"}}</span>
 			</view>
-			<view class="info-list" @click="calendar_show=true">
+			<view class="info-list" v-if="equipInfo.type==34" @click="operate('jd')">
+				<span class="float-left">卷带到期时间</span>
+				<span>  </span>
+				<span class="float-right"> 
+				<span v-if="equipInfo.jd_expire_time>0">
+					{{ equipInfo.jd_expire_time | timeFormat}}
+				</span>
+				 <span v-else> 暂未设置卷带	</span>
+					<u-icon class="arrow" name="arrow-right" color="#666666" size="26"></u-icon>
+				</span>
+			</view>
+			<view class="info-list" v-if="equipInfo.type==33" @click="operate('sb')">
+				<span class="float-left">色板到期时间</span>
+				<span>  </span>
+				<span class="float-right"> 
+				<span v-if="equipInfo.sban_expire_time>0">
+					{{ equipInfo.sban_expire_time | timeFormat}}
+				</span>
+				 <span v-else> 暂未设置色板	</span>
+					<u-icon class="arrow" name="arrow-right" color="#666666" size="26"></u-icon>
+				</span>
+			</view>
+			<view class="info-list" v-if="equipInfo.type==32||equipInfo.type==33||equipInfo.type==34" @click="operate('yx')">
 				<span class="float-left">诱芯到期时间</span>
 				<span>  </span>
 				<span class="float-right"> 
@@ -31,15 +56,8 @@
 					<u-icon class="arrow" name="arrow-right" color="#666666" size="26"></u-icon>
 				</span>
 			</view>
-			<u-popup v-model="yxShow" mode="center" width="600rpx">
-				<u-field label="诱芯到期时间" @click="calendar_show=true" label-width='240' required :error-message="xyErr" v-model="decoy" class="field"
-					:field-style="fieldstyle" >
-				</u-field>
-				<view class="btn-box">
-					<u-button @click="yxSubmit" size="mini" type="success">确定</u-button>
-				</view>
-			</u-popup>
-			<u-calendar v-model="calendar_show" mode="date" :max-date="date" @change="timeChange($event,'decoy','xyErr')">
+
+			<u-calendar v-model="calendar_show" mode="date" :max-date="date" @change="timeChange($event)">
 			</u-calendar>
 			<u-toast ref="toast" />
 		</view>
@@ -104,12 +122,12 @@
 				setTimeShow: false,
 				calendar_show: false,
 				culErr: '',
-				yxShow: false, //诱芯弹框
-				xyErr: '',
+
 				decoy: '',
 				newtishitf: false, //暂无数据提示
 				dataloadingtf: true, //加载中提示
 				date: "", //日历最大可选日期
+				operateType:''
 			}
 		},
 		computed: {
@@ -131,7 +149,6 @@
 						tf: true
 					}]
 				let permission = getPermissionById(getUserPermission(),this.equipInfo.pur_id)
-				console.log(permission,'权限')
 				permission.forEach(item=>{
 					
 					if(item.purview_name =='查看图片'){
@@ -152,7 +169,7 @@
 						this.cbd.unshift({
 							icon: '/image/cb/3.png',
 							tex: item.purview_name,
-							path: '/pages/cb/cbd/equip-set/analyse',
+							path: '/pages/cb/cbd/equip-set/new-analyse',
 							tf: true
 						})
 					}
@@ -199,8 +216,31 @@
 						icon: '/image/cb/icon06.png',
 						txt: '光控状态',
 						value: this.newState.lps
+					}, {
+						icon: '/image/cb/icon18.png',
+						txt: '控制模式',
+						value: this.newState.control
 					}
 				]
+			},
+			operateOptions(){
+				return{
+					yx:{
+						title:'诱芯',
+						url:'/api/api_gateway?method=new_gateway.device_info.youxin',
+						field:'xy_expire_time'
+					},
+					sb:{
+						title:'色板',
+						url:'/api/api_gateway?method=new_gateway.device_info.sban',
+						field:'sban_expire_time'
+					},
+					jd:{
+						title:'卷带',
+						url:'/api/api_gateway?method=new_gateway.device_info.syone_jd',
+						field:'jd_expire_time'
+					}
+				}
 			}
 				
 		},
@@ -288,39 +328,104 @@
 				});
 			},
 	
-
-			timeChange(e, filed,errType) {
-				this[filed] = e.result
-				this[errType] = ""
-				this.yxSubmit()
+				
+			operate(type){
+				this.calendar_show = true
+				this.operateType = type
+			},
+			timeChange(e, filed) {
+				// // 根据type_id,执行相应的操作
+				
+				// let typeId = this.equipInfo.type
+				// let postData = {}
+				// if(typeId===32){
+				// 	// 添加诱芯
+				// }else if(typeId === 33){
+				// 	// 添加诱芯,更换色板
+				// 	this.sbSubmit(e.result)
+				// }else if(typeId === 34){
+				// 	// 添加诱芯,更换卷带
+				// 	this.jdSubmit(e.result)
+				// }
+				this.yxSubmit(e.result)
 			},
 		
-			async addYx(d_id) {
-				this.decoy = this.formatTime(this.equipInfo.xy_expire_time*1000,'yyyy-MM-dd');
-				this.yxShow = true
+			async yxSubmit(time) {
+				let {title,url,field} = this.operateOptions[this.operateType]
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写'+title+'到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				let postData = {
+					device_type_id: this.equipInfo.type,
+					id: this.equipInfo.device_id	
+				}
+				postData[field] = +new Date(time) / 1000 
+				const res = await this.$myRequest({
+					url: url,
+					data: postData
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: title+'时间设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+					
+				}
 			},
-			async yxSubmit() {
-				if (!this.decoy) {
-					this.xyErr = "请填写诱芯到期时间";
+			// 色板
+			async sbSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写色板到期时间!',
+						type: 'warning',
+					})
 					return false
 				}
 				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=new_gateway.device_info.youxin',
+					url: '/api/api_gateway?method=new_gateway.device_info.sban',
 					data: {
 						device_type_id: this.equipInfo.type,
 						id: this.equipInfo.device_id,
-						xy_expire_time:  +new Date(this.decoy) / 1000 
+						sban_expire_time:  +new Date(time) / 1000 
 					}
 				})
 				if (res) {
-					this.xyErr = ""
-					this.yxShow = false
 					this.$refs.toast.show({
 						title: '设置成功!',
 						type: 'success',
 					})
 					this.getDeviceStatus()
-					// this.equipInfo.xy_expire_time = +new Date(this.decoy) / 1000
+					
+				}
+			},
+			async jdSubmit(time) {
+				if (!time) {
+					this.$refs.toast.show({
+						title: '请填写卷带到期时间!',
+						type: 'warning',
+					})
+					return false
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=new_gateway.device_info.syone_jd',
+					data: {
+						device_type_id: this.equipInfo.type,
+						id: this.equipInfo.device_id,
+						jd_expire_time:  +new Date(time) / 1000 
+					}
+				})
+				if (res) {
+					this.$refs.toast.show({
+						title: '设置成功!',
+						type: 'success',
+					})
+					this.getDeviceStatus()
+					
 				}
 			},
 			selectaddress(lat, lng) { //获取分布位置

+ 3 - 1
pages/cb/index/index.vue

@@ -277,6 +277,8 @@
 				
 				this.active = index;
 				this.device_type = this.equipArr[index].id
+				this.equipArr[this.active].list = []
+				this.equipArr[this.active].pageIndex=1
 				this.choosePOST()
 			},
 			
@@ -300,7 +302,7 @@
 			},
 			clickRight() {
 				uni.navigateTo({
-					url: "./search?device_id=" + this.device_type
+					url: "./search?device_id=" + this.device_type+'&pur_id=' + this.equipArr[this.active].pur_id
 				})
 			},
 			itemClick(itemOld) {

+ 7 - 1
pages/cb/index/search.vue

@@ -168,6 +168,7 @@
 			eqdetails(item){
 				item.type = Number(this.device_id)
 				console.log(item)
+				item.pur_id = this.pur_id
 				let data = JSON.stringify(item)
 				if (item.type == 10) {
 					uni.navigateTo({
@@ -182,7 +183,11 @@
 					uni.navigateTo({
 						url: '/pages/cb/xctdetail/xctdetail?info=' + data
 					});
-				} else{
+				}else if (item.type == 32||item.type == 33||item.type == 34||item.type == 35) {
+					uni.navigateTo({
+						url: '/pages/cb/equip-detail/equip-detail-new?info=' + data
+					});
+				}else{
 					uni.navigateTo({
 						url: '/pages/cb/equip-detail/equip-detail?info=' + data
 					});
@@ -191,6 +196,7 @@
 		},
 		onLoad(option){
 			this.device_id = option.device_id
+			this.pur_id = option.pur_id
 		},
 		onReachBottom() {
 			this.page++

+ 5 - 3
pages/equipList/index.vue

@@ -590,7 +590,7 @@ page {
 .textbox {
   width: 100%;
   height: calc(100vh - 30rpx);
-  padding: 20rpx 30rpx;
+  padding: 20rpx 6rpx;
   box-sizing: border-box;
   border-top-left-radius: 80rpx;
   border-top-right-radius: 80rpx;
@@ -600,6 +600,8 @@ page {
 }
 
 .inputs {
+	width: 95%;
+	margin: 0 auto;
   /deep/.u-content {
     background-color: #fff !important;
   }
@@ -643,8 +645,8 @@ page {
 
   .listbox_left {
     background-color: #fff;
-    padding: 20rpx;
-    width: 180rpx;
+    padding: 20rpx 10rpx 20rpx 0;
+    width: 240rpx;
     overflow: auto;
 
     .listbox_left_item {

BIN
static/images/tabBar/shouye.png


BIN
static/images/tabBar/shouyesel.png