Browse Source

优化守护计划

wangming 1 month ago
parent
commit
b9409f3fc6

+ 0 - 3
src/pages/home/home.vue

@@ -314,9 +314,6 @@ export default {
     onLoad() {},
     onShow() {
         if (uni.getStorageSync("userId")) {
-            uni.showLoading({
-                title: "雷能为您守护中...",
-            });
             this.getperSonInfo();
             this.getShareNum();
             this.getwarmType();

+ 7 - 0
src/pagesA/deviceDetail/deviceDetail.vue

@@ -641,6 +641,13 @@ export default {
             this.voipFlag = !this.voipFlag;
         },
         gotoSetting() {
+            if (this.devInfo.online == 0) {
+                uni.showToast({
+                    title: "离线设备不支持设置",
+                    icon: "none",
+                });
+                return;
+            }
             uni.navigateTo({
                 url:
                     "/pagesA/deviceSetting/deviceSetting?devInfo=" +

+ 8 - 0
src/pagesA/devices/devices.vue

@@ -51,6 +51,14 @@
                     <text style="color: #8b939f; font-size: 24rpx"
                         >设备离线</text
                     >
+                    <view
+                        style="
+                            margin-top: 18rpx;
+                            color: chocolate;
+                            font-size: 24rpx;
+                        "
+                        >离线时间 {{ forMateTime(item.onoffTime) }}</view
+                    >
                 </view>
                 <view class="cardImage" v-if="item.online == 0">
                     <image src="../../static/offline_small.png" mode="" />

+ 19 - 37
src/pagesA/healthAlarm/healthAlarm.vue

@@ -31,37 +31,15 @@
                 </view>
             </view>
         </view>
-        <view class="bottomTwo" @click="addNewAlarm">
-            <text>新增守护计划 </text></view
-        >
-
-        <!-- 选择守护计划遮罩层 -->
-        <view v-if="showPopup" class="mask" @click="showPopup = false"></view>
-
-        <view v-if="showPopup" class="popup">
-            <view class="popup-body">
-                <picker
-                    mode="selector"
-                    :range="planListName"
-                    @change="bindPickerChange"
-                    :value="selectedIndex"
-                >
-                    <view class="picker-text">
-                        {{
-                            planListName[selectedIndex] ||
-                            "点击此处选择守护计划"
-                        }}
-                    </view>
-                </picker>
-            </view>
-            <view class="popup-footer">
-                <view class="cancel-btn" @click="showPopup = false">
-                    取消
-                </view>
-                <view type="primary" @click="confirmSelect" class="sure-btn">
-                    确定
-                </view>
-            </view>
+        <view class="bottomTwo">
+            <picker
+                mode="selector"
+                :range="planListName"
+                @change="bindPickerChange"
+                :value="selectedIndex"
+            >
+                <text>新增守护计划 </text>
+            </picker>
         </view>
     </view>
 </template>
@@ -70,12 +48,12 @@ export default {
     data() {
         return {
             devInfo: {},
-            showPopup: false,
             planList: [],
             planListName: [],
             selectedIndex: null,
             // 已经新增的守护计划
             selectedPlan: [],
+            changFlage: false,
         };
     },
     computed: {},
@@ -161,14 +139,12 @@ export default {
                         }
                         this.getSelectPlan();
                     });
-                this.showPopup = false;
             }
+            this.changFlage = true;
         },
         bindPickerChange(e) {
             this.selectedIndex = e.detail.value;
-        },
-        addNewAlarm() {
-            this.showPopup = true;
+            this.confirmSelect();
         },
         getSelectPlan() {
             this.$http
@@ -187,6 +163,12 @@ export default {
                 .then((res) => {
                     if (res.data.code == 200) {
                         this.selectedPlan = res.data.data;
+                        if (this.changFlage) {
+                            this.changFlage = false;
+                            this.editItem(
+                                this.selectedPlan[this.selectedPlan.length - 1]
+                            );
+                        }
                     }
                 });
         },
@@ -244,10 +226,10 @@ export default {
     },
     onLoad(options) {
         this.devInfo = JSON.parse(options.devInfo);
-        this.getSelectPlan();
     },
     onShow() {
         this.getPlanList();
+        this.getSelectPlan();
     },
 };
 </script>