Jelajahi Sumber

程序运行到后端后再打开白屏问题
顶部标题栏风格统一

msx 4 hari lalu
induk
melakukan
701486ec19

+ 5 - 1
pages/device/index.vue

@@ -1,7 +1,9 @@
 <template>
 	<view>
 		<!-- 建议放在外层 -->
-		<u-navbar title="设备中心" @leftClick="devicemenuShow" :safeAreaInsetTop="true">
+		<u-navbar 
+      :bgStatusImage="backPic0"
+      :bgImage="backPic" title="设备中心" @leftClick="devicemenuShow" :safeAreaInsetTop="true">
 			<view class="u-nav-slot" slot="left">
 				<u-icon name="list" size="20"> </u-icon>
 			</view>
@@ -31,6 +33,8 @@ export default {
 	},
 	data() {
 		return {
+			backPic0: "url(/static/topnavbar0.png)",
+			backPic: "url(../../static/topnavbar.png)",
 			PageCur: "0",
 			showColum: {},
 			menushow: false,

+ 1 - 1
pages/filecenter/filecenter.vue

@@ -16,7 +16,7 @@
     </view> -->
     <view v-if="!menushow" class="container">
       <view class="main">
-        <view class="fileArea" style="margin-top: 15px">
+        <view class="fileArea" style="margin-top: 28px">
           <view style="margin-top: 15px; margin-left: 10px" class="fileTitle"
             >文件名称</view
           >

+ 6 - 2
pages/gasreport/gasreport.vue

@@ -1,6 +1,8 @@
 <template>
     <view class="gas-report" name="gasreport">
-        <u-navbar :title="gasTitle" :safeAreaInsetTop="true" leftIcon="list" @leftClick="handlerToggle"> </u-navbar>
+        <u-navbar
+      :bgStatusImage="backPic0"
+      :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon="list" @leftClick="handlerToggle"> </u-navbar>
         <view class="gas-content">
             <component :is="loadComponent" :firstAddress="firstAddress" :secondAddress="secondAddress"
                 :firstTj="firstTj" :secondTj="secondTj"></component>
@@ -30,7 +32,9 @@ export default {
     },
     data() {
         return {
-            gasTitle: '',//标题
+            backPic0: "url(/static/topnavbar0.png)",
+            backPic: "url(../../static/topnavbar.png)",
+            gasTitle: '瓦斯日报',//标题
             showModel: false,//是否打开弹出层
             // loadComponent: 'gasFill',//默认加载组件
             loadComponent: 'gasImgIdentify',//默认加载组件

+ 39 - 61
pages/index/index.vue

@@ -10,7 +10,7 @@
         border: 'none',
       }"
     >
-      <!-- <u-loading-icon></u-loading-icon> -->
+      <u-loading-icon></u-loading-icon>
     </view>
     <iframe
       v-if="PageCur == 'tun2D'"
@@ -25,14 +25,14 @@
         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>
-    <user :cur="PageCur" v-if="PageCur == 'user'"></user>
+   <Device
+     v-show="PageCur == 'device'"
+     :style="{ marginTop: wvTop + 20 + 'px' }"
+   ></Device>
+   <filecenter :cur="PageCur" v-show="PageCur == 'filecenter'"></filecenter>
+   <warndata v-show="PageCur == 'warndata'" :cur="PageCur"></warndata>
+   <gasreport :cur="PageCur" v-show="PageCur == 'gasreport'"></gasreport>
+   <user :cur="PageCur" v-show="PageCur == 'user'"></user>
     <u-tabbar
       :value="PageCur"
       @change="NavChange"
@@ -40,51 +40,27 @@
       :placeholder="true"
       :safeAreaInsetBottom="true"
     >
-      <u-tabbar-item
-        v-for="(item, index) in permission"
-        :key="index"
-        :text="item.meta.title"
-        :name="item.component"
-        :icon="
-          (index = 0
-            ? 'list-dot'
-            : index == 1
-            ? 'calendar'
-            : index == 2
-            ? 'plus-circle'
-            : index == 3
-            ? 'file-text'
-            : index == 4
-            ? 'bell'
-            : 'list-dot')
-        "
-      ></u-tabbar-item>
-      <!--  <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-item text="我的" name="user" icon="bell"></u-tabbar-item>
+     <u-tabbar-item v-show="menus.device != null"
+       text="设备中心"
+       name="device"
+       icon="calendar"
+     ></u-tabbar-item>
+     <u-tabbar-item v-show="menus.warndata != null"
+       text="预警分析"
+       name="warndata"
+       icon="plus-circle"
+     ></u-tabbar-item>
+     <u-tabbar-item v-show="menus.filecenter != null"
+       text="文件共享"
+       name="filecenter"
+       icon="file-text"
+     ></u-tabbar-item>
+     <u-tabbar-item v-show="menus.gasreport != null"
+       text="瓦斯日报"
+       name="gasreport"
+       icon="bell"
+     ></u-tabbar-item>
+     <u-tabbar-item text="我的" name="user" icon="bell"></u-tabbar-item>
     </u-tabbar>
   </view>
 </template>
@@ -99,19 +75,21 @@ export default {
   data() {
     return {
       isLandScape: "",
-      PageCur: "",
+      PageCur: "device",
       tun3DPage: null,
       wvHeight: getApp().globalData.windowHeight,
       wvWidth: getApp().globalData.windowWidth,
       wvTop: 0,
-      iframeloading: true,
+      iframeloading: false,
+	  menus:{}
     };
   },
   computed: {
     permission: function () {
       var data = uni.getStorageSync("menuPermission");
       console.log(JSON.stringify(data));
-      if (data == null || data == "" || data.length == 0) {
+      if (data == null || data == "" || data.length == 0) 
+	  {
         data = [
           {
             redirect: null,
@@ -179,6 +157,9 @@ export default {
           },
         ];
       }
+	  for(var i=0;i<data.length;i++){
+		  this.menus[data[i].component] = data[i].component
+	  }
       return data;
     },
   },
@@ -191,9 +172,7 @@ export default {
       immediate: true,
   }
 },
-  onLoad(option) {
-	  
-	  this.$tip.success(option.ticket)
+  onLoad() {
     this.changeWV();
   },
   mounted() {},
@@ -255,7 +234,6 @@ export default {
   width: 100%;
   height: 100%;
 }
-
 .loadding-box {
   position: absolute;
   display: flex;

+ 5 - 0
pages/warndata/warndata.vue

@@ -2,6 +2,8 @@
   <view class="container">
     <u-navbar
       :title="titleName"
+      :bgStatusImage="backPic0"
+      :bgImage="backPic"
       :safeAreaInsetTop="true"
       left-icon=""
       @leftClick="menuShow"
@@ -231,6 +233,8 @@ export default {
   watch: {},
   data() {
     return {
+	  backPic0: "url(/static/topnavbar0.png)",
+	  backPic: "url(../../static/topnavbar.png)",
       titleName: "预警分析",
       isShowDetail: true,
       detailComponent: "",
@@ -388,6 +392,7 @@ export default {
   flex: 1;
   width: 100%;
   margin-top: 45px;
+		background: #f1f5f6;
   /* 内容区域顶部留出导航栏的高度 */
 }