123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <template>
- <view class="app-container">
- <view
- v-if="iframeloading"
- class="loadding-box"
- :style="{
- height: wvHeight + 'px',
- width: wvWidth + 'px',
- marginTop: wvTop + 'px',
- border: 'none',
- background: '#000',
- }"
- >
- <u-loading-icon></u-loading-icon>
- </view>
- <iframe
- v-if="PageCur == 'tun2D'"
- ref="iframe"
- src="http://182.92.126.35:8098/"
- @load="viewLoad"
- :style="{
- height: wvHeight + 'px',
- width: wvWidth + 'px',
- marginTop: wvTop + 'px',
- border: 'none',
- background: '#000',
- }"
- ></iframe>
- <Device
- v-if="PageCur == 'device'"
- :style="{ marginTop: wvTop + 20 + 'px' }"
- ></Device>
- <filecenter :cur="PageCur" v-if="PageCur == 'filecenter'"></filecenter>
- <warndata v-if="PageCur == 'warndata'" :cur="PageCur"></warndata>
- <gasreport :cur="PageCur" v-if="PageCur == 'gasreport'"></gasreport>
- <u-tabbar
- :value="PageCur"
- @change="NavChange"
- :fixed="true"
- :placeholder="true"
- :safeAreaInsetBottom="true"
- >
- <u-tabbar-item
- text="通风系统图"
- name="tun2D"
- icon="list-dot"
- ></u-tabbar-item>
- <u-tabbar-item
- text="设备中心"
- name="device"
- icon="calendar"
- ></u-tabbar-item>
- <u-tabbar-item
- text="预警分析"
- name="warndata"
- icon="plus-circle"
- ></u-tabbar-item>
- <u-tabbar-item
- text="文件共享"
- name="filecenter"
- icon="file-text"
- ></u-tabbar-item>
- <u-tabbar-item
- text="瓦斯日报"
- name="gasreport"
- icon="bell"
- ></u-tabbar-item>
- </u-tabbar>
- </view>
- </template>
- <script>
- import { nextTick } from "vue";
- import Device from "../device/index.vue";
- export default {
- components: {
- Device,
- },
- data() {
- return {
- isLandScape: "",
- PageCur: "tun2D",
- tun3DPage: null,
- wvHeight: getApp().globalData.windowHeight,
- wvWidth: getApp().globalData.windowWidth,
- wvTop: 0,
- iframeloading: true,
- };
- },
- onLoad() {
- this.changeWV();
- },
- mounted() {},
- onShow() {
- // this.changeWV()
- },
- onResize() {
- this.changeWV();
- },
- methods: {
- NavChange: function (e) {
- this.PageCur = e;
- if (e == "tun2D") {
- // this.changeWV()
- this.iframeloading = true;
- }
- },
- viewLoad(event) {
- const _this = this;
- setTimeout(() => {
- _this.iframeloading = false;
- }, 2000);
- },
- changeWV() {
- const _this = this;
- uni.getSystemInfo({
- // 获取当前设备的具体信息
- success: (sysinfo) => {
- if (sysinfo.windowWidth > sysinfo.windowHeight) {
- // 横屏
- _this.isLandScape = true;
- } else {
- // 竖屏
- _this.isLandScape = false;
- }
- _this.wvTop = _this.isLandScape ? 0 : sysinfo.statusBarHeight + 20;
- _this.wvHeight = _this.isLandScape
- ? sysinfo.windowHeight - sysinfo.statusBarHeight - 20
- : sysinfo.windowHeight -
- sysinfo.statusBarHeight -
- sysinfo.statusBarHeight -
- 38;
- _this.wvWidth = _this.isLandScape
- ? sysinfo.windowWidth
- : sysinfo.windowWidth;
- console.log("屏幕模式--->", _this.isLandScape ? "横屏" : "竖屏");
- console.log(_this.wvTop, _this.wvWidth, _this.wvHeight);
- },
- });
- },
- },
- };
- </script>
- <style>
- .app-container {
- width: 100%;
- height: 100%;
- }
- .loadding-box {
- position: absolute;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|