wangming před 2 měsíci
rodič
revize
1ac592937d

+ 9 - 0
src/pages.json

@@ -192,6 +192,15 @@
                         "navigationBarBackgroundColor": "#faede2",
                         "navigationBarTextStyle": "black"
                     }
+                },
+                {
+                    "path": "abnormalInfo/abnormalInfo",
+                    "style": {
+                        "enablePullDownRefresh": true,
+                        "navigationBarTitleText": "异常信息",
+                        "navigationBarBackgroundColor": "#faede2",
+                        "navigationBarTextStyle": "black"
+                    }
                 }
             ]
         }

+ 173 - 18
src/pages/home/home.vue

@@ -41,14 +41,14 @@
                         >台</view
                     >
                 </view>
-                <view class="rightItem" @click="goNo()">
-                    <view class="rightTitle">异常设备</view>
+                <view class="rightItem" @click="goAbnormalInfo()">
+                    <view class="rightTitle">异常信息</view>
                     <view class="rightContent" v-if="warnNum == 0"
-                        ><text>0</text></view
+                        ><text>0</text></view
                     >
                     <view class="rightAlarm" v-else
                         ><text>{{ warnNum }}</text
-                        ></view
+                        ></view
                     >
                 </view>
             </view>
@@ -83,7 +83,12 @@
         </view>
         <view class="bot_version"> v3.0.4 </view>
 
-        <view class="shareInfo" @click="goDeviceShare()" v-if="shareNum > 0">
+        <view
+            class="shareInfo"
+            @click="goDeviceShare()"
+            v-if="shareNum > 0"
+            :style="{ top: warnNum > 0 ? '280rpx' : '210rpx' }"
+        >
             <image src="../../static/ln_small.png" class="shareImage"></image>
             <text class="shareTitle"
                 >您有<text class="shareNum">{{ shareNum }}</text
@@ -92,7 +97,37 @@
             <image src="../../static/arrTwo.png" class="arrImage"></image>
         </view>
 
-        <!-- <view> </view> -->
+        <view
+            class="warmInfo"
+            @click="goDeviceShare()"
+            v-if="warmList.length > 0"
+        >
+            <image src="../../static/warmImage.png" class="shareImage"></image>
+            <view class="shareTitleContainer">
+                <view class="shareTitleList" v-if="warmList.length > 1">
+                    <view
+                        class="shareTitle"
+                        v-for="item in warmList"
+                        :key="item.devId"
+                    >
+                        {{ item.devName }}检测到有目标滞留
+                    </view>
+                    <view
+                        class="shareTitle"
+                        v-for="item in warmList"
+                        :key="item.devId + '-copy'"
+                    >
+                        {{ item.devName }}检测到有目标滞留
+                    </view>
+                </view>
+                <view class="shareTitleTwo" v-else>
+                    <view class="shareTitle">
+                        {{ warmList[0].devName }}检测到有目标滞留
+                    </view>
+                </view>
+            </view>
+            <image src="../../static/arrFour.png" class="warmImage"></image>
+        </view>
         <alarModel />
     </view>
 </template>
@@ -108,7 +143,9 @@ export default {
             warnNum: 0,
             imageUrl: "../../static/headerInfo.png",
             devDevice: "",
-            warmDevice: "",
+            warmNum: "",
+            warmDetail: [],
+            warmList: [],
         };
     },
     computed: {},
@@ -153,13 +190,10 @@ export default {
                 });
             }
         },
