From a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 06 六月 2025 19:19:34 +0800
Subject: [PATCH] 开发更新

---
 h5/pages/polling/point.vue |  321 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 252 insertions(+), 69 deletions(-)

diff --git a/h5/pages/polling/point.vue b/h5/pages/polling/point.vue
index 6a97c8a..b85c9d8 100644
--- a/h5/pages/polling/point.vue
+++ b/h5/pages/polling/point.vue
@@ -2,45 +2,58 @@
 	<view class="main_app">
 		<view class="info">
 			<view class="head">
-				<view class="">宸℃鐐�</view>
-				<view class="status">宸插贰妫�</view>
+				<view class="">{{ info.pointName }}</view>
+				<view class="status" :class="{primaryColor: info.status == 0}">{{ info.status == 1 ? '宸插贰妫�' : '寰呭贰妫�' }}</view>
 			</view>
-			<template v-if="false">
+			<template v-if="info.status == 1">
 				<view class="line">
 					<div class="la">宸℃缁撴灉锛�</div>
-					<div class="val">姝e父</div>
+					<div class="val primaryColor" :class="{red: info.dealStatus == 1}">
+						{{ info.dealStatus == 0 ? '姝e父' : info.dealStatus == 1 ? '寮傚父' : '-' }}
+					</div>
 				</view>
 				<view class="line">
 					<div class="la">宸℃鏃堕棿锛�</div>
-					<div class="val">2022</div>
+					<div class="val">{{ info.dealDate }}</div>
 				</view>
 			</template>
 			<template v-else>
 				<view class="desc">
-					宸℃鍐呭
+					{{ info.content }}
 				</view>
 			</template>
 		</view>
 		<!--  -->
-		<view v-if="false" class="content">
+		<view v-if="info.status == 1" class="content">
 			<view class="title">宸℃璁板綍</view>
-			<view class="desc">宸茬粡鏇存崲鐏场</view>
+			<view class="files">
+				<view class="adduser_list_item_ipt1_upload" v-for="(item, i) in info.multifileList" :key="i">
+					<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
+					<!-- <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video> -->
+					<view v-if="item.type == 1" @click="videoClick(item)" class="video_wrap">
+						<video :src="item.fileurlFull" initial-time="0.01" :show-center-play-btn="false" :controls="false"
+							class="video" :enable-progress-gesture="false" muted />
+						<image src="@/static/play.png" class="play" mode=""></image>
+					</view>
+				</view>
+			</view>
+			<view v-if="info.dealInfo" class="desc">{{ info.dealInfo }}</view>
 			<view class="line line_s">
 				<view class="la">宸℃浜猴細</view>
-				<view class="val">xxx</view>
+				<view class="val">{{ info.realname }}</view>
 			</view>
 			<view class="line line_s">
 				<view class="la">宸℃鏃堕棿锛�</view>
-				<view class="val">xxx</view>
+				<view class="val">{{ info.dealDate }}</view>
 			</view>
 		</view>
 		<view v-else class="content">
 			<view class="title">宸℃澶勭悊</view>
 			<view class="appr_modal">
 				<view class="df_sb">
-					<view>澶勭悊鏃堕棿</view>
-					<view class="df_ac" @click="isShowHandleDate = true" v-if="handleParam.dealTime">
-						{{ handleParam.dealTime }}
+					<view><text class="red">*</text>澶勭悊鏃堕棿</view>
+					<view class="df_ac" @click="isShowHandleDate = true" v-if="handleParam.dealDate">
+						{{ handleParam.dealDate }}
 						<u-icon name="arrow-right"></u-icon>
 					</view>
 					<view @click="isShowHandleDate = true" v-else class="placeholder9 df_ac">
@@ -48,9 +61,14 @@
 						<u-icon name="arrow-right"></u-icon>
 					</view>
 				</view>
-
+				<view class="df_sb">
+					<view class="">宸℃缁撴灉</view>
+					<view class="df_ac" @click="isShowRes = true" v-if="handleParam.dealDate">
+						{{ handleParam.dealName }}
+						<u-icon name="arrow-right"></u-icon>
+					</view>
+				</view>
 				<view class="label">
-					<text>*</text>
 					涓婁紶鍥剧墖/瑙嗛
 				</view>
 				<view class="upload_wrap">
@@ -58,19 +76,20 @@
 						<u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
 						<view class="mt6">鍥剧墖/瑙嗛</view>
 					</view>
-					<view class="adduser_list_item_ipt1_upload" v-for="(item, i) in dealFileList" :key="i">
+					<view class="adduser_list_item_ipt1_upload" v-for="(item, i) in fileList" :key="i">
 						<u-icon class="close" size="20" name="close-circle-fill" color="red"
-							@click="fileDel('dealBeforeFileList', i)"></u-icon>
+							@click="fileDel('fileList', i)"></u-icon>
 						<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
 						<video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
 					</view>
 				</view>
 
