李程龙 3 jaren geleden
bovenliggende
commit
32b510057a

+ 3 - 0
pages/aftersale/index.vue

@@ -133,6 +133,9 @@
 			},
 			// 提交保存
 			async submitAftersaleInfo(e) {
+				if(this.imgList.length==0 || !this.aftersale.errorvideo){
+					return this.$api.msg('请上传故障图片与视频');
+				}
 				this.$api.loading("上报中...");
 				this.saveLoading = true;
 				this.aftersale.errorimg = this.imgList.join(',');

+ 10 - 5
pages/camera/details.vue

@@ -35,6 +35,7 @@
 				deviceId: '', // 设备号
 				// 播放地址
 				cameraAddress: '',
+				playerVideo: null,
 				// 控制参数
 				controlParams: {
 					device_id: '', //设备号
@@ -43,10 +44,14 @@
 				}
 			};
 		},
-		 onLoad(options) {
+		onLoad(options) {
 			this.deviceId = options.id;
 			this.controlParams.device_id = options.id;
-			
+		},
+		onUnload() {
+			if (this.playerVideo) {
+				this.playerVideo.dispose();
+			}
 		},
 		async onReady() {
 			await this.getCameraAddress();
@@ -59,11 +64,11 @@
 			video.setAttribute('webkit-playsinline', true) //这个bai属性是ios 10中设置可以让视频在小du窗内播放,也就是不是全zhi屏播放的video标签的一个属性
 			video.setAttribute('x5-video-player-type', 'h5') //安卓 声明启用同层H5播放器 可以在video上面加东西
 			let source = document.createElement('source');
-			source.src =this.cameraAddress;
+			source.src = this.cameraAddress;
 			video.appendChild(source);
 			this.$refs.video.$el.appendChild(video);
 			let that = this;
-			let player = this.$video('video', {
+			this.playerVideo = this.$video('video', {
 				poster: '', // 视频封面图地址
 				title: '4564564',
 				playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
@@ -105,7 +110,7 @@
 				});
 				let address = eval("(" + res + ")")
 				console.log(address.hls);
-				this.cameraAddress=address.hls;
+				this.cameraAddress = address.hls;
 			},
 			// 控制摄像机
 			async controlDirection(movenum) {

+ 2 - 0
pages/camera/index.vue

@@ -49,10 +49,12 @@
 		methods: {
 			// 获取监控列表
 			async getCameraList() {
+				this.$api.loading('加载中...');
 				const {
 					data,
 					counts
 				} = await getCameraList(this.params);
+				this.$api.hide();
 				this.cameraList = [...this.cameraList, ...data];
 				this.total = counts;
 			},

+ 1 - 0
pages/pest/discern-result.vue

@@ -4,6 +4,7 @@
 		<image class="discern-img" :src="result.img_urls" mode="aspectFill"></image>
 		<view class="discern-title">识别结果</view>
 		<view class="pest-title">{{result.name}}</view>
+		<view class="pest-paragraph">{{result.course}}</view>
 		<view class="pest-paragraph">{{result.prevention}}</view>
 		<view class="discern-result">
 			<!-- <view class="row-between discern-item">

+ 2 - 0
pages/weather/details.vue

@@ -99,11 +99,13 @@
 			},
 			// 获取24小时实时数据
 			async getWeatherDayData() {
+				this.$api.loading('加载中...');
 				const {
 					data
 				} = await getWeatherDayData({
 					device_id: this.deviceInfo.equip_id
 				});
+				this.$api.hide();
 				this.dayDatas = data ?? [];
 			},
 			/**

+ 2 - 0
pages/weather/index.vue

@@ -84,10 +84,12 @@
 			},
 			// 获取设备列表
 			async getDeviceList() {
+				this.$api.loading('加载中...');
 				const {
 					ids,
 					nums
 				} = await getWeatherDeviceList(this.params);
+				this.$api.hide();
 				this.deviceList = [...this.deviceList, ...ids];
 				this.total = nums ?? 0;
 			},

+ 9 - 3
pages/worm/index.vue

@@ -8,7 +8,8 @@
 		<block v-for="(item,index) in lampList" :key="index">
 			<view class="ui-card forecast-item" @click="openLampDetails(item)">
 				<view class="flex-1 info">
-					<view class="font-16  title" :class="item.is_online?'on':'off'">{{item.device_name?item.device_name:'测报灯'}}</view>
+					<view class="font-16  title" :class="item.is_online?'on':'off'">
+						{{item.device_name?item.device_name:'测报灯'}}</view>
 					<view class="text">设备ID:{{item.imei}}</view>
 					<view class="text">最新上报时间:{{ item.uptime | timeFrom}}</view>
 				</view>
@@ -64,11 +65,12 @@
 			},
 			// 获取测试灯列表
 			async getLampList() {
+				this.$api.loading('加载中...');
 				const {
 					data,
 					counts
 				} = await getWormLampList(this.params);
-
+				this.$api.hide();
 				this.lampList = [...this.lampList, ...data];
 				this.total = counts ?? 0;
 			},
@@ -86,7 +88,11 @@
 			 * @param {String} imei 设备号
 			 * @param {Number} uptime 上报时间
 			 */
-			openLampDetails({id,imei,uptime}) {
+			openLampDetails({
+				id,
+				imei,
+				uptime
+			}) {
 				uni.navigateTo({
 					url: `details?id=${id}&imei=${imei}&uptime=${uptime}`
 				})

+ 2 - 0
pages/worm/warn.vue

@@ -48,10 +48,12 @@
 		methods: {
 			// 获取设备列表
 			async getWarningList() {
+				this.$api.loading('加载中...');
 				const {
 					data,
 					nusm
 				} = await getPestWarningList(this.params);
+				this.$api.hide();
 				this.warningList = [...this.warningList, ...data];
 				this.total = nusm ?? 0;
 			},