bobo04052021@163.com před 4 dny
rodič
revize
4ebbd3a5ab

+ 138 - 4
App.vue

@@ -5,13 +5,12 @@
 <script>
 import Vue from "vue";
 import appUpdate from "common/util/appUpdate.js";
+import configService from "@/common/service/config.service.js";
 export default {
   onLaunch: function () {
     const savedIP = uni.getStorageSync("selectedIP");
-    if (!savedIP) {
-      uni.reLaunch({ url: "/pages/ipConfig/ipConfig" });
-      return;
-    } else {
+
+    if (configService.apiUrl !== "") {
       uni.getSystemInfo({
         success: function (e) {
           // #ifdef APP-PLUS
@@ -141,6 +140,141 @@ export default {
           color: "#ffffff",
         },
       ];
+    } else {
+      if (!savedIP) {
+        uni.reLaunch({ url: "/pages/ipConfig/ipConfig" });
+        return;
+      } else {
+        uni.getSystemInfo({
+          success: function (e) {
+            // #ifdef APP-PLUS
+            // 检测升级
+            appUpdate();
+            // #endif
+            // #ifndef MP
+            Vue.prototype.StatusBar = e.statusBarHeight;
+            if (e.platform == "android") {
+              Vue.prototype.CustomBar = e.statusBarHeight + 50;
+            } else {
+              Vue.prototype.CustomBar = e.statusBarHeight + 45;
+            }
+            // #endif
+
+            // #ifdef MP-WEIXIN
+            Vue.prototype.StatusBar = e.statusBarHeight;
+            let custom = wx.getMenuButtonBoundingClientRect();
+            Vue.prototype.Custom = custom;
+            Vue.prototype.CustomBar =
+              custom.bottom + custom.top - e.statusBarHeight;
+            // #endif
+
+            // #ifdef MP-ALIPAY
+            Vue.prototype.StatusBar = e.statusBarHeight;
+            Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
+            // #endif
+
+            // #ifdef APP-PLUS
+            //Vue.prototype.$api.listenTranMsg()
+            // 		var info = plus.push.getClientInfo();
+
+            // 		/* 5+  push 消息推送 ps:使用:H5+的方式监听,实现推送*/
+            // 		plus.push.addEventListener("click", function(msg) {
+            // 			console.log("click:" + JSON.stringify(msg));
+            // 			console.log(msg.payload);
+            // 			console.log(JSON.stringify(msg));
+            // 			//这里可以写跳转业务代码
+            // 		}, false);
+            // 		// 监听在线消息事件
+            // 		plus.push.addEventListener("receive", function(msg) {
+            // 			// plus.ui.alert(2);
+            // 			//这里可以写跳转业务代码
+            // 			console.log("recevice:" + JSON.stringify(msg))
+            // 		}, false);
+            // #endif
+
+            //Vue.prototype.$api.initLogin()
+          },
+        });
+        Vue.prototype.NavBarColor = "bg-gradual-blue";
+        Vue.prototype.Radio_Check_Size = "scale(0.7)";
+        Vue.prototype.ColorList = [
+          {
+            title: "嫣红",
+            name: "red",
+            color: "#e54d42",
+          },
+          {
+            title: "桔橙",
+            name: "orange",
+            color: "#f37b1d",
+          },
+          {
+            title: "明黄",
+            name: "yellow",
+            color: "#fbbd08",
+          },
+          {
+            title: "橄榄",
+            name: "olive",
+            color: "#8dc63f",
+          },
+          {
+            title: "森绿",
+            name: "green",
+            color: "#39b54a",
+          },
+          {
+            title: "天青",
+            name: "cyan",
+            color: "#1cbbb4",
+          },
+          {
+            title: "海蓝",
+            name: "blue",
+            color: "#0081ff",
+          },
+          {
+            title: "姹紫",
+            name: "purple",
+            color: "#6739b6",
+          },
+          {
+            title: "木槿",
+            name: "mauve",
+            color: "#9c26b0",
+          },
+          {
+            title: "桃粉",
+            name: "pink",
+            color: "#e03997",
+          },
+          {
+            title: "棕褐",
+            name: "brown",
+            color: "#a5673f",
+          },
+          {
+            title: "玄灰",
+            name: "grey",
+            color: "#8799a3",
+          },
+          {
+            title: "草灰",
+            name: "gray",
+            color: "#aaaaaa",
+          },
+          {
+            title: "墨黑",
+            name: "black",
+            color: "#333333",
+          },
+          {
+            title: "雅白",
+            name: "white",
+            color: "#ffffff",
+          },
+        ];
+      }
     }
   },
   onShow: function () {

+ 6 - 36
common/service/config.service.js

@@ -2,48 +2,18 @@ let BASE_URL = "";
 if (process.env.NODE_ENV == "development") {
   // BASE_URL = "http://182.92.126.35:9999"; // 开发环境
 } else {
-  // BASE_URL = "http://182.92.126.35:9999"; // 开发环境
-  // BASE_URL = "http://10.246.95.4:9999"; // 布尔台
-  // BASE_URL = "http://10.248.135.10:9999"; // 大柳塔进
-  // BASE_URL = "http://10.248.135.121:9999"; // 活鸡兔井
-  // BASE_URL = "http://10.246.63.125:9999"; // 寸草塔二矿
-  // BASE_URL = "http://10.246.183.35:9999"; // 乌兰木伦
-  // BASE_URL = "http://10.120.120.164:9999"; // 察哈素
-  // BASE_URL = "http://182.92.126.35:9999"; // 生产环境
-  // BASE_URL = "http://172.16.53.16:9999"; //大海则
-  // BASE_URL = "http://10.246.167.205:9999"; //上湾
-  // BASE_URL = "http://172.30.157.9:9999"; //元子沟
-  // BASE_URL = "http://10.246.167.205:9999"; //上湾
+  //如果是神东项目  ip地址配置在 login.vue 和 ipConfig.vue中进行配置
+  //如果是其他项目  ip地址在本文件中配置 BASE_URL 例如 BASE_URL = "http://182.92.126.35:9999";
+  // BASE_URL = "http://10.35.116.82:9999";//棋盘井东区 
+  // BASE_URL = "http://192.168.126.12:9999";//王洼二矿
+  BASE_URL = "http://172.17.3.15:9999";//黑龙煤矿
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";
 const configService = {
-  apiUrl: uni.getStorageSync("apiUrl"),
+  apiUrl: BASE_URL || uni.getStorageSync("apiUrl"),
   apiUrlP: "http://10.246.167.205:6006",
   // apiUrlP: 'http://182.92.126.35:6006',
   staticDomainURL: staticDomainURL,
 };
 
 export default configService;
-
-// let BASE_URL = "";
-
-// // 开发环境直接使用预设 IP
-// if (process.env.NODE_ENV === "development") {
-//   BASE_URL = "http://182.92.126.35:9999";
-// } else {
-//   // 生产环境优先读取本地存储
-//   BASE_URL = uni.getStorageSync("apiUrl") || "";
-// }
-
-// // 判断是否需要跳转 IP 设置页
-// if (process.env.NODE_ENV !== "development" && !BASE_URL) {
-//   uni.reLaunch({ url: "/pages/ipConfig/ipConfig" });
-// }
-
-// const staticDomainURL = BASE_URL + "/sys/common/static";
-// const configService = {
-//   apiUrl: BASE_URL,
-//   apiUrlP: "http://10.246.167.205:6006",
-//   staticDomainURL: staticDomainURL,
-// };
-// export default configService;

+ 5 - 1
common/service/service.js

@@ -41,7 +41,11 @@ http.interceptor.request((config, cancel) => {
   /* 请求之前拦截器 */
   console.log(config, "config---");
   config.baseUrl = "";
-  config.url = uni.getStorageSync("apiUrl") + config.url;
+  if (apiUrl) {
+    config.baseUrl = apiUrl; /* 根域名不同 */
+  } else {
+    config.url = uni.getStorageSync("apiUrl") + config.url;
+  }
   config.header = {
     ...config.header,
     "X-Access-Token": getTokenStorage(),

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "瓦斯巡检",
+    "name" : "智能通风",
     "appid" : "__UNI__2000523",
     "description" : "",
     "versionName" : "2.2.22",

+ 1 - 1
pages/filecenter/filecenter.vue

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

+ 1 - 1
pages/gasreport/components/gasImgIdentify.vue

@@ -126,7 +126,7 @@
 import api from "@/api/api";
 import moment from 'moment'
 import configService from '@/common/service/config.service.js'
-import { RHFselcet } from '@/uni_modules/fz-media-selcet';
+// import { RHFselcet } from '@/uni_modules/fz-media-selcet';
 import helangCompress from '@/components/helang-compress/helang-compress';
 export default {
     name: 'gasFill',

+ 3 - 34
pages/login/login.vue

@@ -1,6 +1,6 @@
   <template>
     <view class="zai-box">
-      <u-icon name="setting-fill" color="#2979ff" size="28" @click="setIp"></u-icon>
+      <u-icon name="setting-fill" color="#2979ff" size="28" @click="setIp" v-if="configService.apiUrl == ''"></u-icon>
       <scroll-view scroll-y class="page" v-if="!ipShow">
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
           <!-- <image src="/static/desk-img/logo.png" mode='aspectFit' class="zai-logo "></image> -->
@@ -77,6 +77,7 @@ import { ACCESS_TOKEN, USER_NAME, USER_INFO } from "@/common/util/constants";
 import { mapActions } from "vuex";
 import configService from "@/common/service/config.service.js";
 import { AesEncryption, getLoginCipher } from "@/common/util/cipher.js";
+
 import api from "@/api/api";
 export default {
   data() {
@@ -398,43 +399,11 @@ export default {
         url: "/pages/webview/webview?url=" + encodeURIComponent(url),
       });
     },
-    // setIp() {
-    //   uni.navigateTo({
-    //     url: "/pages/ipConfig/ipConfig",
-    //   });
-    // },
-    //正则判断ip地址
-    // validateIP(ip) {
-    //   const regex =
-    //     /^(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}$/;
-    //   return regex.test(ip);
-    // },
-    // //正则判断端口地址
-    // validatePort(port) {
-    //   const regex = /^([1-9]\d{0,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5])$/;
-    //   return regex.test(port);
-    // },
+
     setIp() {
       console.log("点击成功");
       this.ipShow = !this.ipShow;
     },
-    // saveIP() {
-    //   this.validateIP(this.IPValue);
-    //   this.validatePort(this.PortValue);
-    //   if (this.validateIP(this.IPValue) && this.validatePort(this.PortValue)) {
-    //     this.ipShow = false;
-    //     this.fullIPVal = `http://${this.IPValue}:${this.PortValue}`;
-    //     configService.apiUrl = this.fullIPVal;
-    //     uni.setStorageSync("apiUrl", configService.apiUrl);
-    //     // localStorage.setItem("apiUrl", apiUrl);
-    //   } else if (!this.validateIP(this.IPValue)) {
-    //     alert("请填写正确的IP地址");
-    //   } else if (!this.validatePort(this.PortValue)) {
-    //     alert("请填写正确的端口号");
-    //   } else {
-    //     alert("请检查输入的IP地址或端口号");
-    //   }
-    // },
     changeIP() {
       this.ipShow1 = true;
     },

+ 2 - 3
pages/warndata/warndata.vue

@@ -13,7 +13,7 @@
       </view>
     </u-navbar>
 
-    <view>
+    <view class="menupage">
       <view class="main" v-if="isShowDetail">
         <view class="flcard" v-if="isShow1">
           <view class="typeBar">
@@ -473,12 +473,11 @@ export default {
 }
 
 .main {
-  margin-top: 80px;
+  margin-top: 90px;
   display: flex;
   flex-direction: column;
   flex: 1;
   width: 100%;
-  margin-top: 45px;
   background: #f1f5f6;
   /* 内容区域顶部留出导航栏的高度 */
 }