Browse Source

提交设备家庭管理

wangming 2 months ago
parent
commit
6e12cdee02
2 changed files with 128 additions and 134 deletions
  1. 9 0
      src/pages.json
  2. 119 134
      src/pagesA/homeManage/homeManage.vue

+ 9 - 0
src/pages.json

@@ -149,6 +149,15 @@
                     }
                 },
                 {
+                    "path": "sharePages/sharePages",
+                    "style": {
+                        "enablePullDownRefresh": true,
+                        "navigationBarTitleText": "分享确认",
+                        "navigationBarBackgroundColor": "#faede2",
+                        "navigationBarTextStyle": "black"
+                    }
+                },
+                {
                     "path": "myHome/myHome",
                     "style": {
                         "enablePullDownRefresh": true,

+ 119 - 134
src/pagesA/homeManage/homeManage.vue

@@ -2,40 +2,54 @@
     <view class="box">
         <view class="addHome" @click="addHome()"> + 添加家庭 </view>
 
-        <view class="listItem" v-for="(item, index) in groupList" :key="index">
-            <view class="itemHeader">
-                <view class="itemTitle">{{ item.groupName }}</view>
-                <view class="itemOption"
-                    ><view class="imgItem" @click="deleteGroup(item)"
-                        ><image src="../../static/delete.png"></image></view
-                    ><view class="imgItem" @click="editGroup(item)"
-                        ><image src="../../static/edit.png"></image></view
-                    ><view class="imgItem"
-                        ><image src="../../static/shareTwo.png"></image></view
-                ></view>
-            </view>
-            <view class="itemContent">
-                <view class="itemCard"
-                    ><view class="cardTitle">全部设备</view
-                    ><view class="cardContent"
-                        ><text class="titleOne">{{ item.totalDevice }}</text
-                        ><text class="titleTwo">台</text></view
-                    ></view
-                >
-                <view class="itemCard"
-                    ><view class="cardTitle">在线设备</view
-                    ><view class="cardContent"
-                        ><text class="titleOne">{{ item.onlineDevice }}</text
-                        ><text class="titleTwo">台</text></view
-                    ></view
-                >
-                <view class="itemCard"
-                    ><view class="cardTitle">报警设备</view
-                    ><view class="cardContent"
-                        ><text class="warnOne">{{ item.warningDevice }}</text
-                        ><text class="warnTwo">台</text></view
-                    ></view
-                >
+        <view class="listBox">
+            <view
+                class="listItem"
+                v-for="(item, index) in groupList"
+                :key="index"
+            >
+                <view class="itemHeader">
+                    <view class="itemTitle">{{ item.groupName }}</view>
+                    <view class="itemOption"
+                        ><view class="imgItem" @click="deleteGroup(item)"
+                            ><image src="../../static/delete.png"></image
+                        ></view>
+                        <!-- <view class="imgItem" @click="editGroup(item)"
+                            ><image src="../../static/edit.png"></image></view
+                        > -->
+                        <view class="imgItem" @click="shareItem(item)"
+                            ><image
+                                src="../../static/shareTwo.png"
+                            ></image></view
+                    ></view>
+                </view>
+                <view class="itemContent">
+                    <view class="itemCard" @click="sharePages(item)"
+                        ><view class="cardTitle">全部设备</view
+                        ><view class="cardContent"
+                            ><text class="titleOne">{{ item.totalDevice }}</text
+                            ><text class="titleTwo">台</text></view
+                        ></view
+                    >
+                    <view class="itemCard"
+                        ><view class="cardTitle">在线设备</view
+                        ><view class="cardContent"
+                            ><text class="titleOne">{{
+                                item.onlineDevice
+                            }}</text
+                            ><text class="titleTwo">台</text></view
+                        ></view
+                    >
+                    <view class="itemCard"
+                        ><view class="cardTitle">报警设备</view
+                        ><view class="cardContent"
+                            ><text class="warnOne">{{
+                                item.warningDevice
+                            }}</text
+                            ><text class="warnTwo">台</text></view
+                        ></view
+                    >
+                </view>
             </view>
         </view>
 
@@ -87,6 +101,7 @@ export default {
             userId: uni.getStorageSync("userId"),
             groupList: [],
             editFlag: false,
+            selectItem: "",
         };
     },
     methods: {
@@ -140,7 +155,6 @@ export default {
                 .then((res) => {
                     if (res.data.data) {
                         this.groupList = res.data.data;
-                        console.log(this.groupList, 8888);
                     }
                 })
                 .catch((err) => {});
@@ -189,47 +203,13 @@ export default {
             this.addGroupModle = true;
             this.editFlag = true;
             this.groupName = item.groupName;
+            this.selectItem = item;
         },
-        sureEditGroup() {
-            if (this.groupName.trim() == "") {
-                uni.showToast({
-                    title: "请输入家庭名称",
-                    icon: "none",
-                    duration: 1500,
-                });
-                return;
-            }
-            let groupEditParams = {
-                groupUuid: this.groupList.find(
-                    (g) => g.groupName === this.groupName
-                ).groupUuid,
-                groupName: this.groupName,
-            };
-            this.$http
-                .post("wap/group/updateGroup", groupEditParams, {
-                    header: {
-                        "Content-Type": "application/json;charset=UTF-8",
-                    },
-                })
-                .then((res) => {
-                    if (res.data.code == 200) {
-                        uni.showToast({
-                            title: "编辑家庭成功",
-                            icon: "success",
-                            duration: 1500,
-                        });
-                        this.addGroupModle = false;
-                        this.groupName = "";
-                        this.editFlag = false;
-                    } else {
-                        uni.showToast({
-                            title: res.data.message,
-                            icon: "none",
-                            duration: 1500,
-                        });
-                    }
-                    this.getdevList();
-                });
+        shareItem(item) {
+            console.log(item, 99999);
+        },
+        sharePages(item) {
+            console.log(item);
         },
     },
     onShow() {
@@ -243,8 +223,8 @@ export default {
 .box {
     height: 100vh;
     background: linear-gradient(180deg, #faede2 0%, #f4f4f4 100%);
-    box-sizing: border-box;
     padding-top: 20rpx;
+    box-sizing: border-box;
     .addHome {
         width: 200rpx;
         height: 60rpx;
@@ -258,76 +238,81 @@ export default {
         color: #111;
     }
 
-    .listItem {
-        margin: 20rpx auto 0;
-        width: 710rpx;
-        height: 320rpx;
-        background: #ffffff;
-        border: 3rpx solid #ffffff;
-        border-radius: 38rpx;
-        box-shadow: 0rpx 3rpx 14rpx rgba(12, 26, 52, 0.03);
+    .listBox {
+        height: 95vh;
         box-sizing: border-box;
-        .itemHeader {
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            padding: 38rpx 38rpx;
-            .itemTitle {
-                width: 60%;
-                font-family: MiSans;
-                color: #111111;
-                font-size: 38rpx;
-                letter-spacing: 1.8rpx;
-            }
-            .itemOption {
-                width: 40%;
+        overflow-y: scroll;
+        .listItem {
+            margin: 20rpx auto 0;
+            width: 710rpx;
+            height: 320rpx;
+            background: #ffffff;
+            border: 3rpx solid #ffffff;
+            border-radius: 38rpx;
+            box-shadow: 0rpx 3rpx 14rpx rgba(12, 26, 52, 0.03);
+            box-sizing: border-box;
+            .itemHeader {
                 display: flex;
                 justify-content: space-between;
                 align-items: center;
-                .imgItem {
-                    width: 38rpx;
-                    height: 38rpx;
-                    image {
+                padding: 38rpx 38rpx;
+                .itemTitle {
+                    width: 80%;
+                    font-family: MiSans;
+                    color: #111111;
+                    font-size: 38rpx;
+                    letter-spacing: 1.8rpx;
+                }
+                .itemOption {
+                    width: 20%;
+                    display: flex;
+                    justify-content: space-between;
+                    align-items: center;
+                    .imgItem {
                         width: 38rpx;
                         height: 38rpx;
+                        image {
+                            width: 38rpx;
+                            height: 38rpx;
+                        }
                     }
                 }
             }
-        }
-        .itemContent {
-            display: flex;
-            justify-content: space-around;
-            margin-top: 20rpx;
-            .itemCard {
+            .itemContent {
                 display: flex;
-                flex-direction: column;
-                justify-content: center;
-                align-items: center;
-                .cardTitle {
-                    color: #666666;
-                    font-size: 24rpx;
-                }
-                .cardContent {
-                    margin-top: 15rpx;
-                    .titleOne {
-                        font-weight: 700;
-                        color: #6c564f;
-                        font-size: 66rpx;
-                    }
-                    .titleTwo {
-                        font-weight: 500;
-                        color: #6c564f;
+                justify-content: space-around;
+                margin-top: 20rpx;
+                .itemCard {
+                    display: flex;
+                    flex-direction: column;
+                    justify-content: center;
+                    align-items: center;
+                    .cardTitle {
+                        color: #666666;
                         font-size: 24rpx;
                     }
-                    .warnOne {
-                        font-weight: 700;
-                        color: #f55050;
-                        font-size: 66rpx;
-                    }
-                    .warnTwo {
-                        font-weight: 500;
-                        color: #f55050;
-                        font-size: 24rpx;
+                    .cardContent {
+                        margin-top: 15rpx;
+                        .titleOne {
+                            font-weight: 700;
+                            color: #6c564f;
+                            font-size: 66rpx;
+                        }
+                        .titleTwo {
+                            font-weight: 500;
+                            color: #6c564f;
+                            font-size: 24rpx;
+                        }
+                        .warnOne {
+                            font-weight: 700;
+                            color: #f55050;
+                            font-size: 66rpx;
+                        }
+                        .warnTwo {
+                            font-weight: 500;
+                            color: #f55050;
+                            font-size: 24rpx;
+                        }
                     }
                 }
             }