Browse Source

2025-3-10

cmy 2 days ago
parent
commit
39cd2828ca
1 changed files with 14 additions and 1 deletions
  1. 14 1
      library/Event/SocketEvent.js

+ 14 - 1
library/Event/SocketEvent.js

@@ -15,10 +15,14 @@ import store from "@/store/index.js";
 //#endif
 class SocketEvent {
 	app = null;
+	// #ifdef APP-PLUS-NVUE
 	allApp = null;
+	//#endif
 	constructor(app) {
 	    this.app = app;
-		this.allApp = getApp()
+		// #ifdef APP-PLUS-NVUE
+		this.allApp = getApp({allowDefault: true})
+		//#endif
 	}
 	/**
 	 * 打开项目
@@ -84,10 +88,19 @@ class SocketEvent {
 		if(res.code == 'friend_add') {
 			if(this.app.utils.isJSON(res.data)) {
 				var data= JSON.parse(res.data);
+				// #ifdef APP-PLUS-NVUE
 				//消息提示
 				let bagenumAr = allApp.$store.state.txbagenum;
 				bagenumAr.applyCount ++;
 				allApp.$store.commit('setTxbagenum',bagenumAr);
+				//#endif
+				// #ifndef APP-PLUS-NVUE
+				//消息提示
+				let bagenumAr = store.state.txbagenum;
+				bagenumAr.applyCount ++;
+				store.commit('setTxbagenum',bagenumAr);
+				//#endif
+				
 			}
 		}