Browse Source

首页消息修改

xiaohaizhao 1 year ago
parent
commit
f930505809
3 changed files with 8 additions and 5 deletions
  1. 5 3
      pages/index/modules/notice.vue
  2. 1 1
      pages/login/modules/account.vue
  3. 2 1
      utils/Socket.js

+ 5 - 3
pages/index/modules/notice.vue

@@ -1,5 +1,5 @@
 <template>
-    <view class="container"><!--  bgColor="#EFF4FA" color="#333" -->
+    <view class="container" v-if="text.length"><!--  bgColor="#EFF4FA" color="#333" -->
         <u-notice-bar direction="column" mode="link" fontSize='3.733vw' :text="text" @click="onClick" />
     </view>
 </template>
@@ -13,7 +13,8 @@ export default {
         };
     },
     created() {
-        this.getList()
+        this.getList();
+        this.$Http.updateMessage = this.getList.bind(this);
     },
     methods: {
         getList() {
@@ -31,7 +32,8 @@ export default {
             }).then(res => {
                 console.log("滚动消息", res)
                 if (this.cutoff(res.msg)) return;
-                this.text = ["4v电池电量告警!当前设备“4V电池电量”值为“90”,<100时触发警告", '上游压力异常告警!当前设备“上游当前压力”值为“3”<5时触发警告', '下游压力异常告警!当前设备“下游当前压力”值为“5”,<10时触发警告']
+                if (res.data.length) this.text = res.data.map(v => v.message)
+                // this.text = ["4v电池电量告警!当前设备“4V电池电量”值为“90”,<100时触发警告", '上游压力异常告警!当前设备“上游当前压力”值为“3”<5时触发警告', '下游压力异常告警!当前设备“下游当前压力”值为“5”,<10时触发警告']
             })
         },
         onClick(index) {

+ 1 - 1
pages/login/modules/account.vue

@@ -16,7 +16,7 @@
 				<u-checkbox :checked="memory == 1" />记住密码
 			</navigator>
 
-			<navigator class="navigator" url="#">忘记密码?</navigator>
+			<!-- <navigator class="navigator" url="#">忘记密码?</navigator> -->
 		</view>
 		<u-button :customStyle="butSty" :disabled="account.account == '' || account.password == ''" :loading="loading"
 			loadingText='登陆中...' @click="startLogging">

+ 2 - 1
utils/Socket.js

@@ -19,7 +19,8 @@ class Socket {
             this.socketEstablish = true;
         })
         this.SocketTask.onMessage(function (res) {
-            this.socketCallback(res)
+            // this.socketCallback(res)
+            this.$Http.updateMessage && this.$Http.updateMessage()
         })
         this.SocketTask.onError(function (res) {
             this.socketEstablish = false;