123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="content">
- <view class="status_bar">
-
- </view>
- <web-view :src="url" :fullscreen='false'></web-view>
- </view>
- </template>
- <script>
- var wv
- export default {
- data() {
- return {
- title: 'ehsd',
- url: 'http://106.54.243.161:10010/#/',
- src: "",
- canBack: false,
- }
- },
- onBackPress() {
- if (wv && this.canBack) {
- wv.back();
- return true;
- }
- return false;
- },
- onReady() {
-
- var self = this;
- var currentWebview = this.$scope.$getAppWebview();
-
- setTimeout(function() {
- wv = currentWebview.children()[0];
- wv.addEventListener(
- "progressChanged",
- function(e) {
- wv.canBack(function(e) {
- self.canBack = e.canBack;
- });
- },
- false
- );
- }, 500);
-
- },
- onLoad() {
- var height = 0;
- uni.getSystemInfo({
-
- success: (sysinfo) => {
- console.log(sysinfo)
- height = sysinfo.windowHeight;
- },
- complete: () => {}
- });
- let info = uni.getSystemInfoSync();
- let top = info.statusBarHeight;
- console.log(info, 12312312312);
- var currentWebview = this.$scope.$getAppWebview();
- setTimeout(function() {
- var wv = currentWebview.children()[0];
- wv.setStyle({
- top: top,
-
- height: height - top,
- scalable: false,
- })
-
-
-
-
-
-
- }, 1000);
- methods: {
- }
- }
- }
- </script>
- <style>
- .content {}
- .status_bar {
- height: var(--status-bar-height);
- width: 100%;
- }
- </style>sss
|