webview.vue 855 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view class="webview">
  3. <web-view :src="url" id="webcon">
  4. </web-view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. url: '',
  12. device_id: '',
  13. accessToken: ''
  14. }
  15. },
  16. onLoad(options) {
  17. this.device_id = options.device_id
  18. this.accessToken = options.accessToken
  19. this.getWebviewPage()
  20. },
  21. methods: {
  22. getWebviewPage(id) {
  23. this.url = "/static/h5.html?device_id="+this.device_id+"&accessToken="+this.accessToken
  24. // uni.setStorage({
  25. // key: 'obj',
  26. // data: JSON.stringify({
  27. // device_id: this.device_id,
  28. // accessToken: this.accessToken
  29. // })
  30. // })
  31. //设置 webview 界面的状态栏的 title
  32. uni.setNavigationBarTitle({
  33. title: '监控详情'
  34. });
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. .webview {
  41. width: 100vw;
  42. height: 100vh;
  43. }
  44. </style>