-
-        goNo() {
+        goAbnormalInfo() {
             if (uni.getStorageSync("userId")) {
-                uni.showToast({
-                    title: "该功能正在开发中,敬请期待",
-                    icon: "none",
-                    duration: 1500,
+                uni.reLaunch({
+                    url: "/pagesA/abnormalInfo/abnormalInfo",
                 });
                 return;
             }
@@ -201,12 +235,61 @@ export default {
                     this.shareNum = res.data.data?.length || 0;
                 });
         },
+        getWarmDevice() {
+            this.$http
+                .post(
+                    "wap/stats/alarmRetentionQuery",
+                    {
+                        pageNo: 1,
+                        pageSize: 20,
+                    },
+                    {
+                        header: {
+                            "Content-Type": "application/json;charset=UTF-8",
+                            token: uni.getStorageSync("tokenValue") || "",
+                        },
+                    }
+                )
+                .then((res) => {
+                    if (res.data.data) {
+                        // this.warmNum = res.data.data.total;
+                        if (res.data.data.rows.length > 0) {
+                            this.warmDetail = res.data.data.rows;
+                            const mergedMap = new Map();
+                            this.warmDetail.forEach((alarm) => {
+                                const devId = alarm.devId;
+                                if (mergedMap.has(devId)) {
+                                    const existingAlarm = mergedMap.get(devId);
+                                    const existingTime = new Date(
+                                        existingAlarm.createTime
+                                    );
+                                    const currentTime = new Date(
+                                        alarm.createTime
+                                    );
+
+                                    if (currentTime > existingTime) {
+                                        mergedMap.set(devId, alarm);
+                                    }
+                                } else {
+                                    mergedMap.set(devId, alarm);
+                                }
+                            });
+                            const entries = mergedMap.entries();
+                            // 遍历
+                            for (const [devId, object] of entries) {
+                                this.warmList.push(object);
+                            }
+                        }
+                    }
+                });
+        },
     },
     onLoad() {},
     onShow() {
         if (uni.getStorageSync("userId")) {
             this.getperSonInfo();
             this.getShareNum();
+            this.getWarmDevice();
         }
         // 配置服务器
         let selectedService = uni.getStorageSync("sercviceChoice");
@@ -400,16 +483,17 @@ export default {
 
 .shareInfo {
     width: 100%;
-    padding: 3rpx 0;
-    padding-left: 70rpx;
+    padding: 0 16rpx;
     color: #ffffff;
     display: flex;
     align-items: center;
     font-size: 28rpx;
     position: absolute;
-    top: 210rpx;
+    // top:210rpx;
+    // top: 400rpx;
     left: 50%;
     transform: translate(-50%, -50%);
+    box-sizing: border-box;
     background: linear-gradient(
         to right,
         #6f4e37 0%,
@@ -419,7 +503,6 @@ export default {
         width: 60rpx;
         height: 60rpx;
         border-radius: 50%;
-        margin-left: 10rpx;
     }
     .shareTitle {
         margin-left: 20rpx;
@@ -435,7 +518,79 @@ export default {
     .arrImage {
         width: 20rpx;
         height: 30rpx;
-        margin-left: 300rpx;
+        margin-left: auto;
+    }
+}
+
+.warmInfo {
+    width: 100%;
+    padding: 0rpx 10rpx;
+    color: #ffffff;
+    display: flex;
+    align-items: center;
+    font-size: 28rpx;
+    position: absolute;
+    top: 210rpx;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    box-sizing: border-box;
+    background: linear-gradient(
+        to right,
+        #f9e0d7 0%,
+        #ff6262 45%,
+        #ff6262 55%,
+        #f9e0d7 100%
+    );
+    border-radius: 12rpx;
+}
+
+.shareImage {
+    width: 60rpx;
+    height: 60rpx;
+    border-radius: 50%;
+}
+
+.warmImage {
+    width: 30rpx;
+    height: 30rpx;
+    margin-left: auto;
+}
+
+.shareTitleContainer {
+    flex: 1;
+    overflow: hidden;
+    height: 40rpx;
+    margin-left: 20rpx;
+    display: flex;
+    align-items: center;
+}
+
+/* 内层列表:滚动 */
+.shareTitleList {
+    display: flex;
+    flex-direction: column;
+    animation: scrollUp 10s linear infinite;
+}
+.shareTitleTwo {
+    display: flex;
+    flex-direction: column;
+}
+.shareTitle {
+    font-size: 28rpx;
+    color: #ffffff;
+    letter-spacing: 4rpx;
+    height: 40rpx;
+    line-height: 40rpx;
+    white-space: nowrap;
+}
+
+/* 无限无缝滚动 */
+@keyframes scrollUp {
+    0% {
+        transform: translateY(0);
+    }
+    100% {
+        transform: translateY(-50%);
     }
 }
 </style>

+ 28 - 0
src/pagesA/abnormalInfo/abnormalInfo.vue

@@ -0,0 +1,28 @@
+<template>
+    <view class="box">
+        <alarModel />
+    </view>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            warnList: "",
+        };
+    },
+    computed: {},
+    methods: {},
+    onLoad() {},
+    onShow() {},
+};
+</script>
+<style lang="less" scoped>
+.box {
+    padding: 10rpx 18rpx;
+    overflow: scroll;
+    width: 100vw;
+    height: 100vh;
+    background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
+    box-sizing: border-box;
+}
+</style>

+ 5 - 0
src/pagesA/roomSetting/roomSetting.vue

@@ -543,6 +543,11 @@ export default {
         },
         // 输入宽高改变家具大小
         changeSize() {
+            if (this.selectHeight <= 0 || this.selectWidth <= 0) {
+                this.selectHeight = this.modules[this.draggingIndex].length;
+                this.selectWidth = this.modules[this.draggingIndex].width;
+                return this.showModal("提示", "家具长宽不能小于0");
+            }
             this.modules[this.draggingIndex].length = this.selectHeight;
             this.modules[this.draggingIndex].width = this.selectWidth;
         },

binární
src/static/arrFour.png


binární
src/static/warmImage.png