Procházet zdrojové kódy

优化部分页面样式和逻辑问题

fanghuisheng před 1 rokem
rodič
revize
3e8206454e

+ 20 - 20
src/components/oa-dropdown/index.vue

@@ -1,11 +1,11 @@
 <template>
   <view>
-    <view class="dropdown" :class="dropdownShow ? 'show' : 'none'">
+    <view class="oa-dropdown" :class="dropdownShow ? 'show' : 'none'">
       <view class="content">
         <slot name="content"></slot>
       </view>
     </view>
-    <view v-if="closeOnClickOverlay" class="dropdown" :class="dropdownShow ? 'mask' : 'none'" @click="close()"> </view>
+    <view v-if="closeOnClickOverlay" class="oa-dropdown" :class="dropdownShow ? 'mask' : 'none'" @click="close()"> </view>
   </view>
 </template>
 <script setup>
@@ -32,8 +32,8 @@ function close() {
   emit("close", false);
 }
 </script>
-<style scoped>
-.dropdown {
+<style lang="scss" scoped>
+.oa-dropdown {
   position: absolute;
   width: 100%;
   background-color: #fff;
@@ -42,24 +42,24 @@ function close() {
   z-index: 90;
   transition: max-height 0.4s ease-in-out;
   box-shadow: 0px 1px 2px 0px rgba(141, 141, 141, 0.4);
-}
 
-.dropdown.show {
-  max-height: 100%;
-}
+  &.show {
+    max-height: 100%;
+  }
 
-.dropdown.mask {
-  position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background-color: transparent;
-  height: 100%;
-  z-index: 50;
-}
+  &.mask {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: transparent;
+    height: 100%;
+    z-index: 50;
+  }
 
-.dropdown .content {
-  padding: 10px;
+  .content {
+    padding: 10px;
+  }
 }
 </style>

+ 2 - 2
src/manifest.json

@@ -2,8 +2,8 @@
     "name" : "综合智慧云",
     "appid" : "__UNI__36DE3A0",
     "description" : "综合智慧云app,助力企业数字化转型升级",
-    "versionName" : "2.0.5",
-    "versionCode" : 7,
+    "versionName" : "2.0.6",
+    "versionCode" : 8,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 2 - 6
src/pages/business/fireIot/alarmManage/index.vue

@@ -47,16 +47,12 @@ const total = ref(0);
 function init() {
   baseAlarmTypeList({ productName: "", current: current.value, size: pageSize.value }).then((requset) => {
     if (requset.status === "SUCCESS") {
-      dmpProductInfo({ current: current.value, size: 200000 }).then((requset1) => {
+      dmpProductInfo({ current: current.value, size: 2000 }).then((requset1) => {
         if (requset1.status === "SUCCESS") {
           requset.data.records.forEach((e) => {
             requset1.data.records.forEach((el) => {
               if (e.productCode === el.productCode) {
-                e.typeImg = el.typeImg;
-              }
-
-              if (!e.typeImg) {
-                e.typeImg = "/static/images/404.png";
+                e.typeImg = el.typeImg ? el.typeImg : "/static/images/404.png";
               }
             });
           });

+ 3 - 2
src/pages/business/fireIot/deviceManage/components/deviceDetailsList.vue

@@ -16,6 +16,7 @@
       <view class="deviceDetailsList-container">
         <view class="flex bg-white padding-10" style="position: relative">
           <u--input
+            style="width: 100%"
             v-model="deviceName"
             placeholder="请输入设备名称"
             prefixIcon="search"
@@ -24,7 +25,7 @@
             @confirm="dmpDeviceInfoApi()"
             clearable
           ></u--input>
-          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto" @click="dropdownShow = !dropdownShow">筛选</view>
+          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto; white-space: nowrap" @click="dropdownShow = !dropdownShow">筛选</view>
         </view>
 
         <oa-dropdown :dropdownShow="dropdownShow" :closeOnClickOverlay="true" @close="dropdownShow = false">
@@ -188,7 +189,7 @@ onLoad((options) => {
     white-space: nowrap;
 
     .deviceName {
-      min-width: 70%;
+      width: 75%;
       color: #000;
     }
 

+ 1 - 1
src/pages/business/fireIot/deviceManage/index.vue

@@ -19,7 +19,7 @@
           <u-grid-item v-for="(base, index) in dataList" :key="index" @click="handleToDevice(base.id, base.productName)">
             <u-badge type="primary" max="9999" :value="base.deviceCount" :showZero="true" :absolute="true" :offset="[10, 10, 0, 0]"></u-badge>
             <image class="margin-b-15" style="width: 40px; height: 40px; margin-top: 35px" :src="base.typeImg" mode="aspectFill"></image>
-            <text class="margin-b-15 grid-text text-ellipsis">{{ base.productName }}</text>
+            <view class="margin-b-15 text-ellipsis" style="width: 100%; text-align: center">{{ base.productName }}</view>
           </u-grid-item>
         </u-grid>
       </view>

+ 2 - 1
src/pages/business/fireIot/facilitiesManage/facilitiesDetailsList.vue

@@ -16,6 +16,7 @@
       <view class="facilitiesDetailsList-container">
         <view class="flex bg-white padding-10" style="position: relative">
           <u--input
+            style="width: 100%"
             v-model="facilityName"
             placeholder="请输入设施名称"
             prefixIcon="search"
@@ -24,7 +25,7 @@
             @confirm="init()"
             clearable
           ></u--input>
-          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto" @click="init()">筛选</view>
+          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto; white-space: nowrap" @click="init()">筛选</view>
         </view>
 
         <view class="menu-list margin-0">

+ 1 - 1
src/pages/business/fireIot/facilitiesManage/index.vue

@@ -43,7 +43,7 @@
     </template>
   </oa-scroll>
 
-  <view style="position: fixed; right: 0; bottom: 50px">
+  <view class="app-scan-fixed">
     <u-image width="67" height="67" src="@/static/images/add.png" shape="circle" @tap="handleToPage()"></u-image>
   </view>
 </template>

+ 1 - 3
src/pages/business/zhxf/funReport/index.vue

@@ -56,11 +56,9 @@
       </view>
     </view>
 
-    <!-- 新增按钮start -->
-    <view style="position: fixed; right: 0; bottom: 50px">
+    <view class="app-scan-fixed">
       <u-image width="67" height="67" src="@/static/images/add.png" shape="circle" @tap="goAddPage()"></u-image>
     </view>
-    <!-- 新增按钮end -->
   </view>
 </template>
 

+ 1 - 0
src/pages/common/applicationInfo/index.vue

@@ -172,6 +172,7 @@ onNavigationBarButtonTap((e) => {
 
       &-cont {
         font-weight: 600;
+        color: #000000;
       }
 
       &-buttom {

+ 6 - 3
src/pages/common/customManage/index.vue

@@ -15,15 +15,16 @@
       <view class="customManage-container" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
         <view class="flex bg-white padding-10" style="position: relative">
           <u--input
+            style="width: 100%"
             v-model="projectName"
             placeholder="搜索"
             prefixIcon="search"
             prefixIconStyle="font-size: 22px;color: #909399"
-            customStyle="height:30px;background-color:#f5f6fa;"
+            customStyle="height:30px;background-color:#f5f6fa; "
             @confirm="selectListApi()"
             clearable
           ></u--input>
-          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto" @click="dropdownShow = !dropdownShow">筛选</view>
+          <view class="margin-l-10" style="margin-top: auto; margin-bottom: auto; white-space: nowrap" @click="dropdownShow = !dropdownShow">筛选</view>
         </view>
 
         <oa-dropdown :dropdownShow="dropdownShow" :closeOnClickOverlay="true" @close="dropdownShow = false">
@@ -43,7 +44,9 @@
               <view style="min-width: 50%"> 项目编号:{{ data.projectId }} </view>
               <view style="min-width: 50%"> 到期时间:{{ data.expireTime ? data.expireTime.split("T")[0] : "" }} </view>
               <view style="min-width: 50%"> 客户负责人:{{ data.customPerson }} </view>
-              <view style="min-width: 50%"> 维保费:¥{{ data.maintainAmount }} </view>
+              <view style="min-width: 50%">
+                维保费:<span style="color: red">¥{{ data.maintainAmount }}</span>
+              </view>
               <view style="min-width: 50%; display: flex; white-space: nowrap">
                 <view style="margin-right: 5px">客户电话:{{ data.phone }}</view>
                 <view class="iconfont ucicon-a-copy menu-icon" style="font-size: 14px; color: #909399; margin-left: 5px" @click="copy(data.phone)"> </view>

+ 20 - 18
src/pages/index.vue

@@ -52,7 +52,7 @@
 
         <image v-if="!swiperBool" style="width: 100%; height: 160px" src="@/static/images/index/banner1.png"></image>
 
-        <view class="app-common-notice bg-white radius shadow-default margin-lr-sm margin-bottom-sm">
+        <view class="app-common-notice bg-white radius shadow-default margin-lr-sm margin-bottom-sm" v-if="weatherData.length != 0">
           <!-- <view class="info">
             <view class="info-header">
               <view class="info-title text-df">综合智慧云</view>
@@ -64,13 +64,13 @@
           <view class="weather radius">
             <view class="weather-header">
               <view class="iconfont ucicon-address icon"></view>
-              <view style="margin: 0 15px 0 0">{{ weatherData.length != 0 ? weatherData[0].location : "" }}</view>
+              <view style="margin: 0 15px 0 0">{{ weatherData[0].location || "上海" }}</view>
               <view style="margin: 0 auto 0 0">今天</view>
-              <view style="margin: 0 0 0 0">{{ weatherData.length != 0 ? weatherData[0].text : "" }}</view>
+              <view style="margin: 0 0 0 0">{{ weatherData[0].text || "未知" }}</view>
             </view>
             <view class="weather-center">
-              <view class="temperature">{{ weatherData.length != 0 ? weatherData[0].today.low + "/" + weatherData[0].today.high : "0℃" }}</view>
-              <image class="image" :src="`${weatherData.length != 0 ? '/static/icons/white/' + weatherData[0].code.now + '.png' : ''}`" mode="heightFix" style="height: 30px"></image>
+              <view class="temperature">{{ weatherData[0].today.low + "/" + weatherData[0].today.high || "0℃" }}</view>
+              <image class="image" :src="`${'/static/icons/white/' + weatherData[0].code.now + '.png'}`" mode="heightFix" style="height: 30px"></image>
             </view>
           </view>
         </view>
@@ -195,18 +195,6 @@ function getWeather(string) {
   });
 }
 
-onLoad((option) => {
-  uni.hideTabBar(); //隐藏自带tabbar
-
-  if (uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId)) {
-    recentlyUsed.value = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
-  }
-
-  getAppRoutersData(); //调用路由信息接口
-  getMobileBannerApi(); //调用banner图接口
-  getLocation(); //调用获取地理位置方法
-});
-
 /**
  * @scrollView刷新数据
  */
@@ -394,7 +382,21 @@ function getAppRoutersData() {
   });
 }
 
-onShow(() => {});
+onLoad((option) => {
+  uni.hideTabBar(); //隐藏自带tabbar
+
+  getAppRoutersData(); //调用路由信息接口
+  getMobileBannerApi(); //调用banner图接口
+  getLocation(); //调用获取地理位置方法
+});
+
+onShow(() => {
+  if (uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId)) {
+    recentlyUsed.value = uni.getStorageSync(useStore.$state.name + useStore.$state.tenantId);
+  } else {
+    recentlyUsed.value = [];
+  }
+});
 </script>
 
 <style lang="scss" scoped>

+ 1 - 3
src/static/scss/public.scss

@@ -257,7 +257,7 @@ uni-input {
 .app-scan-fixed {
   position: fixed;
   right: 0;
-  bottom: 50px
+  bottom: 80px;
 }
 
 //公共scroll-view样式
@@ -278,8 +278,6 @@ uni-input {
   margin-top: -20px;
   z-index: 50;
 
-
-
   .info {
     padding: 10px;
 

+ 10 - 2
src/store/modules/setting.js

@@ -108,13 +108,21 @@ const settingStore = defineStore("setting", {
          * @清理缓存
          */
         handleCleanTmp() {
+            const useStore = useStores();
+
             // #ifdef H5
-            modal.showToast("H5暂不支持此功能");
+            uni.showToast({
+                title: "缓存清理完成",
+                duration: 2000,
+                mask: true,
+            });
             // #endif
 
             // #ifdef APP-PLUS
-            setting.clearCache();
+            setting.clearCache();//清除应用访问缓存
             // #endif
+
+            uni.removeStorageSync(useStore.$state.name + useStore.$state.tenantId);//清除首页宫格缓存
         },
 
         /**

+ 49 - 61
src/utils/request.js

@@ -6,8 +6,53 @@ import common from "@/plugins/common.plugins";
 
 let timeout = 10000;
 
-const request = (config) => {
+/**
+ * @校验结果方法
+ * @param {数据集} res 
+ * @param {结果抛出} resolve 
+ * @param {控制台打印} reject 
+ */
+function verification(res, resolve, reject) {
   const useStore = useStores();
+  const data = typeof res.data === "string" ? JSON.parse(res.data) : res.data;
+  const code = data.code || 200;
+
+  if (code === 401) {
+    modal.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then((res) => {
+      if (res) {
+        useStore.LogOut().then((res) => {
+          uni.reLaunch({ url: "/pages/login" });
+        });
+      }
+    });
+    modal.closeLoading();
+    reject("无效的会话,或者会话已过期,请重新登录。");
+  } else if (code === 404 || res.statusCode === 404) {
+    if (data.msg.indexOf(":") !== -1) {
+      modal.msg(data.msg.split(":")[1]);
+      reject(data.msg.split(":")[1]);
+    } else {
+      modal.msg(data.msg);
+      reject(data.msg);
+    }
+    modal.closeLoading();
+  } else if (code === 500 || res.statusCode === 500) {
+    if (data.msg.indexOf(":") !== -1) {
+      modal.msg(data.msg.split(":")[1]);
+      reject(data.msg.split(":")[1]);
+    } else {
+      modal.msg(data.msg);
+      reject(data.msg);
+    }
+    modal.closeLoading();
+  } else if (code !== 200 && code !== "0") {
+    reject(code);
+  }
+  resolve(data);
+}
+
+const request = (config) => {
+
   // 是否需要设置 token
   const isToken = (config.headers || {}).isToken === false;
   config.header = config.header || {};
@@ -30,47 +75,13 @@ const request = (config) => {
         header: config.header,
         dataType: "json",
       })
-      .then((response) => {
-        let res = response;
+      .then((res) => {
         if (res.error) {
           modal.msg("后端接口连接异常");
           reject("后端接口连接异常");
           return;
         }
-        const code = res.data.code || 200;
-
-        if (code === 401) {
-          modal.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then((res) => {
-            if (res) {
-              useStore.LogOut().then((res) => {
-                uni.reLaunch({ url: "/pages/login" });
-              });
-            }
-          });
-          modal.closeLoading();
-          reject("无效的会话,或者会话已过期,请重新登录。");
-        } else if (code === 404 || res.statusCode === 404) {
-          if (res.data.msg.indexOf(":") !== -1) {
-            modal.msg(res.data.msg.split(":")[1]);
-            reject(res.data.msg.split(":")[1]);
-          } else {
-            modal.msg(res.data.msg);
-            reject(res.data.msg);
-          }
-          modal.closeLoading();
-        } else if (code === 500 || res.statusCode === 500) {
-          if (res.data.msg.indexOf(":") !== -1) {
-            modal.msg(res.data.msg.split(":")[1]);
-            reject(res.data.msg.split(":")[1]);
-          } else {
-            modal.msg(res.data.msg);
-            reject(res.data.msg);
-          }
-          modal.closeLoading();
-        } else if (code !== 200 && code !== "0") {
-          reject(code);
-        }
-        resolve(res.data);
+        verification(res, resolve, reject);//调用校验结果方法
       })
       .catch((error) => {
         let { message } = error;
@@ -111,30 +122,7 @@ const uploads = (config) => {
       header: config.header,
       formData: config.formData,
       success: (res) => {
-        let result = JSON.parse(res.data);
-        const code = result.code || 200;
-        if (code === 200) {
-          resolve(result);
-        } else if (code == 401) {
-          modal.confirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then((res) => {
-            if (res) {
-              useStore.LogOut().then((res) => {
-                uni.reLaunch({ url: "/pages/login" });
-              });
-            }
-          });
-          reject("无效的会话,或者会话已过期,请重新登录。");
-        } else if (code === 500 || res.statusCode === 500) {
-          if (res.data.msg.indexOf(":") !== -1) {
-            modal.msg(res.data.msg.split(":")[1]);
-            reject(res.data.msg.split(":")[1]);
-          } else {
-            modal.msg(res.data.msg);
-            reject(res.data.msg);
-          }
-        } else if (code !== 200 && code !== "0") {
-          reject(code);
-        }
+        verification(res, resolve, reject);//调用校验结果方法
       },
       fail: (error) => {
         let { message } = error;

+ 2 - 1
uniCloud-aliyun/cloudfunctions/uniPushMessage/index.js

@@ -9,7 +9,8 @@ exports.main = async (event, context) => {
 		"title": obj.title, // 标题  
 		"content": obj.content, // 内容  
 		"payload": obj.payload, // 数据
-		// "force_notification": true, //填写true,客户端就会对在线消息自动创建“通知栏消息”。  
+		"getui_big_data_tag": obj.getui_big_data_tag, //根据条件筛选设备推送
+		// "force_notification": true, //填写true,客户端就会对在线消息自动创建“通知栏消息”。
 		"request_id": obj.request_id, //请求唯一标识号,10-32位之间;如果request_id重复,会导致消息丢失  
 		"options": obj.options, //消息分类,没申请可以不传这个参数  
 	})