index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='视频监控'></cus-header>
  4. <div class="nums">
  5. <div class="pre">摄像机:<span class="mr">{{8}}</span></div>
  6. <div class="pre">正常:<span class="zc">{{20}}</span></div>
  7. <div class="pre">离线:<span class="lx">{{1}}</span></div>
  8. </div>
  9. <div class="boxs" v-if="list.length">
  10. <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  11. <div class="image">
  12. <div class="online" :style="{'background-image':'url('+imgBase+'home/video_example.png)'}" v-if="item.status==1">
  13. <image :src="imgBase+'home/video_play.png'"></image>
  14. </div>
  15. <div class="unline" v-else-if="item.status==2">
  16. <image :src="imgBase+'home/video_unline.png'"></image>
  17. <text>设备离线</text>
  18. </div>
  19. </div>
  20. <div class="info">
  21. <div class="text">{{item.title}}</div>
  22. <div class="tip">设备序列号:{{item.no}}</div>
  23. </div>
  24. </div>
  25. </div>
  26. <template v-else>
  27. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  28. </template>
  29. </view>
  30. </template>
  31. <script>
  32. import pageEmpty from '@/components/pageEmpty/index.vue'
  33. export default {
  34. components:{
  35. pageEmpty
  36. },
  37. data(){
  38. return {
  39. list:[
  40. {
  41. title:'研发大厅',
  42. no:'E49771728',
  43. status:1
  44. },
  45. {
  46. title:'前台',
  47. no:'E49771728',
  48. status:2
  49. },
  50. {
  51. title:'室外大门',
  52. no:'E49771728',
  53. status:1
  54. },
  55. {
  56. title:'研发大厅',
  57. no:'E49771728',
  58. status:1
  59. },
  60. {
  61. title:'研发大厅',
  62. no:'E49771728',
  63. status:1
  64. },
  65. {
  66. title:'室外仓库',
  67. no:'E49771728',
  68. status:1
  69. }
  70. ]
  71. }
  72. },
  73. methods:{
  74. toDetail(item){
  75. uni.navigateTo({
  76. url:'/pagesHome/video/detail'
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped lang="less">
  83. .page{
  84. width: 100%;
  85. padding: 0 24rpx 20rpx;
  86. box-sizing: border-box;
  87. background: #F4F8FB;
  88. .nums{
  89. width: 100%;
  90. background: #FFFFFF;
  91. border-radius: 16rpx;
  92. padding: 37rpx 24rpx;
  93. box-sizing: border-box;
  94. display: flex;
  95. margin-top: 20rpx;
  96. .pre{
  97. width: calc(100% / 3);
  98. font-family: PingFangSC, PingFang SC;
  99. font-weight: 400;
  100. font-size: 30rpx;
  101. color: #4E5969;
  102. line-height: 36rpx;
  103. text-align: left;
  104. span{
  105. font-family: PingFang-SC, PingFang-SC;
  106. font-weight: bold;
  107. font-size: 32rpx;
  108. line-height: 36rpx;
  109. text-align: left;
  110. &.mr{
  111. color: #1D2129;
  112. }
  113. &.zc{
  114. color: #14CC8C;
  115. }
  116. &.lx{
  117. color: #F95050;
  118. }
  119. }
  120. }
  121. }
  122. .boxs{
  123. width: 100%;
  124. display: flex;
  125. flex-wrap: wrap;
  126. justify-content: space-between;
  127. .box{
  128. width: calc(50% - 11rpx);
  129. margin-top: 20rpx;
  130. .image{
  131. width: 100%;
  132. height: 230rpx;
  133. border-radius: 16rpx 16rpx 0rpx 0rpx;
  134. &>div{
  135. width: 100%;
  136. height: 100%;
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. border-radius: 16rpx 16rpx 0rpx 0rpx;
  141. }
  142. .online{
  143. background-size: 100% 100%;
  144. background-repeat: no-repeat;
  145. image{
  146. width: 64rpx;
  147. height: 64rpx;
  148. }
  149. }
  150. .unline{
  151. display: flex;
  152. flex-direction: column;
  153. background: #657588;
  154. image{
  155. width: 48rpx;
  156. height: 48rpx;
  157. }
  158. text{
  159. font-family: PingFangSC, PingFang SC;
  160. font-weight: 400;
  161. font-size: 24rpx;
  162. color: #FFFFFF;
  163. line-height: 36rpx;
  164. margin-top: 20rpx;
  165. }
  166. }
  167. }
  168. .info{
  169. width: 100%;
  170. padding: 24rpx 20rpx;
  171. box-sizing: border-box;
  172. background: #FFFFFF;
  173. .text{
  174. font-family: PingFang-SC, PingFang-SC;
  175. font-weight: bold;
  176. font-size: 30rpx;
  177. color: #1D2129;
  178. line-height: 30rpx;
  179. text-align: left;
  180. overflow: hidden;
  181. text-overflow: ellipsis;
  182. white-space: nowrap;
  183. }
  184. .tip{
  185. font-family: PingFangSC, PingFang SC;
  186. font-weight: 400;
  187. font-size: 24rpx;
  188. color: #999999;
  189. line-height: 24rpx;
  190. text-align: left;
  191. margin-top: 20rpx;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. </style>