webview.vue 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.url = "http://192.168.0.117:8003/wechat?device_id=" + this.device_id + "&accessToken=" + this.accessToken
  20. this.url = "https://wx.hnyfwlw.com/wexin/index.html?device_id=" + this.device_id + "&accessToken=" + this.accessToken
  21. // this.url = "http://192.168.2.167:5500/index.html?device_id=" + this.device_id + "&accessToken=" + this.accessToken
  22. // this.url = "https://demo.nyzhwlw.com/wechat?device_id=" + this.device_id + "&accessToken=" + this.accessToken
  23. //设置 webview 界面的状态栏的 title
  24. uni.setNavigationBarTitle({
  25. title: '监控详情'
  26. });
  27. },
  28. methods: {
  29. }
  30. }
  31. </script>
  32. <style>
  33. .webview {
  34. width: 100vw;
  35. height: 100vh;
  36. }
  37. </style>