Browse Source

APP问题修改

bobo04052021@163.com 2 months ago
parent
commit
4f698503de

+ 18 - 7
pages/history/history.vue

@@ -22,13 +22,11 @@
           <div class="btns">
             <u-button
               type="primary"
-              shape="circle"
               :text="StartTime ? StartTime : '起始时间'"
               @click="dataShow = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               :text="EndTime ? EndTime : '结束时间'"
               @click="dataShow1 = true"
             ></u-button>
@@ -36,19 +34,16 @@
           <div class="btns" style="margin-top: 10px">
             <u-button
               type="primary"
-              shape="circle"
               :text="deviceName ? deviceName : '选择设备'"
               @click="deviceShow = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               :text="lable ? lable : '间隔时间'"
               @click="show = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               text="查询"
               @click="checkHistory"
             ></u-button>
@@ -83,7 +78,10 @@
             v-model="dataTime"
           ></u-datetime-picker>
         </div>
-        <u-list class="historycontainer">
+        <u-list
+          :class="{ emptyhistory: historyData.length === 0 }"
+          class="historycontainer"
+        >
           <template v-if="historyData.length > 0">
             <u-list-item
               class="itemback"
@@ -166,7 +164,6 @@
               </view>
             </u-list-item>
           </template>
-
           <template v-else>
             <div class="empty-message">数据为空</div>
           </template>