-				<view class="label">澶勭悊璇存槑</view>
-				<textarea v-model="handleParam.checkInfo" placeholder="璇峰~鍐欏鐞嗚鏄�" placeholder-class="placeholder9" />
+				<view class="label" style="margin-bottom: 10rpx;">澶勭悊璇存槑</view>
+				<textarea v-model="handleParam.dealInfo" :maxlength="-1" placeholder="璇峰~鍐欏鐞嗚鏄�"
+					placeholder-class="placeholder9" />
 			</view>
-		</view>
-		<view class="sub_btn">纭宸℃</view>
+		</view>
+		<view v-if="info.status == 0" class="sub_btn" @click="onSubmit">纭宸℃</view>
 		<!--  -->
 		<u-popup :show="showUpload" @close="showUpload = false" closeOnClickOverlay>
 			<view class="sel_upload_wrap">
@@ -81,27 +100,115 @@
 		<!--  -->
 		<u-datetime-picker :minDate="new Date().getTime()" :show="isShowHandleDate" @confirm="confirmHandleDate"
 			@cancel="isShowHandleDate = false" mode="datetime"></u-datetime-picker>
+		<u-picker :show="isShowRes" keyName="name" @cancel="isShowRes = false" @confirm='confirmRes'
+			:columns="columns"></u-picker>
+		<!--  -->
+		<view v-if="videoPlay" class="video_app">
+			<video controls autoplay muted x5-video-player-type="h5" x5-video-player-fullscreen="true" id="myvideo"
+				:src="videoUrl" @fullscreenchange="screenChange"></video>
+			<view class="bg" @click="closeVideo"></view>
+		</view>
+		<!--  -->
 	</view>
 </template>
 
 <script>
 	import {
-		uploadUrl
+		uploadUrl,
+		ywPatrolPointDetail,
+		patrolData
 	} from '@/api'
 	import dayjs from 'dayjs';
 	export default {
 		data() {
 			return {
+				id: '',
+				info: {},
+				isShowRes: false,
 				showUpload: false,
 				isShowHandle: false,
 				isShowHandleDate: false,
-				handleParam: {},
-				dealFileList: []
+				handleParam: {
+					dealStatus: 0,
+					dealName: '姝e父'
+				},
+				fileList: [],
+				columns: [
+					[{
+							id: 0,
+							name: '姝e父'
+						},
+						{
+							id: 1,
+							name: '寮傚父'
+						},
+						// {
+						// 	id: 2,
+						// 	name: '璺宠繃'
+						// },
+					]
+				],
+
+				videoPlay: false,
+				videoContext: null,
+				videoUrl: ''
 			};
+		},
+		onLoad(option) {
+			this.id = option.id
+			this.getDetail()
+			this.$set(this.handleParam, 'dealDate', dayjs().format('YYYY-MM-DD HH:mm:ss'))
 		},
 		methods: {
 			onSubmit() {
+				const {
+					handleParam,
+					fileList,
+					id
+				} = this
+				patrolData({
+					...handleParam,
+					multifileList: fileList,
+					id,
+				}).then(res => {
+					if (res.code == 200) {
+						if (handleParam.dealStatus == 1) {
+							return uni.showModal({
+								title: '娓╅Θ鎻愮ず',
+								content: '宸℃缁撴灉寮傚父锛屾槸鍚﹀墠寰�鎻愪氦宸ュ崟锛�',
+								success: (res) => {
+									if (res.confirm) {
+										this.showToast('鎿嶄綔鎴愬姛')
+										setTimeout(() => {
+											uni.redirectTo({
+												url: '/pages/workOrder/edit'
+											})
+										}, 300)
+									} else {
+										this.showToast('鎿嶄綔鎴愬姛')
+										setTimeout(() => {
+											uni.navigateBack()
+										}, 300)
+									}
+								}
+							});
+						} else {
+							this.showToast('鎿嶄綔鎴愬姛')
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 300)
+						}
+					}
 
+				})
+			},
+			getDetail() {
+				const {
+					id
+				} = this
+				ywPatrolPointDetail(id).then(res => {
+					this.info = res.data
+				})
 			},
 			callPhone() {
 				uni.makePhoneCall({
@@ -109,8 +216,33 @@
 				});
 			},
 			confirmHandleDate(e) {
-				this.$set(this.handleParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
+				this.$set(this.handleParam, 'dealDate', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
 				this.isShowHandleDate = false;
+			},
+			confirmRes(e) {
+				this.$set(this.handleParam, 'dealStatus', e.value[0].id)
+				this.$set(this.handleParam, 'dealName', e.value[0].name)
+				this.isShowRes = false
+			},
+			videoClick(item) {
+				this.videoPlay = true;
+				this.videoContext = uni.createVideoContext("myvideo", this); // this杩欎釜鏄疄渚嬪璞� 蹇呬紶
+				this.videoUrl = item.fileurlFull;
+				this.videoContext.requestFullScreen();
+				this.$nextTick(() => {
+					this.videoContext.play();
+				})
+			},
+			screenChange(e) {
+				let fullScreen = e.detail.fullScreen // 鍊紅rue涓鸿繘鍏ュ叏灞忥紝false涓洪��鍑哄叏灞�
+				if (!fullScreen) {
+					//閫�鍑哄叏灞�
+					this.videoPlay = false // 闅愯棌鎾斁鐩掑瓙
+				}
+			},
+			closeVideo() {
+				this.videoPlay = false
+				this.videoContext = null
 			},
 			fileDel(str, i) {
 				this[str].splice(i, 1);
@@ -137,7 +269,7 @@
 							files: imgs,
 							name: 'file',
 							formData: {
-								folder: 'HIDDEN_DANGER_FILE'
+								folder: 'YW_PATROL'
 							},
 							header: {
 								Dm_user_token: token
@@ -149,7 +281,7 @@
 										i.type = 0;
 										i.fileurl = i.imgaddr;
 										i.fileurlFull = i.url;
-										this.submitFileList.push(i);
+										this.fileList.push(i);
 									});
 								}
 							},
@@ -183,7 +315,7 @@
 							},
 							name: 'file',
 							formData: {
-								folder: 'HIDDEN_DANGER_FILE'
+								folder: 'YW_PATROL'
 							},
 							success: uploadFileRes => {
 								let res = JSON.parse(uploadFileRes.data);
@@ -192,7 +324,7 @@
 										i.type = 1;
 										i.fileurl = i.imgaddr;
 										i.fileurlFull = i.url;
-										this.submitFileList.push(i);
+										this.fileList.push(i);
 									});
 								}
 							},
