alarmInfoMonitor.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!-- 停用 -->
  2. <template>
  3. <view class="monitor">
  4. <view class="monitor_n">
  5. <scroll-view class="scroll1" scroll-x="true">
  6. <view :class="currentTab==index ? 'select' : 'select1'" v-for="(item,index) in barNameList" :key="index" :data-current="index" @click="ontabtap(item,$event)">
  7. {{item.name}}
  8. </view>
  9. </scroll-view>
  10. <view class="monitor_n_b">
  11. <video
  12. v-for="(item,index) in urlList" :key="index" :id="urlList.id" :src="item.url"
  13. :poster="videoCover"
  14. :custom-cache='false' :autoplay="true" :controls="true"
  15. :enable-danmu="false" :muted="true" :show-fullscreen-btn="true"
  16. :show-center-play-btn="false" :show-play-btn="false"
  17. @error="videoErrorCallback" >
  18. </video>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { config,} from '@/api/request/config.js'
  25. import {GetStartList} from '@/api/index.js'
  26. export default {
  27. data() {
  28. return {
  29. videoCover:uni.getStorageSync('videoCover'),
  30. currentTab: 0,
  31. form:{
  32. },
  33. urlList:[],
  34. barNameList:[
  35. {
  36. name:'楼道监控1',
  37. },
  38. {
  39. name:'实验室监控1',
  40. },
  41. {
  42. name:'实验室监控1',
  43. },
  44. {
  45. name:'实验室监控1',
  46. },
  47. {
  48. name:'实验室监控1',
  49. },
  50. {
  51. name:'实验室监控1',
  52. },
  53. ],
  54. }
  55. },
  56. onLoad(option) {
  57. this.GetStartList();
  58. },
  59. onShow(){
  60. },
  61. methods:{
  62. //点击tab切换
  63. ontabtap:function(item,e) {
  64. var _this = this;
  65. if (this.currentTab === e.target.dataset.current) {
  66. return false;
  67. } else {
  68. this.currentTab = e.target.dataset.current
  69. }
  70. // this.hardware.forEach(function(item,index){
  71. // if(data.id==item.id){
  72. // _this.jinanGetStartList(_this.hardwareNUM[index])
  73. // }
  74. // })
  75. },
  76. //查询摄像头地址(交大)
  77. async GetStartList(deviceIds){
  78. let obj = {
  79. page:'1',
  80. count:'1',
  81. //deviceIds:deviceIds
  82. deviceIds:'4401020049200000000100209'
  83. };
  84. const {data} = await GetStartList(obj);
  85. if(data.code == 200){
  86. let list = [];
  87. for(let i=0;i<data.data.length;i++){
  88. let text = uni.getStorageSync('cameraUrl');
  89. let url = data.data[i].hls;
  90. url = url.split("rtp/");
  91. let newUrl = text+'rtp/'+url[1];
  92. let obj = {
  93. id:data.data[i].deviceID,
  94. url:newUrl,
  95. }
  96. list.push(obj)
  97. console.log("obj",obj)
  98. }
  99. this.urlList = list;
  100. }
  101. },
  102. },
  103. }
  104. </script>
  105. <style lang="stylus" scoped>
  106. .monitor{
  107. height:100%;
  108. width:100%;
  109. display:flex;
  110. flex-direction:column;
  111. .monitor_n{
  112. width:710rpx;
  113. margin: 20rpx;
  114. background: #FFFFFF;
  115. border-radius: 20rpx;
  116. padding: 20rpx 22rpx 40rpx;
  117. box-sizing: border-box;
  118. .scroll1 {
  119. width: 100%;
  120. white-space: nowrap;
  121. border-bottom: 1px solid #e0e0e0;
  122. & view {
  123. white-space: normal;
  124. display: inline-block;
  125. height: 60rpx;
  126. font-size: 28rpx;
  127. font-family: PingFang SC;
  128. font-weight: 500;
  129. color: #333333;
  130. line-height: 60rpx;
  131. margin-right: 34rpx;
  132. }
  133. & view:first-child:before {
  134. display: none;
  135. }
  136. .select {
  137. font-size: 28rpx;
  138. font-family: PingFang SC;
  139. font-weight: 500;
  140. color: #0183FA;
  141. line-height: 60rpx;
  142. }
  143. .select1 {
  144. color: #333333;
  145. }
  146. }
  147. .monitor_n_b{
  148. width: 666rpx;
  149. height: 347rpx;
  150. margin-top: 16rpx;
  151. overflow-y scroll;
  152. video{
  153. width:666rpx;
  154. height:347rpx;
  155. }
  156. }
  157. }
  158. }
  159. /deep/.input-value-border{
  160. display :none !important;
  161. }
  162. </style>