webview.vue 623 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <web-view :src="src"></web-view>
  3. </template>
  4. <script>
  5. import {getVideoInfo} from '@/api/system.js'
  6. export default {
  7. data() {
  8. return {
  9. src:'',
  10. title:"",
  11. h5:'https://hchzhhnm.xarbkj.net/camera/index.html'
  12. }
  13. },
  14. onLoad({id,title}) {
  15. this.showCamera(id)
  16. this.title=title
  17. uni.setNavigationBarTitle({
  18. title:title||'loading……'
  19. })
  20. },
  21. methods: {
  22. showCamera(cameraId){
  23. getVideoInfo(cameraId).then((res)=>{
  24. let cameraHttp=res.data.cameraHttp;
  25. this.src=`${this.h5}?href=${cameraHttp}&title=${this.title}`
  26. })
  27. },
  28. }
  29. }
  30. </script>
  31. <style>
  32. </style>