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