"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[458],{3268:function(e,a,l){var i=l(8774),n=l(2688),c=l(5861),r=l(9439),s=l(7294),_=l(1515),o=l(2954),t=l.n(o),d={videoPage:"index-module__videoPage___d9FmT",cameraGrid:"index-module__cameraGrid___kQiWQ",cameraCard:"index-module__cameraCard___BFEyk",cameraThumb:"index-module__cameraThumb___jBQdg",cameraPlaceholder:"index-module__cameraPlaceholder___U7Lfv",cameraOverlay:"index-module__cameraOverlay___pK34w",liveDot:"index-module__liveDot___VGgTh",liveDotGray:"index-module__liveDotGray___BCWv7",cameraResolution:"index-module__cameraResolution___jprtt",cameraInfo:"index-module__cameraInfo___l2jtw",cameraName:"index-module__cameraName___kJ2QN",cameraMeta:"index-module__cameraMeta___q8HB3",metaItem:"index-module__metaItem___O3wMK",playBtn:"index-module__playBtn___oJq08",clipsSection:"index-module__clipsSection___zmxbL",sectionTitle:"index-module__sectionTitle___AX0wA",clipList:"index-module__clipList___blWyX",clipItem:"index-module__clipItem___TE25V",clipLeft:"index-module__clipLeft___JynVh",clipIcon:"index-module__clipIcon___BGMMD",clipInfo:"index-module__clipInfo___xAJG1",clipName:"index-module__clipName___E2L1k",clipTime:"index-module__clipTime___gr7FD",clipDuration:"index-module__clipDuration___eFvCA",clipTitleRow:"index-module__clipTitleRow___iI2Cp",clipTag:"index-module__clipTag___RCPRO",clipTagAlarm:"index-module__clipTagAlarm___knf_J",clipTagManual:"index-module__clipTagManual___fX0Ib",clipTagSchedule:"index-module__clipTagSchedule___m8k1n",clipMetaRow:"index-module__clipMetaRow___yn2Bu",clipMetaText:"index-module__clipMetaText___VEZ8H",loadingWrap:"index-module__loadingWrap___c_Sd0",loadingText:"index-module__loadingText___Lzx3O",errorWrap:"index-module__errorWrap___s35C1",errorIcon:"index-module__errorIcon___G2RuY",errorText:"index-module__errorText___o7uHv",retryBtn:"index-module__retryBtn___psW_t",emptyWrap:"index-module__emptyWrap___Dsvh3",emptyIcon:"index-module__emptyIcon___CWXZP",emptyText:"index-module__emptyText___VQYBW"},m=l(9817),x=l(8106),u=l(151),p=l(5893),h=function(){var e=(0,s.useState)([]),a=(0,r.Z)(e,2),l=a[0],i=a[1],h=(0,s.useState)([]),v=(0,r.Z)(h,2),g=v[0],j=v[1],N=(0,s.useState)(!0),T=(0,r.Z)(N,2),f=T[0],G=T[1],y=(0,s.useState)(""),I=(0,r.Z)(y,2),w=I[0],R=I[1],b=(0,s.useCallback)((0,c.Z)((0,n.Z)().m(function e(){var a,l,c,s,_;return(0,n.Z)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,R(""),e.n=1,Promise.all([(0,m.sp)().catch(function(){return[]}),(0,m.Ki)({limit:10}).catch(function(){return[]})]);case 1:a=e.v,l=(0,r.Z)(a,2),c=l[0],s=l[1],i(c),j(s),e.n=3;break;case 2:e.p=2,_=e.v,console.error("[Video] \u6570\u636e\u52a0\u8f7d\u5931\u8d25:",_),R(_ instanceof Error?_.message:"\u6570\u636e\u52a0\u8f7d\u5931\u8d25");case 3:return e.p=3,G(!1),e.f(3);case 4:return e.a(2)}},e,null,[[0,2,3,4]])})),[]);(0,s.useEffect)(function(){b()},[b]),(0,o.useDidShow)(function(){l.length>0&&b()}),(0,o.usePullDownRefresh)(function(){b().then(function(){return t().stopPullDownRefresh()})});var B=function(e){e.isOnline?t().navigateTo({url:"/pages/video/player/index?id=".concat(e.id,"&name=").concat(encodeURIComponent(e.name))}):t().showToast({title:"\u6444\u50cf\u5934\u79bb\u7ebf",icon:"none"})},C=function(e){var a=e.playbackUrl||e.url;a?t().navigateTo({url:"/pages/video/player/index?url=".concat(encodeURIComponent((0,x.Kk)(a)),"&name=").concat(encodeURIComponent("\u5f55\u50cf\u56de\u653e"))}):t().showToast({title:"\u5f55\u50cf\u6682\u4e0d\u53ef\u7528",icon:"none"})};return f?(0,p.jsx)(_.G7,{className:d.videoPage,children:(0,p.jsx)(_.G7,{className:d.loadingWrap,children:(0,p.jsx)(_.xv,{className:d.loadingText,children:"\u52a0\u8f7d\u4e2d..."})})}):w?(0,p.jsx)(_.G7,{className:d.videoPage,children:(0,p.jsxs)(_.G7,{className:d.errorWrap,children:[(0,p.jsx)(_.xv,{className:d.errorIcon,children:"\u26a0\ufe0f"}),(0,p.jsx)(_.xv,{className:d.errorText,children:w}),(0,p.jsx)(_.G7,{className:d.retryBtn,onClick:b,children:(0,p.jsx)(_.xv,{style:{color:"#fff"},children:"\u91cd\u8bd5"})})]})}):(0,p.jsx)(_.G7,{className:d.videoPage,children:(0,p.jsx)(_.pf,{scrollY:!0,style:{height:"calc(100vh - 120rpx)"},children:0===l.length&&0===g.length?(0,p.jsxs)(_.G7,{className:d.emptyWrap,children:[(0,p.jsx)(_.xv,{className:d.emptyIcon,children:"\ud83d\udcf9"}),(0,p.jsx)(_.xv,{className:d.emptyText,children:"\u6682\u65e0\u89c6\u9891\u8bbe\u5907"})]}):(0,p.jsxs)(p.Fragment,{children:[l.length>0&&(0,p.jsx)(_.G7,{className:d.cameraGrid,children:l.map(function(e){return(0,p.jsxs)(_.G7,{className:d.cameraCard,onClick:function(){return B(e)},children:[(0,p.jsxs)(_.G7,{className:d.cameraThumb,children:[(0,p.jsx)(_.xv,{className:d.cameraPlaceholder,children:"\ud83d\udcf9"}),(0,p.jsxs)(_.G7,{className:d.cameraOverlay,children:[(0,p.jsx)(_.G7,{className:"".concat(d.liveDot," ").concat(e.isOnline?"":d.liveDotGray)}),(0,p.jsx)(_.xv,{children:e.isOnline?"LIVE":"\u79bb\u7ebf"})]}),e.resolution&&(0,p.jsx)(_.G7,{className:d.cameraResolution,children:e.resolution}),e.isOnline&&(0,p.jsx)(_.G7,{className:d.playBtn,children:(0,p.jsx)(_.xv,{children:"\u25b6"})})]}),(0,p.jsxs)(_.G7,{className:d.cameraInfo,children:[(0,p.jsx)(_.xv,{className:d.cameraName,children:e.name}),(0,p.jsxs)(_.G7,{className:d.cameraMeta,children:[(0,p.jsxs)(_.xv,{className:d.metaItem,children:["\u7f16\u7801: ",e.code]}),e.position&&(0,p.jsxs)(_.xv,{className:d.metaItem,children:["\ud83d\udccd ",e.position]})]})]})]},e.id)})}),g.length>0&&(0,p.jsxs)(_.G7,{className:d.clipsSection,children:[(0,p.jsx)(_.xv,{className:d.sectionTitle,children:"\u5f55\u50cf\u56de\u653e"}),(0,p.jsx)(_.G7,{className:d.clipList,children:g.map(function(e){var a="alarm"===e.trigger?"\u544a\u8b66":"manual"===e.trigger?"\u624b\u52a8":"schedule"===e.trigger?"\u5b9a\u65f6":"",l="alarm"===e.trigger?d.clipTagAlarm:"manual"===e.trigger?d.clipTagManual:d.clipTagSchedule;return(0,p.jsxs)(_.G7,{className:d.clipItem,onClick:function(){return C(e)},children:[(0,p.jsxs)(_.G7,{className:d.clipLeft,children:[(0,p.jsx)(_.xv,{className:d.clipIcon,children:"\ud83c\udf9e\ufe0f"}),(0,p.jsxs)(_.G7,{className:d.clipInfo,children:[(0,p.jsxs)(_.G7,{className:d.clipTitleRow,children:[(0,p.jsxs)(_.xv,{className:d.clipName,children:["\u6444\u50cf\u5934 #",e.cameraId]}),a&&(0,p.jsx)(_.G7,{className:"".concat(d.clipTag," ").concat(l),children:(0,p.jsx)(_.xv,{children:a})})]}),(0,p.jsx)(_.xv,{className:d.clipTime,children:(0,u.o0)(e.startTime||e.startAt)}),(0,p.jsxs)(_.G7,{className:d.clipMetaRow,children:[e.resolution&&(0,p.jsx)(_.xv,{className:d.clipMetaText,children:e.resolution}),e.sizeBytes&&(0,p.jsxs)(_.xv,{className:d.clipMetaText,children:["\xb7 ",(0,u.sS)(e.sizeBytes)]})]})]})]}),(e.durationSec||e.duration)&&(0,p.jsx)(_.xv,{className:d.clipDuration,children:(0,u.LU)(e.durationSec||e.duration||0)})]},e.id)})})]})]})})})},v=h,g={navigationBarTitleText:"\u89c6\u9891\u76d1\u63a7",enablePullDownRefresh:!0},j=(0,i.R4)(v,"pages/video/index",{root:{cn:[]}},g||{});v&&v.behaviors&&(j.behaviors=(j.behaviors||[]).concat(v.behaviors));Page(j)}},function(e){var a=function(a){return e(e.s=a)};e.O(0,[107,216,592],function(){return a(3268)});e.O()}]);