Supervisory_keep.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view>
  3. <view class="action">
  4. <text>{{deviceName}}</text>
  5. </view>
  6. <view class="look">
  7. <live-player :src="address" autoplay @error="wbg"></live-player>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import {direct} from '../api/Supervisory/Supervisory.js'
  13. export default {
  14. data() {
  15. return {
  16. address:'rtmp://106.52.134.22/live/34020000002000000001@34020000001320000011',
  17. deviceName:'',
  18. lampPoleLocation:''
  19. };
  20. },
  21. methods:{
  22. perror(e){
  23. console.log(e)
  24. },
  25. wbg(e){
  26. console.log(e.detail)
  27. }
  28. },
  29. onLoad(e) {
  30. var index = e.index
  31. var index2 = e.index2
  32. direct().then(res =>{
  33. if(res.code == 200){
  34. const data = res.data[index].cameraList[index2]
  35. // this.address = data.monitorAddress
  36. this.deviceName = data.deviceName
  37. this.lampPoleLocation = data.lampPoleLocation
  38. }
  39. })
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. .action{
  45. width: 750rpx;
  46. height: 110rpx;
  47. font-size: 40rpx;
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. background-color: #dedada;
  52. }
  53. .look{
  54. width: 750rpx;
  55. height: 400rpx;
  56. live-player{
  57. width: 100%;
  58. height: 100%;
  59. }
  60. }
  61. </style>