luke 6 жил өмнө
parent
commit
56b31fe238

+ 1 - 1
service_exe/src/renderer/App.vue

@@ -200,9 +200,9 @@
 
         //接收用户消息数据
         if(redata.message_type == "chatMessage"){
+          this.Messagenum = this.$store.getters.get_megnum;
           this.Messagenum = ++this.Messagenum;
           this.$store.dispatch("SET_MEGNNUM", this.Messagenum);
-          sessionStorage.setItem('Messagenum', this.Messagenum)
           this.receiveAudio();
           let _this =this;
           this.$public.receivesMessage(redata.data,session,this.$frce,function(data,chatList,index){

+ 12 - 14
service_exe/src/renderer/components/leftNav.vue

@@ -80,9 +80,8 @@
 				if(str == 'TheCurrentSession'){
 					this.$store.dispatch("SET_MEG", false);
 					this.megnum = 0;
-					sessionStorage.setItem('Messagenum', 0);
+					this.$store.dispatch("SET_MEGNNUM",0);
 				}else {
-					this.megnum = sessionStorage.getItem('Messagenum') -1;
 					this.$store.dispatch("SET_MEG", true);
 				}
 
@@ -91,22 +90,21 @@
 				this.$router.push({path, query: {pid: escape("这就是一个编码没有什么用啊")}});
 			}
 		},
-
-		// computed: {
-		// 	getTitleActive() {
-		// 		return this.$store.getters.get_megnum
-		// 	}
-		// },
-		// watch: {
-		// 	getTitleActive(val){
-		// 		this.megnum = val;
-		// 	}
-		// },
+		computed: {
+			getTitleActive() {
+				return this.$store.getters.get_megnum
+			}
+		},
+		watch: {
+			getTitleActive(val){
+				this.megnum = this.megnum = val;
+			}
+		},
 		mounted() {
 			this.titleActive = this.$store.getters.get_navState;
 			this.logo = sessionStorage.getItem('logo');
 			this.showMeg = this.$store.getters.get_meg;
-			this.megnum = sessionStorage.getItem('Messagenum')
+			this.megnum = this.$store.getters.get_megnum;
 		},
 	};
 </script>