webview.vue 671 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view class="webview">
  3. <web-view :src="url" id="webcon" @message="handleMessage">
  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.url = "https://wx.hnyfwlw.com/wechat?device_id=" + this.device_id + "&accessToken=" + this.accessToken
  20. //设置 webview 界面的状态栏的 title
  21. uni.setNavigationBarTitle({
  22. title: '监控详情'
  23. });
  24. },
  25. methods: {
  26. }
  27. }
  28. </script>
  29. <style>
  30. .webview {
  31. width: 100vw;
  32. height: 100vh;
  33. }
  34. </style>