detail-camera.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139
  1. <template>
  2. <view class="container">
  3. <!-- 设备头部信息区域 -->
  4. <view class="device-header">
  5. <view class="device-info-row">
  6. <view class="device-name-container">
  7. <text class="device-name">{{ deviceInfo.name }}</text>
  8. <view
  9. class="status-tag"
  10. :class="deviceInfo.status === 'online' ? 'status-online' : 'status-offline'"
  11. >
  12. <view class="status-dot" :class="{'offline-dot': deviceInfo.status === 'offline'}"></view>
  13. {{ deviceInfo.status === 'online' ? '在线' : '离线' }}
  14. </view>
  15. </view>
  16. <view class="refresh-btn" :class="{'refreshing': isRefreshing}" @tap="refreshData">
  17. <image src="/static/icons/refresh_icon.png" mode="aspectFit" style="width: 22px; height: 22px;"></image>
  18. </view>
  19. </view>
  20. <view class="device-meta-row">
  21. <view class="device-meta-item">
  22. <view class="meta-icon">
  23. <image src="/static/icons/device_icon.png" mode="aspectFit" style="width: 36rpx; height: 36rpx;"></image>
  24. </view>
  25. <text class="meta-label">设备编号:</text>
  26. <text class="meta-value">{{ deviceInfo.deviceId }}</text>
  27. </view>
  28. <view class="device-meta-item">
  29. <view class="meta-icon">
  30. <image src="/static/icons/location_icon.png" mode="aspectFit" style="width: 36rpx; height: 36rpx;"></image>
  31. </view>
  32. <text class="meta-label">安装位置:</text>
  33. <text class="meta-value">{{ deviceInfo.location }}</text>
  34. </view>
  35. <view class="device-meta-item">
  36. <view class="meta-icon">
  37. <image src="/static/icons/clock_icon.png" mode="aspectFit" style="width: 36rpx; height: 36rpx;"></image>
  38. </view>
  39. <text class="meta-label">最近更新:</text>
  40. <text class="meta-value">{{ deviceInfo.lastUpdate }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. <!-- 视频预览区域 -->
  45. <view class="video-section">
  46. <view class="video-container">
  47. <image v-if="!isPlaying" src="/static/images/video-placeholder.jpg" mode="aspectFill" class="video-placeholder"></image>
  48. <video
  49. v-else
  50. id="videoPlayer"
  51. :src="deviceInfo.streamUrl"
  52. class="video-player"
  53. object-fit="cover"
  54. autoplay
  55. :controls="false"
  56. :show-center-play-btn="false"
  57. :show-fullscreen-btn="false"
  58. :show-play-btn="false"
  59. :enable-progress-gesture="false"
  60. @error="handleVideoError"
  61. ></video>
  62. <!-- 视频控制层 -->
  63. <view class="video-controls">
  64. <view class="control-row top-controls">
  65. <view class="signal-indicator">
  66. <image src="/static/icons/signal_icon.png" mode="aspectFit" style="width: 16px; height: 16px;"></image>
  67. <text class="signal-text">信号良好</text>
  68. </view>
  69. <view class="fullscreen-button" @click="toggleFullscreen">
  70. <image src="/static/icons/resize_icon.png" mode="aspectFit" style="width: 20px; height: 20px;"></image>
  71. </view>
  72. </view>
  73. <view class="control-row center-controls">
  74. <view v-if="!isPlaying" class="play-button" @click="togglePlayState">
  75. <image src="/static/icons/play_icon.png" mode="aspectFit" style="width: 32px; height: 32px;"></image>
  76. </view>
  77. <view v-else class="center-button-container" @click="togglePlayState">
  78. <view class="pause-icon">
  79. <image src="/static/icons/pause_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="control-row bottom-controls">
  84. <view class="video-time">{{ currentTime }}</view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 云台控制区域 -->
  90. <view class="ptz-section">
  91. <view class="section-title">云台控制</view>
  92. <view class="ptz-container">
  93. <!-- 圆形云台控制 -->
  94. <view class="ptz-circle-container">
  95. <!-- 上箭头 -->
  96. <view class="ptz-arrow ptz-up" @touchstart="controlPTZ('up', true)" @touchend="controlPTZ('up', false)">
  97. <image src="/static/icons/arrow_up_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  98. </view>
  99. <!-- 左箭头 -->
  100. <view class="ptz-arrow ptz-left" @touchstart="controlPTZ('left', true)" @touchend="controlPTZ('left', false)">
  101. <image src="/static/icons/arrow_left_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  102. </view>
  103. <!-- 中心拍照按钮 -->
  104. <view class="ptz-center" @click="takeScreenshot">
  105. <image src="/static/icons/camera_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  106. </view>
  107. <!-- 右箭头 -->
  108. <view class="ptz-arrow ptz-right" @touchstart="controlPTZ('right', true)" @touchend="controlPTZ('right', false)">
  109. <image src="/static/icons/arrow_right_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  110. </view>
  111. <!-- 下箭头 -->
  112. <view class="ptz-arrow ptz-down" @touchstart="controlPTZ('down', true)" @touchend="controlPTZ('down', false)">
  113. <image src="/static/icons/arrow_down_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  114. </view>
  115. </view>
  116. <!-- 底部操作按钮 -->
  117. <view class="ptz-bottom-controls">
  118. <view class="ptz-bottom-button" @touchstart="controlZoom('out', true)" @touchend="controlZoom('out', false)">
  119. <image src="/static/icons/zoom01_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  120. </view>
  121. <view class="ptz-bottom-button" @click="resetPTZ">
  122. <image src="/static/icons/resetPTZ_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  123. </view>
  124. <view class="ptz-bottom-button" @touchstart="controlZoom('in', true)" @touchend="controlZoom('in', false)">
  125. <image src="/static/icons/zoom02_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 快捷功能按钮 -->
  131. <view class="quick-actions">
  132. <view class="action-button" @click="toggleVoiceIntercom">
  133. <view class="action-icon">
  134. <image src="/static/icons/Voice_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  135. </view>
  136. <text class="action-text">语音对讲</text>
  137. </view>
  138. <view class="action-button" @click="toggleMute">
  139. <view class="action-icon">
  140. <image v-if="isMuted" src="/static/icons/muted_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  141. <image v-else src="/static/icons/unmuted_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  142. </view>
  143. <text class="action-text">{{ isMuted ? '取消静音' : '静音' }}</text>
  144. </view>
  145. <view class="action-button" @click="navigateToHistory">
  146. <view class="action-icon">
  147. <image src="/static/icons/action_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  148. </view>
  149. <text class="action-text">视频回看</text>
  150. </view>
  151. </view>
  152. <!-- 告警信息列表 -->
  153. <view class="alerts-section">
  154. <view class="section-title">
  155. <text>告警信息</text>
  156. <view class="alert-badge" v-if="getUnhandledAlerts.length > 0">{{ getUnhandledAlerts.length }}</view>
  157. </view>
  158. <view class="alerts-list" v-if="getUnhandledAlerts.length > 0">
  159. <view
  160. v-for="(item, index) in getUnhandledAlerts"
  161. :key="index"
  162. class="alert-item"
  163. :class="{
  164. 'alert-urgent': item.level === 'high',
  165. 'alert-warning': item.level === 'medium',
  166. 'alert-info': item.level === 'low'
  167. }"
  168. >
  169. <view class="alert-item-icon">
  170. <image v-if="item.level === 'high'" src="/static/icons/warning_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  171. <image v-else-if="item.level === 'medium'" src="/static/icons/info_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  172. <image v-else src="/static/icons/success_icon.png" mode="aspectFit" style="width: 24px; height: 24px;"></image>
  173. </view>
  174. <view class="alert-item-info">
  175. <text class="alert-item-type">{{ item.type }}</text>
  176. <text class="alert-item-level">
  177. {{ item.level === 'high' ? '紧急' : item.level === 'medium' ? '警告' : '提示' }}
  178. </text>
  179. </view>
  180. <view class="alert-item-time">{{ item.time }}</view>
  181. </view>
  182. </view>
  183. <view v-else class="empty-alert">
  184. <text class="empty-text">暂无告警信息</text>
  185. </view>
  186. </view>
  187. </view>
  188. </template>
  189. <script>
  190. export default {
  191. data() {
  192. return {
  193. deviceInfo: {
  194. deviceId: 'DEV1001',
  195. name: '监控设备-1',
  196. status: 'online',
  197. location: '西区B2地块',
  198. lastUpdate: '5分钟前',
  199. streamUrl: 'https://demo-rtsp-server-2h4n.onrender.com/stream.mp4',
  200. alertCount: 3
  201. },
  202. isPlaying: false,
  203. isMuted: false,
  204. isRecording: false,
  205. isFullscreen: false,
  206. isVoiceActive: false,
  207. isGridView: false,
  208. isZoomMode: false,
  209. currentTime: '14:30:25',
  210. // 模拟历史录像数据
  211. recordHistory: [
  212. { id: 1, startTime: '今天 12:30', duration: '00:15:30', url: '' },
  213. { id: 2, startTime: '今天 10:15', duration: '00:05:22', url: '' },
  214. { id: 3, startTime: '昨天 18:45', duration: '00:30:10', url: '' },
  215. { id: 4, startTime: '昨天 14:20', duration: '00:10:05', url: '' }
  216. ],
  217. // 模拟告警数据
  218. alertHistory: [
  219. { id: 1, time: '今天 13:05', type: '移动侦测', status: '未处理', level: 'high' },
  220. { id: 2, time: '今天 09:30', type: '信号异常', status: '未处理', level: 'medium' },
  221. { id: 3, time: '昨天 15:45', type: '设备状态', status: '已处理', level: 'low' },
  222. { id: 4, time: '昨天 10:20', type: '遮挡告警', status: '未处理', level: 'low' }
  223. ],
  224. videoContext: null,
  225. isRefreshing: false
  226. }
  227. },
  228. computed: {
  229. // 获取所有未处理的告警
  230. getUnhandledAlerts() {
  231. return this.alertHistory.filter(alert => alert.status === '未处理');
  232. }
  233. },
  234. onReady() {
  235. // 获取视频实例
  236. this.videoContext = uni.createVideoContext('videoPlayer')
  237. // 设置页面标题
  238. uni.setNavigationBarTitle({
  239. title: this.deviceInfo.name
  240. })
  241. // 模拟更新时间
  242. this.startTimeUpdate()
  243. },
  244. onLoad(options) {
  245. // 如果有传入设备ID,则获取设备信息
  246. if (options && options.id) {
  247. this.fetchDeviceInfo(options.id)
  248. }
  249. },
  250. methods: {
  251. // 获取设备信息
  252. fetchDeviceInfo(deviceId) {
  253. // 这里应该是API请求,暂时用模拟数据
  254. console.log('获取设备信息:', deviceId)
  255. // 模拟异步获取数据
  256. setTimeout(() => {
  257. // 实际应该是API请求结果
  258. }, 500)
  259. },
  260. // 播放/暂停切换
  261. togglePlayState() {
  262. if (!this.isPlaying) {
  263. // 从未播放状态切换到播放状态
  264. this.isPlaying = true;
  265. // 短暂延迟确保视频元素已加载
  266. setTimeout(() => {
  267. if (this.videoContext) {
  268. this.videoContext.play();
  269. // 振动反馈
  270. uni.vibrateShort();
  271. }
  272. }, 300);
  273. } else {
  274. // 从播放状态切换到暂停状态
  275. if (this.videoContext) {
  276. this.videoContext.pause();
  277. // 在页面上显示暂停状态
  278. uni.showToast({
  279. title: '视频已暂停',
  280. icon: 'none',
  281. duration: 1500
  282. });
  283. }
  284. }
  285. },
  286. // 静音切换
  287. toggleMute() {
  288. this.isMuted = !this.isMuted
  289. if (this.videoContext) {
  290. if (this.isMuted) {
  291. this.videoContext.mute()
  292. } else {
  293. this.videoContext.unmute()
  294. }
  295. }
  296. },
  297. // 全屏切换
  298. toggleFullscreen() {
  299. if (!this.isPlaying) {
  300. // 如果视频未播放,先开始播放
  301. this.togglePlayState();
  302. // 延迟执行全屏操作,等待视频元素加载
  303. setTimeout(() => {
  304. if (this.videoContext) {
  305. this.videoContext.requestFullScreen();
  306. this.isFullscreen = true;
  307. }
  308. }, 500);
  309. } else if (this.videoContext) {
  310. if (!this.isFullscreen) {
  311. this.videoContext.requestFullScreen();
  312. } else {
  313. this.videoContext.exitFullScreen();
  314. }
  315. this.isFullscreen = !this.isFullscreen;
  316. }
  317. },
  318. // 切换九宫格视图
  319. toggleGridView() {
  320. this.isGridView = !this.isGridView
  321. uni.showToast({
  322. title: this.isGridView ? '切换到多画面模式' : '切换到单画面模式',
  323. icon: 'none'
  324. })
  325. },
  326. // 截图
  327. takeScreenshot() {
  328. // 模拟截图功能
  329. uni.showLoading({
  330. title: '截图中...'
  331. })
  332. setTimeout(() => {
  333. uni.hideLoading()
  334. uni.showToast({
  335. title: '截图已保存',
  336. icon: 'success'
  337. })
  338. }, 1000)
  339. },
  340. // 语音对讲
  341. toggleVoiceIntercom() {
  342. this.isVoiceActive = !this.isVoiceActive
  343. if (this.isVoiceActive) {
  344. uni.showToast({
  345. title: '语音对讲已开启',
  346. icon: 'none'
  347. })
  348. } else {
  349. uni.showToast({
  350. title: '语音对讲已关闭',
  351. icon: 'none'
  352. })
  353. }
  354. },
  355. // 云台控制
  356. controlPTZ(direction, isStart) {
  357. // 模拟云台控制
  358. if (isStart) {
  359. console.log(`开始控制云台: ${direction}`)
  360. uni.vibrateShort() // 短震动反馈
  361. } else {
  362. console.log(`停止控制云台: ${direction}`)
  363. }
  364. },
  365. // 云台复位
  366. resetPTZ() {
  367. console.log('云台复位')
  368. uni.vibrateShort() // 短震动反馈
  369. uni.showToast({
  370. title: '云台已复位',
  371. icon: 'none'
  372. })
  373. },
  374. // 变焦控制
  375. controlZoom(type, isStart) {
  376. // 模拟变焦控制
  377. if (isStart) {
  378. console.log(`开始控制变焦: ${type}`)
  379. uni.vibrateShort() // 短震动反馈
  380. } else {
  381. console.log(`停止控制变焦: ${type}`)
  382. }
  383. },
  384. // 切换缩放模式
  385. toggleZoom() {
  386. this.isZoomMode = !this.isZoomMode
  387. uni.showToast({
  388. title: this.isZoomMode ? '进入缩放模式' : '退出缩放模式',
  389. icon: 'none'
  390. })
  391. },
  392. // 添加预设位
  393. addPreset() {
  394. uni.showModal({
  395. title: '添加预设位',
  396. content: '是否保存当前位置为预设位?',
  397. success: (res) => {
  398. if (res.confirm) {
  399. uni.showToast({
  400. title: '预设位已保存',
  401. icon: 'success'
  402. })
  403. }
  404. }
  405. })
  406. },
  407. // 处理告警点击
  408. handleAlert(item) {
  409. uni.navigateTo({
  410. url: `/pages/alerts/alert-detail?alertId=${item.id}&deviceId=${this.deviceInfo.deviceId}`
  411. })
  412. },
  413. // 跳转到历史视频页面
  414. navigateToHistory() {
  415. uni.navigateTo({
  416. url: `/pages/video/history?deviceId=${this.deviceInfo.deviceId}`
  417. })
  418. },
  419. // 处理视频错误
  420. handleVideoError(e) {
  421. console.error('视频播放错误:', e)
  422. uni.showToast({
  423. title: '视频播放出错,请稍后再试',
  424. icon: 'none'
  425. })
  426. },
  427. // 更新时间
  428. startTimeUpdate() {
  429. // 模拟时间更新
  430. setInterval(() => {
  431. const now = new Date()
  432. const hours = String(now.getHours()).padStart(2, '0')
  433. const minutes = String(now.getMinutes()).padStart(2, '0')
  434. const seconds = String(now.getSeconds()).padStart(2, '0')
  435. this.currentTime = `${hours}:${minutes}:${seconds}`
  436. }, 1000)
  437. },
  438. // 刷新数据
  439. refreshData() {
  440. this.isRefreshing = true
  441. setTimeout(() => {
  442. this.isRefreshing = false
  443. this.fetchDeviceInfo(this.deviceInfo.deviceId)
  444. }, 1000)
  445. }
  446. }
  447. }
  448. </script>
  449. <style>
  450. /* 基础样式 */
  451. .container {
  452. display: flex;
  453. flex-direction: column;
  454. min-height: 100vh;
  455. background-color: #F8FCF9;
  456. padding-bottom: 30rpx;
  457. }
  458. /* 设备头部样式 */
  459. .device-header {
  460. background-color: #FFFFFF;
  461. border-radius: 20rpx;
  462. padding: 30rpx;
  463. margin: 30rpx 30rpx 30rpx;
  464. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  465. border: 1rpx solid rgba(210, 237, 217, 0.5);
  466. }
  467. .device-info-row {
  468. display: flex;
  469. justify-content: space-between;
  470. align-items: center;
  471. margin-bottom: 28rpx;
  472. }
  473. .device-name-container {
  474. display: flex;
  475. flex-direction: column;
  476. align-items: flex-start;
  477. }
  478. .device-name {
  479. font-size: 36rpx;
  480. color: #333333;
  481. font-weight: 600;
  482. margin-bottom: 12rpx;
  483. }
  484. .status-tag {
  485. padding: 6rpx 16rpx 6rpx 28rpx;
  486. border-radius: 30rpx;
  487. font-size: 24rpx;
  488. font-weight: 500;
  489. flex-shrink: 0;
  490. position: relative;
  491. overflow: hidden;
  492. }
  493. .status-online {
  494. background-color: rgba(76, 175, 80, 0.1);
  495. color: #3BB44A;
  496. }
  497. .status-offline {
  498. background-color: rgba(245, 108, 108, 0.1);
  499. color: #F56C6C;
  500. padding-left: 28rpx;
  501. }
  502. .status-dot {
  503. position: absolute;
  504. width: 6rpx;
  505. height: 6rpx;
  506. background-color: #3BB44A;
  507. border-radius: 50%;
  508. top: 50%;
  509. left: 12rpx;
  510. transform: translateY(-50%);
  511. box-shadow: 0 0 4rpx rgba(76, 175, 80, 0.8);
  512. animation: blink 1.5s infinite;
  513. display: inline-block;
  514. }
  515. .status-dot.offline-dot {
  516. background-color: #F56C6C;
  517. box-shadow: 0 0 4rpx rgba(245, 108, 108, 0.8);
  518. }
  519. @keyframes blink {
  520. 0% {
  521. opacity: 0.4;
  522. }
  523. 50% {
  524. opacity: 1;
  525. }
  526. 100% {
  527. opacity: 0.4;
  528. }
  529. }
  530. .device-meta-row {
  531. display: flex;
  532. flex-direction: column;
  533. background-color: #F9FCFA;
  534. padding: 20rpx 24rpx;
  535. border-radius: 16rpx;
  536. border: 1rpx solid rgba(210, 237, 217, 0.8);
  537. }
  538. .device-meta-item {
  539. display: flex;
  540. align-items: center;
  541. font-size: 28rpx;
  542. margin-top: 18rpx;
  543. }
  544. .device-meta-item:first-child {
  545. margin-top: 0;
  546. }
  547. .meta-icon {
  548. width: 36rpx;
  549. height: 36rpx;
  550. display: flex;
  551. align-items: center;
  552. justify-content: center;
  553. margin-right: 12rpx;
  554. }
  555. .meta-label {
  556. color: #777777;
  557. min-width: 140rpx;
  558. font-size: 28rpx;
  559. }
  560. .meta-value {
  561. color: #333333;
  562. flex: 1;
  563. font-size: 28rpx;
  564. font-weight: 500;
  565. }
  566. /* 视频预览区域 */
  567. .video-section {
  568. margin: 0 30rpx 20rpx;
  569. }
  570. .video-container {
  571. position: relative;
  572. width: 100%;
  573. height: 420rpx; /* 16:9比例 */
  574. background-color: #000000;
  575. border-radius: 16rpx;
  576. overflow: hidden;
  577. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
  578. }
  579. .video-player, .video-placeholder {
  580. width: 100%;
  581. height: 100%;
  582. }
  583. .video-controls {
  584. position: absolute;
  585. top: 0;
  586. left: 0;
  587. width: 100%;
  588. height: 100%;
  589. display: flex;
  590. flex-direction: column;
  591. justify-content: space-between;
  592. padding: 20rpx;
  593. box-sizing: border-box;
  594. background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.4) 100%);
  595. }
  596. .control-row {
  597. display: flex;
  598. justify-content: space-between;
  599. align-items: center;
  600. width: 100%;
  601. }
  602. .top-controls {
  603. height: 80rpx;
  604. }
  605. .center-controls {
  606. height: 120rpx;
  607. justify-content: center;
  608. align-items: center;
  609. }
  610. .bottom-controls {
  611. height: 80rpx;
  612. }
  613. .signal-indicator {
  614. display: flex;
  615. align-items: center;
  616. color: #FFFFFF;
  617. font-size: 24rpx;
  618. background-color: rgba(0, 0, 0, 0.5);
  619. padding: 8rpx 16rpx;
  620. border-radius: 30rpx;
  621. }
  622. .signal-indicator svg {
  623. margin-right: 8rpx;
  624. }
  625. .signal-text {
  626. font-weight: 500;
  627. }
  628. .fullscreen-button {
  629. width: 60rpx;
  630. height: 60rpx;
  631. display: flex;
  632. align-items: center;
  633. justify-content: center;
  634. color: #FFFFFF;
  635. background-color: rgba(0, 0, 0, 0.5);
  636. border-radius: 50%;
  637. transition: all 0.2s;
  638. }
  639. .fullscreen-button:active {
  640. background-color: rgba(76, 175, 80, 0.7);
  641. transform: scale(0.9);
  642. }
  643. .video-time {
  644. color: #FFFFFF;
  645. font-size: 26rpx;
  646. background-color: rgba(0, 0, 0, 0.5);
  647. padding: 6rpx 16rpx;
  648. border-radius: 30rpx;
  649. font-weight: 500;
  650. }
  651. .play-button {
  652. width: 100rpx;
  653. height: 100rpx;
  654. border-radius: 50%;
  655. background-color: rgba(255, 255, 255, 0.9);
  656. display: flex;
  657. align-items: center;
  658. justify-content: center;
  659. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.5);
  660. transition: all 0.2s;
  661. transform: scale(1);
  662. }
  663. .play-button:active {
  664. transform: scale(0.92);
  665. background-color: rgba(255, 255, 255, 1);
  666. }
  667. .center-button-container {
  668. width: 100%;
  669. height: 100%;
  670. display: flex;
  671. align-items: center;
  672. justify-content: center;
  673. }
  674. .pause-icon {
  675. width: 80rpx;
  676. height: 80rpx;
  677. border-radius: 50%;
  678. background-color: rgba(0, 0, 0, 0.5);
  679. display: flex;
  680. align-items: center;
  681. justify-content: center;
  682. opacity: 0;
  683. transition: opacity 0.3s;
  684. }
  685. .center-button-container:active .pause-icon {
  686. opacity: 1;
  687. background-color: rgba(76, 175, 80, 0.7);
  688. }
  689. /* 云台控制区域 */
  690. .ptz-section {
  691. margin: 0 30rpx 20rpx;
  692. background-color: #FFFFFF;
  693. border-radius: 20rpx;
  694. padding: 24rpx;
  695. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
  696. }
  697. .section-title {
  698. font-size: 30rpx;
  699. font-weight: 600;
  700. color: #333333;
  701. margin-bottom: 20rpx;
  702. padding: 0 10rpx;
  703. display: flex;
  704. align-items: center;
  705. }
  706. .alert-badge {
  707. background-color: #F56C6C;
  708. color: #FFFFFF;
  709. font-size: 22rpx;
  710. border-radius: 30rpx;
  711. padding: 2rpx 12rpx;
  712. margin-left: 12rpx;
  713. font-weight: normal;
  714. min-width: 32rpx;
  715. text-align: center;
  716. }
  717. .ptz-container {
  718. display: flex;
  719. flex-direction: column;
  720. align-items: center;
  721. padding: 20rpx 0;
  722. }
  723. .ptz-circle-container {
  724. position: relative;
  725. width: 300rpx;
  726. height: 300rpx;
  727. margin: 20rpx 0;
  728. }
  729. .ptz-arrow {
  730. position: absolute;
  731. width: 70rpx;
  732. height: 70rpx;
  733. display: flex;
  734. align-items: center;
  735. justify-content: center;
  736. background-color: #F0F9F0;
  737. border-radius: 50%;
  738. color: #3BB44A;
  739. font-size: 36rpx;
  740. transition: all 0.2s;
  741. box-shadow: 0 2rpx 10rpx rgba(76, 175, 80, 0.15);
  742. }
  743. .ptz-up {
  744. top: 0;
  745. left: 50%;
  746. transform: translateX(-50%);
  747. }
  748. .ptz-down {
  749. bottom: 0;
  750. left: 50%;
  751. transform: translateX(-50%);
  752. }
  753. .ptz-left {
  754. left: 0;
  755. top: 50%;
  756. transform: translateY(-50%);
  757. }
  758. .ptz-right {
  759. right: 0;
  760. top: 50%;
  761. transform: translateY(-50%);
  762. }
  763. .ptz-center {
  764. position: absolute;
  765. top: 50%;
  766. left: 50%;
  767. transform: translate(-50%, -50%);
  768. width: 90rpx;
  769. height: 90rpx;
  770. display: flex;
  771. align-items: center;
  772. justify-content: center;
  773. background-color: #F0F9F0;
  774. border-radius: 50%;
  775. color: #3BB44A;
  776. font-size: 36rpx;
  777. transition: all 0.2s;
  778. box-shadow: 0 2rpx 10rpx rgba(76, 175, 80, 0.15);
  779. }
  780. .ptz-arrow:active, .ptz-center:active {
  781. background-color: #3BB44A;
  782. transform-origin: center;
  783. }
  784. .ptz-arrow:active svg path, .ptz-center:active svg path {
  785. fill: #FFFFFF;
  786. }
  787. .ptz-up:active {
  788. transform: scale(0.92) translateX(-50%);
  789. }
  790. .ptz-down:active {
  791. transform: scale(0.92) translateX(-50%);
  792. }
  793. .ptz-left:active {
  794. transform: scale(0.92) translateY(-50%);
  795. }
  796. .ptz-right:active {
  797. transform: scale(0.92) translateY(-50%);
  798. }
  799. .ptz-center:active {
  800. transform: translate(-50%, -50%) scale(0.92);
  801. }
  802. .ptz-bottom-controls {
  803. display: flex;
  804. justify-content: space-between;
  805. align-items: center;
  806. width: 300rpx;
  807. margin-top: 30rpx;
  808. }
  809. .ptz-bottom-button {
  810. width: 80rpx;
  811. height: 80rpx;
  812. border-radius: 50%;
  813. background-color: #F0F9F0;
  814. display: flex;
  815. align-items: center;
  816. justify-content: center;
  817. color: #3BB44A;
  818. font-size: 32rpx;
  819. font-weight: 500;
  820. transition: all 0.2s;
  821. box-shadow: 0 2rpx 10rpx rgba(76, 175, 80, 0.1);
  822. }
  823. .ptz-bottom-button:active {
  824. background-color: #3BB44A;
  825. color: #FFFFFF;
  826. transform: scale(0.92);
  827. }
  828. .ptz-bottom-button:active svg path {
  829. fill: #FFFFFF;
  830. }
  831. /* 快捷功能按钮 */
  832. .quick-actions {
  833. display: flex;
  834. justify-content: space-evenly;
  835. margin: 0 30rpx 20rpx;
  836. background-color: #FFFFFF;
  837. border-radius: 20rpx;
  838. padding: 24rpx 30rpx;
  839. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
  840. }
  841. .action-button {
  842. display: flex;
  843. flex-direction: column;
  844. align-items: center;
  845. width: 160rpx;
  846. }
  847. .action-icon {
  848. width: 100rpx;
  849. height: 100rpx;
  850. border-radius: 50%;
  851. background-color: #F0F9F0;
  852. display: flex;
  853. align-items: center;
  854. justify-content: center;
  855. color: #3BB44A;
  856. margin-bottom: 12rpx;
  857. transition: all 0.2s;
  858. box-shadow: 0 4rpx 12rpx rgba(76, 175, 80, 0.1);
  859. }
  860. .action-icon:active {
  861. background-color: #3BB44A;
  862. transform: scale(0.92);
  863. }
  864. .action-icon:active svg path {
  865. fill: #FFFFFF;
  866. }
  867. .action-text {
  868. font-size: 24rpx;
  869. color: #666666;
  870. text-align: center;
  871. }
  872. /* 告警信息列表 */
  873. .alerts-section {
  874. margin: 0 30rpx 30rpx;
  875. background-color: #FFFFFF;
  876. border-radius: 20rpx;
  877. padding: 30rpx 24rpx;
  878. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
  879. border: 1rpx solid rgba(210, 237, 217, 0.5);
  880. }
  881. .section-title {
  882. display: flex;
  883. justify-content: space-between;
  884. align-items: center;
  885. font-size: 32rpx;
  886. font-weight: 600;
  887. color: #333333;
  888. margin-bottom: 24rpx;
  889. padding-bottom: 16rpx;
  890. border-bottom: 2rpx solid #f0f0f0;
  891. }
  892. .alert-badge {
  893. background-color: #F56C6C;
  894. color: #FFFFFF;
  895. font-size: 22rpx;
  896. border-radius: 30rpx;
  897. padding: 2rpx 12rpx;
  898. margin-left: 12rpx;
  899. font-weight: normal;
  900. min-width: 32rpx;
  901. text-align: center;
  902. }
  903. .alerts-list {
  904. display: flex;
  905. flex-direction: column;
  906. }
  907. .alert-item {
  908. display: flex;
  909. align-items: center;
  910. padding: 24rpx 20rpx;
  911. border-radius: 12rpx;
  912. margin-bottom: 16rpx;
  913. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  914. position: relative;
  915. border: 1rpx solid transparent;
  916. transition: transform 0.2s ease;
  917. }
  918. .alert-item:active {
  919. transform: scale(0.98);
  920. }
  921. .alert-urgent {
  922. background-color: #FEF3F3;
  923. border-left: 4rpx solid #F56C6C;
  924. border-color: rgba(245, 108, 108, 0.2);
  925. }
  926. .alert-warning {
  927. background-color: #FFF8E6;
  928. border-left: 4rpx solid #E6A23C;
  929. border-color: rgba(230, 162, 60, 0.2);
  930. }
  931. .alert-info {
  932. background-color: #F2FAF5;
  933. border-left: 4rpx solid #67C23A;
  934. border-color: rgba(103, 194, 58, 0.2);
  935. }
  936. .alert-item-icon {
  937. width: 50rpx;
  938. height: 50rpx;
  939. display: flex;
  940. align-items: center;
  941. justify-content: center;
  942. margin-right: 16rpx;
  943. }
  944. .alert-item-info {
  945. flex: 1;
  946. display: flex;
  947. flex-direction: column;
  948. }
  949. .alert-item-type {
  950. font-size: 28rpx;
  951. color: #333333;
  952. font-weight: 500;
  953. margin-bottom: 8rpx;
  954. }
  955. .alert-item-level {
  956. font-size: 24rpx;
  957. color: #999999;
  958. }
  959. .alert-item-time {
  960. font-size: 24rpx;
  961. color: #999999;
  962. margin-left: 16rpx;
  963. min-width: 100rpx;
  964. text-align: right;
  965. }
  966. .empty-alert {
  967. padding: 60rpx 0;
  968. display: flex;
  969. justify-content: center;
  970. align-items: center;
  971. }
  972. .empty-text {
  973. font-size: 28rpx;
  974. color: #999999;
  975. }
  976. /* 刷新按钮样式 */
  977. .refresh-btn {
  978. width: 48rpx;
  979. height: 48rpx;
  980. background-color: rgba(76, 175, 80, 0.1);
  981. border-radius: 50%;
  982. display: flex;
  983. align-items: center;
  984. justify-content: center;
  985. padding: 12rpx;
  986. transition: transform 0.3s ease;
  987. }
  988. .refresh-btn:active {
  989. transform: rotate(180deg);
  990. }
  991. .refresh-btn.refreshing {
  992. animation: spin 1.2s linear infinite;
  993. }
  994. @keyframes spin {
  995. 0% {
  996. transform: rotate(0deg);
  997. }
  998. 100% {
  999. transform: rotate(360deg);
  1000. }
  1001. }
  1002. </style>