| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <template>
- <view class="webview">
- <web-view :src="url" id="webcon">
- </web-view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- url: '',
- device_id: '',
- accessToken: ''
- }
- },
- onLoad(options) {
- this.device_id = options.device_id
- this.accessToken = options.accessToken
- console.log(options)
- this.getWebviewPage()
- },
- methods: {
- getWebviewPage(id) {
- this.url = "/static/h5.html"
- uni.setStorage({
- key: 'obj',
- data: JSON.stringify({
- device_id: this.device_id,
- accessToken: this.accessToken
- })
- })
- //设置 webview 界面的状态栏的 title
- uni.setNavigationBarTitle({
- title: '监控详情'
- });
- }
- }
- }
- </script>
- <style>
- .webview {
- width: 100vw;
- height: 100vh;
- }
- </style>
|