@@ -270,22 +402,25 @@
 			text-align: center;
 		}
 	}
-	.sub_btn{
-		position: fixed;
-		bottom: 68rpx;
-		left: 40rpx;
-		width: 670rpx;
-		height: 88rpx;
-		background: $primaryColor;
-		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0,104,255,0.3);
-		border-radius: 44rpx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		font-weight: 500;
-		font-size: 32rpx;
-		color: #FFFFFF;
+
+	.sub_btn {
+		// position: fixed;
+		// bottom: 68rpx;
+		// left: 40rpx;
+		width: 670rpx;
+		margin-top: 60rpx;
+		height: 88rpx;
+		background: $primaryColor;
+		box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
+		border-radius: 44rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-weight: 500;
+		font-size: 32rpx;
+		color: #FFFFFF;
 	}
+
 	.appr_modal {
 		.label {
 			text {
@@ -327,7 +462,7 @@
 		textarea {
 			box-sizing: border-box;
 			width: 690rpx;
-			min-height: 200rpx;
+			min-height: 140rpx;
 			background-color: #f7f7f7;
 			font-size: 28rpx;
 			color: #333333;
@@ -342,37 +477,85 @@
 			margin-bottom: 30rpx;
 		}
 
-		.adduser_list_item_ipt1_upload {
-			margin-top: 24rpx;
+	}
+
+	.files {
+		display: flex;
+		margin-bottom: 20rpx;
+	}
+
+	.adduser_list_item_ipt1_upload {
+		margin-top: 24rpx;
+		width: 156rpx;
+		height: 156rpx;
+		margin-right: 24rpx;
+		border: 2rpx solid #e5e5e5;
+		background: #f7f7f7;
+		color: #666666;
+		font-size: 22rpx;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+
+		.close {
+			position: absolute;
+			right: -20rpx;
+			top: -20rpx;
+			z-index: 9999;
+		}
+
+		image {
+			width: 100%;
+			height: 100%;
+		}
+
+		video {
+			width: 100%;
+			height: 100%;
+		}
+
+		.video_wrap {
+			position: relative;
+			border: 1px solid;
 			width: 156rpx;
 			height: 156rpx;
-			margin-right: 24rpx;
-			border: 2rpx solid #e5e5e5;
-			background: #f7f7f7;
-			color: #666666;
-			font-size: 22rpx;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-			position: relative;
+			border-radius: 4rpx;
 
-			.close {
+			.play {
+				width: 60rpx !important;
+				height: 60rpx !important;
 				position: absolute;
-				right: -20rpx;
-				top: -20rpx;
-				z-index: 9999;
+				top: 50%;
+				left: 50%;
+				transform: translate(-50%, -50%);
 			}
+		}
+	}
 
-			image {
-				width: 100%;
-				height: 100%;
-			}
+	.video_app {
+		overflow: hidden;
+		position: fixed;
+		left: 0;
+		top: 0;
+		width: 100vw;
+		height: 100vh;
+		display: flex;
+		align-items: center;
+		z-index: 9990;
 
-			video {
-				width: 100%;
-				height: 100%;
-			}
+		.bg {
+			background-color: rgba(0, 0, 0, .6);
+			position: absolute;
+			width: 100%;
+			height: 100%;
+			z-index: -1;
+		}
+
+		video {
+			width: 100%;
+			height: 42vh;
 		}
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3