@@ -461,11 +458,16 @@ export default {
 </script>
 
 <style>
+.emptyhistory {
+  background: url("/static/empty.png") no-repeat;
+  background-size: 100% 50%;
+}
 .empty-message {
   display: flex;
   justify-content: center;
   align-items: center;
   font-size: 16px;
+  line-height: 80vh;
   color: #333;
 }
 .main {
@@ -483,6 +485,15 @@ export default {
 .btns {
   display: flex;
 }
+.btns > * {
+  margin-right: 10px; /* 根据需要调整间距大小 */
+}
+
+/* 去除最后一个按钮的右边距 */
+.btns > *:last-child {
+  margin-right: 0;
+}
+
 .flcard {
   padding: 20rpx;
   background-color: #ffffff;

+ 21 - 1
pages/home/detail/autodoor/autodoor.vue

@@ -98,6 +98,19 @@
             :height="height"
           ></fanlocalAnimate>
         </div>
+        <div class="flcard" v-if="this.TabCur == 'fanmain'">
+          <fanmainAnimate
+            ref="fanpage"
+            style="width: 100%; min-width: 550px; height: calc(68vh - 220px)"
+            :door1="door1"
+            :topdoor1="topdoor1"
+            :fundoor1="fundoor1"
+            :door2="door2"
+            :topdoor2="topdoor2"
+            :fundoor2="fundoor2"
+            :nowfengji="qidongfengji"
+          ></fanmainAnimate>
+        </div>
         <div
           class="flcard"
           v-if="this.TabCur == 'window' && this.nwindownum == 1"
@@ -276,6 +289,7 @@ import doorAnimate from "../doorAnimate/doorAnimate.vue";
 import windowAnimate from "../windowAnimate/windowAnimate.vue";
 import windrectAnimate from "../windrectAnimate/windrectAnimate.vue";
 import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
+import fanmainAnimate from "../fanmainAnimate/fanmainAnimate.vue";
 export default {
   data() {
     return {
@@ -327,7 +341,13 @@ export default {
     this.TabCur = query.type;
     this.ndoorcount = 2;
   },
-  components: { doorAnimate, windowAnimate, windrectAnimate, fanlocalAnimate },
+  components: {
+    doorAnimate,
+    windowAnimate,
+    windrectAnimate,
+    fanlocalAnimate,
+    fanmainAnimate,
+  },
   created() {
     this.getShowList(this.TabCur);
     this.getDeviceInfo(this.itemId);

+ 32 - 15
pages/home/home.vue

@@ -161,6 +161,7 @@ export default {
       curlist: [],
       deviceList: {},
       colums: {},
+      typeList: [], //详情页展示数据
     };
   },
   props: ["showColum", "deviceType"],
@@ -262,22 +263,38 @@ export default {
     devicemenuShow(e) {
       this.menushow = !this.menushow;
     },
-    // menuClick(id) {
-    //   this.TabCur = id;
-    //   // 显示该分类的数据
-    //   this.curlist = this.deviceList[this.TabCur];
-
-    //   if (this.curlist == null) {
-    //     this.curlist = [];
-    //   }
-    //   // 选择设备分类,重新获取数据
-    //   this.loadData(this.TabCur);
-    //   this.menushow = false;
-    // },
+    //获取app展示字段数据
+    getShowList(type) {
+      const params = {
+        devicekind: type,
+        pagetype: "detail",
+        pageNo: 1,
+        pageSize: 100,
+      };
+      return new Promise((resolve, reject) => {
+        api
+          .getShowColumList(params)
+          .then((response) => {
+            if (response.data.code == 200) {
+              this.typeList = response.data.result.records;
+              resolve(response);
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            reject(error);
+          });
+      });
+    },
     openNewPage(params) {
-      this.$destroy();
-      uni.navigateTo({
-        url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+      this.getShowList(this.TabCur).then(() => {
+        if (this.typeList.length > 0) {
+          this.$destroy();
+          uni.navigateTo({
+            url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+          });
+        }
       });
     },
   },

+ 24 - 19
pages/operation/operation.vue

@@ -6,13 +6,11 @@
           <div class="btns">
             <u-button
               type="primary"
-              shape="circle"
               :text="StartTime ? StartTime : '起始时间'"
               @click="dataShow = true"
             ></u-button>
             <u-button
               type="primary"
-              shape="circle"
               :text="EndTime ? EndTime : '结束时间'"
               @click="dataShow1 = true"
             ></u-button>
@@ -105,36 +103,34 @@ export default {
     };
   },
 
-  props: ["showColum", 'deviceType'],
+  props: ["showColum", "deviceType"],
   watch: {
     showColum(data) {
       this.colums = data;
     },
-  	deviceType: {
-  		handler (data) {
-  			if(data){
-  				this.TabCur = data;
-  				// 选择设备分类,重新获取数据
-  				this.$emit('setMenushow', {
-					menushow: false
-  				});
-  			}
-  		  
-  		  
-  		},
-  		immediate: true
-  	}
+    deviceType: {
+      handler(data) {
+        if (data) {
+          this.TabCur = data;
+          // 选择设备分类,重新获取数据
+          this.$emit("setMenushow", {
+            menushow: false,
+          });
+        }
+      },
+      immediate: true,
+    },
   },
   created() {
     this.colums = this.showColum;
-    const startTime =new Date().getTime() - 3600 * 1000 * 24 * 30;
+    const startTime = new Date().getTime() - 3600 * 1000 * 24 * 30;
     const endTime = new Date();
     this.StartTime = dayjs(startTime).format("YYYY-MM-DD HH:mm:ss");
     this.EndTime = dayjs(endTime).format("YYYY-MM-DD HH:mm:ss");
     this.checkHistoryData();
   },
   mounted() {
-	  this.TabCur = this.deviceType;
+    this.TabCur = this.deviceType;
   },
   methods: {
     //选择起始时间
@@ -202,6 +198,15 @@ export default {
 .btns {
   display: flex;
 }
+.btns > * {
+  margin-right: 10px; /* 根据需要调整间距大小 */
+}
+
+/* 去除最后一个按钮的右边距 */
+.btns > *:last-child {
+  margin-right: 0;
+}
+
 .flcard {
   padding: 20rpx;
   background-color: #ffffff;

BIN
static/empty.png


BIN
static/mainfan/door-new-1.png


BIN
static/mainfan/fengji-left.png


BIN
static/mainfan/fengji-right2.png


BIN
static/mainfan/fun-door-new-1.png


BIN
static/mainfan/fun-door-new-2.png


BIN
static/mainfan/main_ventilate_new.png


BIN
static/mainfan/page-back.png


BIN
static/mainfan/topwindow-new-2.png