Browse Source

2025-3-10

cmy 1 day ago
parent
commit
4b87cfe596

+ 3 - 1
App.vue

@@ -1,6 +1,8 @@
 <script>
 	export default {
-		
+		globalData:{
+			webSocket:''
+		},
 		onLaunch: function() {
 			console.log('App Launch')
 		},

+ 35 - 14
library/Base.js

@@ -1,20 +1,22 @@
 import WebSokcet from "./socket/WebSokcet.js";
 import SocketEvent from "./Event/SocketEvent.js";
-// #ifndef APP-PLUS-NVUE
+// #ifdef APP-PLUS
+import utils from "@/library/utils/Comm.js"
+import global from "@/config/global.js";
+//#endif
+// #ifndef APP-PLUS
 import store from "@/store/index.js";
 //#endif
 class Base {
 	Vue = {};
 	//容器
 	Container = null;
-	app=null;
 	constructor(vue,container) {
 		this.Vue = vue;
 		this.Container = container;
 		this.init();
-		this.app = getApp()
 	}
-	init() {
+	async init() {
 		//添加全局库
 		this.Vue.prototype.global = this.Container.make(require("@/config/global.js"),"global");
 		//添加com库
@@ -22,7 +24,13 @@ class Base {
 		//请求库
 		this.Vue.prototype.request = this.Container.make(require('@/library/Request.js'));
 		//webSocket
-		let websocket = new WebSokcet({wsUrl:this.Vue.prototype.global.wsSocketUrl});
+		// #ifdef APP
+		const wsurl = global.wsSocketUrl
+		// #endif
+		// #ifndef APP
+		const wsurl = this.Vue.prototype.global.wsSocketUrl
+		// #endif
+		let websocket = new WebSokcet({wsUrl:wsurl});
 		websocket.setKey(this.Vue.prototype.global.putoken);
 		this.Vue.prototype.$deviceType = 'web';
 		//#ifdef H5
@@ -52,8 +60,15 @@ class Base {
 				this.Vue.prototype.$device = res;
 			}
 		});
-		let socketEvent = new SocketEvent(this.Vue.prototype);
+		// #ifdef APP
+		const obj =await utils.getAppStore()
+		// #endif
+		// #ifndef APP
+		const obj = this.Vue.prototype
+		// #endif
+		let socketEvent = new SocketEvent(obj);
 		websocket.setBackCall((type,res)=>{
+			// console.log(1111)
 			if(type == 'onOpen'){
 				socketEvent.onOpen(res);
 			}
@@ -80,22 +95,30 @@ class Base {
 			}
 		});
 		// websocket.connect();
+		// #ifdef APP-PLUS
+		const {globalData} = await utils.getAppStore();
+		globalData.webSocket = websocket;
+		//#endif
+		// #ifndef APP-PLUS
 		this.Vue.prototype.webSocket = websocket;
+		//#endif
 	}
 	/**
 	 * ipc全局拦截访问
 	 * @param {Object} page 当前页面page
 	 * @param {Object} options 参数
 	 */
-	ipc(page,options){
+	async ipc(page,options){
 		var tj_uid = options.tj_uid || '';
 		var ipc = options.ipc || '';
-		
+		// #ifdef APP
+		const app = await utils.getAppStore()
+		// #endif
 		if(tj_uid != '' && tj_uid != null) {
-			// #ifdef APP-PLUS-NVUE
+			// #ifdef APP-PLUS
 			app.$store.commit('setTjuid',tj_uid);
 			//#endif
-			// #ifndef APP-PLUS-NVUE
+			// #ifndef APP-PLUS
 			store.commit('setTjuid',tj_uid);
 			//#endif
 		}
@@ -108,17 +131,15 @@ class Base {
 			var data = options.data || '';
 			try{
 				let dataAr = JSON.parse(data);
-				// #ifdef APP-PLUS-NVUE
+				// #ifdef APP-PLUS
 				app.$store.commit('setUser',dataAr);
 				//#endif
-				// #ifndef APP-PLUS-NVUE
+				// #ifndef APP-PLUS
 				store.commit('setUser',dataAr);
 				//#endif
 			}  catch(e){}	
 		}
 	}
-	
-	
 }
 
 export default Base;

+ 82 - 76
library/Event/SocketEvent.js

@@ -9,130 +9,136 @@
 // +----------------------------------------------------------------------
 import md5 from "../vendor/md5.js";
 import Message from "../socket/Message.js";
+import utils from "@/library/utils/Comm.js";
 // #ifndef APP-PLUS
 import store from "@/store/index.js";
 //#endif
+import Request from "@/library/Request.js";
 class SocketEvent {
 	app = null;
-	// #ifdef APP-PLUS-NVUE
-	allApp = null;
-	//#endif
 	constructor(app) {
-	    this.app = app;
-		// #ifdef APP-PLUS-NVUE
-		this.allApp = getApp()
-		//#endif
+		this.app = app;
 	}
 	/**
 	 * 打开项目
 	 * @param {Object} res
 	 */
-	onOpen(res) {
-		uni.$emit('socketOpen',res);
-		// #ifdef APP-PLUS-NVUE
+	async onOpen(res) {
+		console.log(res, 'res打开')
+		uni.$emit('socketOpen', res);
+		// #ifdef APP-PLUS
+		const allApp = await utils.getAppStore()
+		// console.log(allApp)
 		let user = allApp.$store.state.user;
 		//#endif
-		// #ifndef APP-PLUS-NVUE
+		// #ifndef APP-PLUS
 		let user = store.state.user;
 		//#endif
-		if(user != null) {
-			this.app.webSocket.send(new Message(user.token,"auth",true),
-			(res)=>{
-				let data = JSON.parse(res);
-				if(data.type == 'auth_yes') {
-					
-				}
-				
-				if(data.type == 'auth_error') {
-					//store.commit('loginOut');
-				//	uni.showToast({ 'title'	: data.msg,duration : 3000,icon:'none'});
-				}
-				
-				this.app.request.get("chatBagenum").then(res=>{
-					if(res.code == 200) {
-						// #ifdef APP-PLUS-NVUE
-						allApp.$store.commit('setTxbagenum',res.data);
-						//#endif
-						// #ifndef APP-PLUS-NVUE
-						store.commit('setTxbagenum',res.data);
-						//#endif
+		if (user != null) {
+			// #ifdef APP-PLUS
+			const webSocket = allApp.globalData.webSocket;
+			//#endif
+			// #ifndef APP-PLUS
+			const webSocket =this.app.webSocket
+			//#endif
+			webSocket.send(new Message(user.token, "auth", true),
+				(res) => {
+					let data = JSON.parse(res);
+					if (data.type == 'auth_yes') {
+
+					}
+
+					if (data.type == 'auth_error') {
+						//store.commit('loginOut');
+						//	uni.showToast({ 'title'	: data.msg,duration : 3000,icon:'none'});
 					}
-				}).catch((err)=>{
-					
+
+					Request.get("chatBagenum").then(res => {
+						if (res.code == 200) {
+							// #ifdef APP-PLUS
+							allApp.$store.commit('setTxbagenum', res.data);
+							//#endif
+							// #ifndef APP-PLUS
+							store.commit('setTxbagenum', res.data);
+							//#endif
+						}
+					}).catch((err) => {
+
+					});
+
+				}, () => {
+					console.log('测试失败了');
 				});
-				
-			},()=>{
-				console.log('测试失败了');
-			});
 		}
 	}
-	onMessage(res) {
-		if(res.code == 'chat' || res.code == 'group_chat') {
-			// #ifdef APP-PLUS-NVUE
+	async onMessage(res) {
+		// #ifdef APP-PLUS
+		const allApp = await utils.getAppStore()
+		//#endif
+		if (res.code == 'chat' || res.code == 'group_chat') {
+			// #ifdef APP-PLUS
 			let bagenum = allApp.$store.state.txbagenum;
 			//bagenum.count ++;
-			bagenum.chatCount ++;
-			allApp.$store.commit('setTxbagenum',bagenum);
+			bagenum.chatCount++;
+			allApp.$store.commit('setTxbagenum', bagenum);
 			//#endif
-			// #ifndef APP-PLUS-NVUE
+			// #ifndef APP-PLUS
 			let bagenum = store.state.txbagenum;
 			//bagenum.count ++;
-			bagenum.chatCount ++;
-			store.commit('setTxbagenum',bagenum);
+			bagenum.chatCount++;
+			store.commit('setTxbagenum', bagenum);
 			//#endif
-		
 		}
-		
+
 		//对方添加好友
-		if(res.code == 'friend_add') {
-			if(this.app.utils.isJSON(res.data)) {
-				var data= JSON.parse(res.data);
-				// #ifdef APP-PLUS-NVUE
+		if (res.code == 'friend_add') {
+			if (utils.isJSON(res.data)) {
+				var data = JSON.parse(res.data);
+				// #ifdef APP-PLUS
 				//消息提示
 				let bagenumAr = allApp.$store.state.txbagenum;
-				bagenumAr.applyCount ++;
-				allApp.$store.commit('setTxbagenum',bagenumAr);
+				bagenumAr.applyCount++;
+				allApp.$store.commit('setTxbagenum', bagenumAr);
 				//#endif
-				// #ifndef APP-PLUS-NVUE
+				// #ifndef APP-PLUS
 				//消息提示
 				let bagenumAr = store.state.txbagenum;
-				bagenumAr.applyCount ++;
-				store.commit('setTxbagenum',bagenumAr);
+				bagenumAr.applyCount++;
+				store.commit('setTxbagenum', bagenumAr);
 				//#endif
-				
 			}
 		}
-		
+
 		//申请进群
-		if(res.code == 'group_add') {
-			
+		if (res.code == 'group_add') {
+
 		}
-		
-		
-		uni.$emit('socketMessage',res);
+
+
+		uni.$emit('socketMessage', res);
 		return '';
 	}
-	
+
 	onError(res) {
-		uni.$emit('socketClose',res);
+		uni.$emit('socketClose', res);
 	}
-	
+
 	onStop(res) {
-		uni.$emit('socketClose',res);
+		uni.$emit('socketClose', res);
 	}
-	
+
 	onClose(res) {
-		uni.$emit('socketClose',res);
+		uni.$emit('socketClose', res);
 	}
-	onSendError(res){
-		uni.$emit('socketSendError',res);
+	onSendError(res) {
+		uni.$emit('socketSendError', res);
 	}
 	onSendSuccess(res) {
-		uni.$emit('socketSendSuccess',res);
+		uni.$emit('socketSendSuccess', res);
 	}
-	
-	onHeartBeat(res){
-		uni.$emit('socketHeartBeat',res);
+
+	onHeartBeat(res) {
+		uni.$emit('socketHeartBeat', res);
 	}
 }
 

+ 4 - 6
library/Http.js

@@ -19,7 +19,7 @@ class Http {
 	interceptors = {
 		//请求之前
 		before: (call) =>  {
-			this.baseCall.before.push(call);
+		 	this.baseCall.before.push(call);
 		},
 		//请求之后
 		after: (call) => {
@@ -84,18 +84,16 @@ class Http {
 	/**
 	 * 提交数据
 	 */
-	buld(method) {
+	async buld(method) {
 		//提交之前
 		for (var i in this.baseCall.before) {
-			var b = this.baseCall.before[i].call(this);
+			var b =await this.baseCall.before[i].call(this);
 			//进行拦截
 			if(b != null && b === false) {
 				this.intercept();
 				return;
 			}
 		}
-		// console.log(this.baseUrl,'this.baseUrl')
-		// console.log(this.header,'this.header')
 		uni.request({
 			url: this.baseUrl,
 			method: method,
@@ -139,7 +137,7 @@ class Http {
 						this.baseCall.complete[i].call(this,res);
 					}
 				} else {
-					console.log(res);
+					// console.log(res);
 					for (var i in this.baseCall.fail) {
 						this.baseCall.fail[i].call(this,res.errMsg);
 					}

+ 4 - 2
library/Request.js

@@ -5,6 +5,7 @@ import Before from "./interceptors/Before.js";
 import Complete from "./interceptors/Complete.js";
 import Success from "./interceptors/Success.js";
 import Fail from "./interceptors/Fail.js";
+import utils from "@/library/utils/Comm.js"
 // #ifndef APP-PLUS-NVUE
 import store from "@/store/index.js";
 //#endif
@@ -81,7 +82,7 @@ let Request = {
 	 * 提交数据
 	 */
 	build: async function(name,post,method,data = {},img = null,inputName=null){
-		return await new Promise((resolve, reject) => {
+		return await new Promise(async (resolve, reject) => {
 			let http = new Http();
 			//类型
 			if(data.type != null) {
@@ -97,6 +98,7 @@ let Request = {
 			//全局监听口
 			let interceptors = this.interceptors();
 			for(var i in interceptors) {
+				// console.log(http.interceptors.hasOwnProperty(i),i,'http.interceptors.hasOwnProperty(i)')
 				http.interceptors.hasOwnProperty(i) ? http.interceptors[i](interceptors[i]) : '';
 			}
 			//监听口
@@ -126,7 +128,7 @@ let Request = {
 			} else {
 				// #ifdef APP-PLUS-NVUE
 				// console.log(app,'app')
-				const app = getApp()
+				const app =await utils.getAppStore()
 				url =  app.$store.state.http + api[name];
 				// #endif
 				// #ifndef APP-PLUS-NVUE

+ 0 - 3
library/interceptors/After.js

@@ -9,11 +9,8 @@
 // +----------------------------------------------------------------------
 
 class After {
-	app = null;
 	constructor(http) {
-	    this.app = getApp();
 	}
-	
 	create() {
 		//console.log(store.user);
 	}

+ 37 - 40
library/interceptors/Before.js

@@ -12,53 +12,50 @@ import global from "../../config/global.js";
 // import { v4 as uuidv4 } from "uuid";
 import utils from "@/library/utils/Comm.js";
 class Before {
-	app = null;
-	http = null;
-	constructor(http) {
-		this.app = getApp();
+	constructor() {
 	}
 	/**
 	 * [监听]和[拦截]
 	 */
-	create() {
-		var salt = global.putoken;
-		var app = getApp();
-		var post = {};
-		post['token'] =  app.$store.state.user != null ?  app.$store.state.user.token : "";
-		//设备号
-		post['deviceId'] = app.$store.state.uuid;
-		//设备类型
-		post["deviceType"] = app.$device.platform == 'ios' ? 2 : 1;
-		//#ifdef APP-PLUS
-		post["fromApp"] = "app";
-		//#endif
+	async create() {
+		try {
+			var salt = global.putoken;
+			var app = await utils.getAppStore();
+			var post = {};
+			post['token'] = app.$store.state.user != null ? app.$store.state.user.token : "";
+			//设备号
+			post['deviceId'] = app.$store.state.uuid;
+			//设备类型
+			post["deviceType"] = app.$device.platform == 'ios' ? 2 : 1;
+			//#ifdef APP-PLUS
+			post["fromApp"] = "app";
+			//#endif
+			//#ifndef APP-PLUS
+			post["fromApp"] = "h5";
+			//#endif
+			post["mobileType"] = app.$device.model + "(" + app.$device.system + ")";
+			//版本号
+			post["version"] = global.version;
+			//内部版本号
+			post['appCode'] = global.app_code;
+			//校验标码
+			post['noction'] = utils.uuidv4();
+			//访问时间戳
+			post["timestamp"] = Date.parse(new Date());
+			var signAr = [];
+			for (var i in post) {
+				signAr.push(i + "=" + post[i]);
+			}
+			var signStr = md5(salt + signAr.join(','));
+			post['sign'] = signStr;
+			for (var i in post) {
+				this.setHeader(i, post[i]);
+			}
 
-		//#ifndef APP-PLUS
-		post["fromApp"] = "h5";
-		//#endif
-
-		post["mobileType"] = app.$device.model + "(" + app.$device.system + ")";
-		//版本号
-		post["version"] = global.version;
-		//内部版本号
-		post['appCode'] = global.app_code;
-		//校验标码
-		post['noction'] = utils.uuidv4();
-		//访问时间戳
-		post["timestamp"] = Date.parse(new Date());
-		var signAr = [];
-		for (var i in post) {
-			signAr.push(i + "=" + post[i]);
-		}
-		var signStr = md5(salt + signAr.join(','));
-		post['sign'] = signStr;
-		for (var i in post) {
-			this.setHeader(i, post[i]);
+		} catch (error) {
+			console.log(error)
 		}
 	}
-
-
-
 }
 
 export default Before;

+ 0 - 2
library/interceptors/Fail.js

@@ -8,9 +8,7 @@
 // | Author: Mr Table <admin@hjf.pw>
 // +----------------------------------------------------------------------
 class Fail {
-	app = null;
 	constructor(http) {
-	    this.app = getApp();
 	}
 	//不支持拦截
 	create() {

+ 1 - 0
library/socket/WebSokcet.js

@@ -115,6 +115,7 @@ class WebSokcet {
    * 设置事件
    */
   setBackCall(call) {
+	  // console.log(call,'设置事件')
     this.eventCall = call;
   }
   

+ 4 - 11
library/utils/Comm.js

@@ -934,10 +934,6 @@ function removeTrailingZeros(num) {
 	}
 }
 
-
-
-
-
 function isJSON(str) {
 	if (typeof str == 'string') {
 		try {
@@ -960,15 +956,13 @@ const uuidv4 = function() {
 	})
 }
 
-
-
-const getAppStore =async ()=>{
-	return await new Promise((resolve,reject)=>{
+const getAppStore =()=>{
+	return new Promise((resolve,reject)=>{
 		const getPageApp = ()=> {
 			try {
 				const app = getApp()
 				if (app.$store) {
-					return resolve(app)
+					resolve(app)
 				}
 			} catch (err) {
 				setTimeout(() => {
@@ -976,10 +970,9 @@ const getAppStore =async ()=>{
 				}, 200)
 			}
 		}
+		getPageApp()
 	})
 }
-
-
 export default {
 	getAppStore:getAppStore,
 	uuidv4: uuidv4,

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "长城易趣拍",
     "appid" : "__UNI__EFA020E",
     "description" : "一款电商App",
-    "versionName" : "3.4.4",
-    "versionCode" : 344,
+    "versionName" : "3.4.5",
+    "versionCode" : 336,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 22 - 11
pages/chat/chat.vue

@@ -244,7 +244,18 @@
 	import face    from "@/library/utils/Face.js";
 	const inputHeight = 260;
 	export default {  
-		computed: mapState(['user','sysData']),
+		computed:{
+			...mapState(['user','sysData']),
+			getWebSocket(){
+				// #ifdef APP-PLUS
+				const webSocket = getApp().globalData.webSocket
+				// #endif
+				// #ifndef APP-PLUS
+				const webSocket = this.webSocket
+				// #endif
+				return webSocket
+			}
+		},
 		components:{
 			chatMsg,
 			chatVoice,
@@ -360,7 +371,7 @@
 		
 		onShow() {
 			this.onKeyboardHeight();
-			this.isNetwork = !this.webSocket.socketOpen;
+			this.isNetwork = !this.getWebSocket.socketOpen;
 		},
 		
 	    methods: {
@@ -595,7 +606,7 @@
 					return;
 				}
 				//消息发送
-				var msgId = this.webSocket.createMsgId();
+				var msgId = this.getWebSocket.createMsgId();
 				var sendPack = {};
 				sendPack.data = this.msg;
 				sendPack.type = "text";
@@ -620,7 +631,7 @@
 				data.time = this.utils.strtotime();
 				data.nid = 0;
 				data.msgId = msgId;
-				var bool  = this.webSocket.send(mess,(res)=>{
+				var bool  = this.getWebSocket.send(mess,(res)=>{
 					let isSend = false;
 					if(this.utils.isJSON(res)) {
 						let rAr = JSON.parse(res);
@@ -674,7 +685,7 @@
 				var mess = new Message(JSON.stringify(sendPack),"chat",true,1,true);
 				mess.id = msgId;	
 				
-				var bool  = this.webSocket.send(mess,(res)=>{
+				var bool  = this.getWebSocket.send(mess,(res)=>{
 					let isSend = false;
 					if(this.utils.isJSON(res)) {
 						let rAr = JSON.parse(res);
@@ -802,7 +813,7 @@
 			 */
 			upFileShip:function(filePath){
 				var data  = {};
-				var msgId 	  =  this.webSocket.createMsgId();
+				var msgId 	  =  this.getWebSocket.createMsgId();
 				data.chat = this.chatUser.chat;
 				data.sendUser = {
 					nickname : this.user.nickname,
@@ -837,7 +848,7 @@
 								sendPack.chat_id = "";
 								sendPack.f_uid = this.chatUser.uid;
 								sendPack.msg_id = msgId;						
-								this.webSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
+								this.getWebSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
 									(res) => {
 										var data = JSON.parse(res);
 										if(data.code == 1) {
@@ -964,7 +975,7 @@
 				var msgId = "";
 				for (var i in tempFilePaths) {
 					var data  = {};
-					msgId 	  =  this.webSocket.createMsgId();
+					msgId 	  =  this.getWebSocket.createMsgId();
 					data.chat = this.chatUser.chat;
 					data.sendUser = {
 						nickname : this.user.nickname,
@@ -1019,7 +1030,7 @@
 								sendPack.chat_id = "";
 								sendPack.f_uid = this.chatUser.uid;
 								sendPack.msg_id = tmpData.msgId;						
-								this.webSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
+								this.getWebSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
 									(res) => {
 										var data = JSON.parse(res);
 										if(data.code == 1) {
@@ -1333,7 +1344,7 @@
 				.then( res => {
 					uni.hideLoading();
 					if(res.code == 200) {
-						var msgId = this.webSocket.createMsgId();
+						var msgId = this.getWebSocket.createMsgId();
 						//消息添加
 						var data  = {};
 						data.chat = this.chatUser.chat;
@@ -1361,7 +1372,7 @@
 						sendPack.f_uid    = this.chatUser.uid;
 						sendPack.group_id = this.groupId;
 						sendPack.msg_id = msgId;				
-						this.webSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
+						this.getWebSocket.send((new Message(JSON.stringify(sendPack),"chat",true,1,true)),
 							(res) => {
 								var data = JSON.parse(res);
 								if(data.code == 1) {

+ 20 - 9
pages/chat/chatGroup.vue

@@ -308,7 +308,18 @@
 	var LetterList = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','#'];
 	const inputHeight = 260;
 	export default {
-		computed: mapState(['user','sysData']),
+		computed:{
+			...mapState(['user','sysData']),
+			getWebSocket(){
+				// #ifdef APP-PLUS
+				const webSocket = getApp().globalData.webSocket
+				// #endif
+				// #ifndef APP-PLUS
+				const webSocket = this.webSocket
+				// #endif
+				return webSocket
+			}
+		},
 		components:{
 			chatMsg,
 			chatImg,
@@ -443,7 +454,7 @@
 		
 		onShow() {
 			this.onKeyboardHeight();
-			this.isNetwork = !this.webSocket.socketOpen;
+			this.isNetwork = !this.getWebSocket.socketOpen;
 		},
 		
 	    methods: {
@@ -690,7 +701,7 @@
 					}
 				}
 				//消息发送
-				var msgId = this.webSocket.createMsgId();
+				var msgId = this.getWebSocket.createMsgId();
 				var sendPack = {};
 				sendPack.data = this.msg;
 				sendPack.type = "text";
@@ -718,7 +729,7 @@
 				data.time = this.utils.strtotime();
 				data.nid = 0;
 				data.msgId = msgId;
-				var bool  = this.webSocket.send(mess,(res)=>{
+				var bool  = this.getWebSocket.send(mess,(res)=>{
 					for(var i in this.data) {
 						if(this.data[i].msgId == msgId) {
 							this.$set(this.data[i],'isSend',1);
@@ -760,7 +771,7 @@
 				var mess = new Message(JSON.stringify(sendPack),"groupChat",true,1,true);
 				mess.id = data.msgId;	
 				
-				var bool  = this.webSocket.send(mess,(res)=>{
+				var bool  = this.getWebSocket.send(mess,(res)=>{
 					let isSend = false;
 					if(this.utils.isJSON(res)) {
 						let rAr = JSON.parse(res);
@@ -995,7 +1006,7 @@
 			upFileImg:function(tempFilePaths) {
 				var msgId = "";
 				for (var i in tempFilePaths) {
-					msgId 	  =  this.webSocket.createMsgId();
+					msgId 	  =  this.getWebSocket.createMsgId();
 					var data  = {};
 					data.chat = this.chatUser.chat;
 					data.sendUser = {
@@ -1053,7 +1064,7 @@
 								sendPack.group_id = this.groupId;
 								sendPack.msg_id = tmpData.msgId;		
 													
-								this.webSocket.send((new Message(JSON.stringify(sendPack),"groupChat",true,1,true)),
+								this.getWebSocket.send((new Message(JSON.stringify(sendPack),"groupChat",true,1,true)),
 									(res) => {
 										var data = JSON.parse(res);
 										if(data.code == 1) {
@@ -1458,7 +1469,7 @@
 				.then( res => {
 					uni.hideLoading();
 					if(res.code == 200) {
-						var msgId = this.webSocket.createMsgId();
+						var msgId = this.getWebSocket.createMsgId();
 						//消息添加
 						var data  = {};
 						data.chat = this.chatUser.chat;
@@ -1487,7 +1498,7 @@
 						sendPack.group_id = this.groupId;
 						sendPack.msg_id = msgId;
 						
-						this.webSocket.send((new Message(JSON.stringify(sendPack),"groupChat",true,1,true)),
+						this.getWebSocket.send((new Message(JSON.stringify(sendPack),"groupChat",true,1,true)),
 							(res) => {
 								var data = JSON.parse(res);
 								if(data.code == 1) {

+ 1 - 5
pages/index/index.nvue

@@ -276,10 +276,6 @@
 			this.getData();
 		},
 		methods: {
-			// ...mapMutations(['setSys', 'getGps']),
-			AllApp() {
-				return getApp()
-			},
 			isShowInit(type) {
 				// console.log(type,'type11111111111111')
 				uni.setTabBarItem({
@@ -316,7 +312,7 @@
 
 						}
 					})
-					.catch(err => {
+					.catch(error => {
 						utils.Tip("加载失败,重新点击尝试!" + JSON.stringify(error));
 						uni.hideLoading();
 					});

+ 12 - 1
pages/login/forgotPassword.vue

@@ -193,6 +193,17 @@
 			maoScroll,
 			customerWiget
 		},
+		computed: {
+			getWebSocket(){
+				// #ifdef APP-PLUS
+				const webSocket = getApp().globalData.webSocket
+				// #endif
+				// #ifndef APP-PLUS
+				const webSocket = this.webSocket
+				// #endif
+				return webSocket
+			}
+		},
 		data() {
 			return {
 				statusBarHeight: 20,
@@ -367,7 +378,7 @@
 					uni.hideLoading();
 					if(res.code == 200) {
 						this.setUser(res.data);
-						this.webSocket.connect();
+						this.getWebSocket.connect();
 						uni.reLaunch({ url:"../index/index"});
 					} else {
 						uni.showToast({ title:res.msg,icon:"none",mask:true});

+ 12 - 1
pages/login/index.vue

@@ -169,6 +169,17 @@
 			maoScroll,
 			customerWiget
 		},
+		computed: {
+			getWebSocket(){
+				// #ifdef APP-PLUS
+				const webSocket = getApp().globalData.webSocket
+				// #endif
+				// #ifndef APP-PLUS
+				const webSocket = this.webSocket
+				// #endif
+				return webSocket
+			}
+		},
 		data() {
 			return {
 				statusBarHeight: 20,
@@ -248,7 +259,7 @@
 					uni.hideLoading();
 					if(res.code == 200) {
 						this.setUser(res.data);
-						this.webSocket.connect();
+						this.getWebSocket.connect();
 						uni.reLaunch({ url:"../index/index"});
 					} else {
 						uni.showToast({ title:res.msg,icon:"none",mask:true});

+ 240 - 141
pages/login/register.vue

@@ -25,43 +25,45 @@
 					</view>
 					<input type="number" v-model="form.mobile" placeholder="请输入手机号" />
 				</view>
-				
-				
+
+
 				<view class="login-input yzm fx-r fx-bc">
 					<view class="left fx-h fx-ac">
 						<image class="icon" style="margin-left: 20rpx;" src="/static/img/login-password.png"></image>
 					</view>
-					<input type="text" v-model="form.verify"  placeholder="请输入验证码" />
+					<input type="text" v-model="form.verify" placeholder="请输入验证码" />
 					<view class="line"></view>
 					<view v-if="verifyCount <= 0" class="sbtn" @tap="getVcode">验证码</view>
 					<view v-else class="no-sbtn">{{ verifyCount }} S</view>
 				</view>
-				
-				
-				
+
+
+
 				<view class="login-input pass fx-r fx-bc">
 					<view class="left fx-h fx-ac">
 						<image class="icon" style="margin-left: 20rpx;" src="/static/img/login-password.png"></image>
 					</view>
-					<input  type="text" v-model="form.password" password="*"  placeholder="请输入密码" />
+					<input type="text" v-model="form.password" password="*" placeholder="请输入密码" />
 					<view class="fx-g1"></view>
-					<image @tap="showPass = !showPass" :src="showPass ? '/static/img/mis_pass.png' : '/static/img/ck_pass.png' " class="miss-pass"></image>
+					<image @tap="showPass = !showPass"
+						:src="showPass ? '/static/img/mis_pass.png' : '/static/img/ck_pass.png' " class="miss-pass">
+					</image>
 				</view>
 				<view class="login-input fx-r" v-if="showData">
 					<view class="left fx-h fx-ac">
 						<image class="icon" style="margin-left: 20rpx;" src="/static/img/login-password.png"></image>
 					</view>
-					<input  type="text" v-model="form.code"  placeholder="请输入邀请码(非必填)" />
+					<input type="text" v-model="form.code" placeholder="请输入邀请码(非必填)" />
 				</view>
 				<view class="btn ihover" @tap="tapSubmit">注册账号</view>
 				<view class="agament fx-r fx-bc fx-ac">
 					<view @tap="isRead = !isRead" class="fx-r fx-ac fx-bc">
-						<image  v-if="!isRead" src="/static/img/radio_buttons.png"></image>
-						<image  v-else src="/static/img/radio_buttons_btn.png"></image>
+						<image v-if="!isRead" src="/static/img/radio_buttons.png"></image>
+						<image v-else src="/static/img/radio_buttons_btn.png"></image>
 						注册及同意
 					</view>
-				<text  @tap="tapOpen" data-url="/pages/operation/user">《用户协议》</text>
-				,认真阅读<text  @tap="tapOpen" data-url="/pages/operation/package">《长城易趣拍产品购买协议》</text>
+					<text @tap="tapOpen" data-url="/pages/operation/user">《用户协议》</text>
+					,认真阅读<text @tap="tapOpen" data-url="/pages/operation/package">《长城易趣拍产品购买协议》</text>
 				</view>
 				<view id="captcha"></view>
 			</view>
@@ -69,107 +71,147 @@
 	</view>
 </template>
 <style lang="scss">
-	page{background: #fff;}
-	.top-view{
+	page {
+		background: #fff;
+	}
+
+	.top-view {
 		position: relative;
 		width: 100vw;
 		height: 62vw;
-		.bg{width: 100vw;height: 62vw;}
-		.inner{
+
+		.bg {
+			width: 100vw;
+			height: 62vw;
+		}
+
+		.inner {
 			position: absolute;
 			width: 100%;
 			height: 100%;
 			top: 0;
 			left: 0;
-			.inner-body{
-				position:relative;
-				.prv{
+
+			.inner-body {
+				position: relative;
+
+				.prv {
 					position: absolute;
 					left: 20rpx;
 					top: 20rpx;
-					.icon-back{
+
+					.icon-back {
 						width: 60rpx;
 						height: 60rpx;
 					}
 				}
-				.logo{
+
+				.logo {
 					width: 200rpx;
 					height: 119rpx;
 					margin-bottom: 40rpx;
 					margin-top: 60rpx;
-					image{width: 100%;height: 100%;}
+
+					image {
+						width: 100%;
+						height: 100%;
+					}
 				}
-				.label-text{
+
+				.label-text {
 					font-size: 42rpx;
 					color: #FFFFFF;
 				}
 			}
-			
-			
+
+
 		}
 	}
-	
-	.body{
+
+	.body {
 		position: relative;
 		background: #fff;
 		border-radius: 80rpx 80rpx 0px 0px;
 		top: -120rpx;
 		z-index: 9;
 		height: 500px;
-		.h120{height: 100rpx;}
-		
-		.input-view{
+
+		.h120 {
+			height: 100rpx;
+		}
+
+		.input-view {
 			padding: 0px 60rpx;
-			.login-input{
+
+			.login-input {
 				border-radius: 70rpx;
 				border: 1px solid #E0E0E0;
 				padding: 30rpx 46rpx;
 				margin-bottom: 50rpx;
-				.left{
-					.label{
+
+				.left {
+					.label {
 						font-size: 28rpx;
 						color: #DB292B;
 						font-weight: bold;
 					}
-					.loginv{width: 15rpx;height: 12rpx;margin-left: 14rpx;}
-					.icon{width: 30rpx;height: 33rpx;}
+
+					.loginv {
+						width: 15rpx;
+						height: 12rpx;
+						margin-left: 14rpx;
+					}
+
+					.icon {
+						width: 30rpx;
+						height: 33rpx;
+					}
+
 					width: 90rpx;
 				}
-				input{
+
+				input {
 					width: calc(100% - 90rpx);
 				}
-				
-				&.yzm{
-					input{
+
+				&.yzm {
+					input {
 						width: calc(100% - 90rpx - 22rpx - 80rpx);
 					}
-					.line{
+
+					.line {
 						width: 1px;
 						height: 36rpx;
 						background: #eee;
 						margin-right: 20rpx;
 					}
-					.sbtn{
+
+					.sbtn {
 						font-size: 12px;
 						color: #DB292B;
 					}
-					.no-sbtn{
+
+					.no-sbtn {
 						font-size: 12px;
 						color: #999999;
 					}
 				}
-				
-					
-				&.pass{
-					input{
+
+
+				&.pass {
+					input {
 						width: calc(100% - 180rpx);
 					}
-					.miss-pass{width: 60rpx;height: 60rpx}
+
+					.miss-pass {
+						width: 60rpx;
+						height: 60rpx
+					}
 				}
 			}
 		}
-		
-		.btn{
+
+		.btn {
 			background: #DB292B;
 			border-radius: 60rpx;
 			text-align: center;
@@ -178,100 +220,138 @@
 			padding: 30rpx 0;
 			color: #FAFAFA;
 		}
-		
-		.agament{
+
+		.agament {
 			margin-top: 40rpx;
-			image{width: 36rpx;height: 36rpx;margin-right: 20rpx;}
+
+			image {
+				width: 36rpx;
+				height: 36rpx;
+				margin-right: 20rpx;
+			}
+
 			color: #999999;
 			font-size:24rpx;
-			text{color: #DB292B;}
+
+			text {
+				color: #DB292B;
+			}
 		}
-		
+
+	}
+
+	.miss-pass {
+		width: 30px;
+		height: 30px;
+	}
+
+	.mb-view {
+		font-size: 14px;
+		margin-top: 30px;
+		padding: 0px 5px;
+	}
+
+	.mb-view .link {
+		color: #DB292B;
 	}
-	.miss-pass{width: 30px;height: 30px;}
-	.mb-view{font-size: 14px; margin-top: 30px;padding: 0px 5px;}
-	.mb-view .link{color: #DB292B;}
-	
 </style>
 
 <script>
 	import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
 	import customerWiget from '@/components/ui-public/customer-wiget.vue';
-	import { mapState, mapMutations } from 'vuex';
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex';
 	export default {
 		components: {
 			maoScroll,
 			customerWiget
 		},
-		computed:mapState(['showData']),
+		computed: {
+			...mapState(['showData']),
+			getWebSocket() {
+				// #ifdef APP-PLUS
+				const webSocket = getApp().globalData.webSocket
+				// #endif
+				// #ifndef APP-PLUS
+				const webSocket = this.webSocket
+				// #endif
+				return webSocket
+			}
+		},
 		data() {
 			return {
 				statusBarHeight: 20,
-				form:{
-					mobile 	 : "",
-					password : "",
-					verify : "",
-					code : ""
+				form: {
+					mobile: "",
+					password: "",
+					verify: "",
+					code: ""
 				},
-				isRead : false,
-				verifyCount : 0,
-				showPass : false,
-				captchaIns : null,
-				validate : "",
+				isRead: false,
+				verifyCount: 0,
+				showPass: false,
+				captchaIns: null,
+				validate: "",
 			}
 		},
 		onLoad() {
 			this.initView();
-			this.$nextTick(()=>{
+			this.$nextTick(() => {
 				this.initNeCaptcha();
 			});
 		},
 		methods: {
-			...mapMutations(['setSys','setUser']),
+			...mapMutations(['setSys', 'setUser']),
 			initView: function() {
 				uni.getSystemInfo({
 					success: (res) => {
 						this.statusBarHeight = res.statusBarHeight;
 					}
-				});	
+				});
 			},
-			initNeCaptcha () {
+			initNeCaptcha() {
 				// #ifdef H5
-					const options = {
-						captchaId: 'c6af8490405544f8a169504b11c86fdc',
-						element: '#captcha',
-						protocol: 'https',
-						onVerify: (err, data) => {
-							if(data != null || data != "") {
-								this.validate = data.validate;
-								this.getVcode2();
-							}
+				const options = {
+					captchaId: 'c6af8490405544f8a169504b11c86fdc',
+					element: '#captcha',
+					protocol: 'https',
+					onVerify: (err, data) => {
+						if (data != null || data != "") {
+							this.validate = data.validate;
+							this.getVcode2();
 						}
 					}
-					options.mode = 'popup';
-					initNECaptcha({ ...options }, ins => {
-						this.captchaIns = ins
-					})
+				}
+				options.mode = 'popup';
+				initNECaptcha({
+					...options
+				}, ins => {
+					this.captchaIns = ins
+				})
 				// #endif
-				
-				
+
+
 				// #ifdef APP
-					this.captchaIns = uni.requireNativePlugin('YD-Captcha')
-					this.captchaIns.init({
-						captcha_id: 'c6af8490405544f8a169504b11c86fdc',
-						is_no_sense_mode: false
-					});
+				this.captchaIns = uni.requireNativePlugin('YD-Captcha')
+				this.captchaIns.init({
+					captcha_id: 'c6af8490405544f8a169504b11c86fdc',
+					is_no_sense_mode: false
+				});
 				// #endif
 			},
-				
+
 			/**
 			 * 注册
 			 */
-			tapReg:function(){
-				uni.navigateTo({ url:"./register" });
+			tapReg: function() {
+				uni.navigateTo({
+					url: "./register"
+				});
 			},
-			
-			getVcode:function(){
+
+			getVcode: function() {
 				if (this.verifyCount > 0) return;
 				if (!this.utils.isPoneAvailable(this.form.mobile)) {
 					return uni.showToast({
@@ -280,15 +360,15 @@
 						icon: 'none'
 					});
 				}
-				
+
 				// #ifdef H5
-					this.captchaIns.popUp();
+				this.captchaIns.popUp();
 				// #endif
-				
+
 				// #ifdef APP
-					this.captchaIns.showCaptcha((data)=>{
+				this.captchaIns.showCaptcha((data) => {
 					var method = data.method;
-					if(method == "onSuccess"){
+					if (method == "onSuccess") {
 						var data = data.data;
 						this.validate = data.validate;
 						this.getVcode2();
@@ -302,7 +382,10 @@
 				});
 				this
 					.request
-					.post("getYzm", { mobile: this.form.mobile,validate : this.validate})
+					.post("getYzm", {
+						mobile: this.form.mobile,
+						validate: this.validate
+					})
 					.then(res => {
 						uni.hideLoading();
 						if (res.code == 200) {
@@ -311,7 +394,7 @@
 									this.verifyCount = e;
 								});
 							}
-			
+
 							if (res.data.status == 1) {
 								this.utils.CountDowm(120, (e, s) => {
 									this.verifyCount = e;
@@ -342,28 +425,32 @@
 				let url = ev.currentTarget.dataset.url;
 				this.utils.navigateTo(url);
 			},
-			
-			
+
+
 			/**
 			 * 提交数据
 			 */
-			tapSubmit:function(){
+			tapSubmit: function() {
 				//手机号码
-				if(this.form.mobile == ""){
+				if (this.form.mobile == "") {
 					uni.showToast({
-						title:"请输入手机号码",icon:"none",mask:true
+						title: "请输入手机号码",
+						icon: "none",
+						mask: true
 					})
 					return;
 				}
 				//手机验证号码
 				//this.form.mobile
-				if(!this.utils.isPoneAvailable(this.form.mobile) ){
+				if (!this.utils.isPoneAvailable(this.form.mobile)) {
 					uni.showToast({
-						title:"请输入正确的手机号码",icon:"none",mask:true
+						title: "请输入正确的手机号码",
+						icon: "none",
+						mask: true
 					})
 					return;
 				}
-				
+
 				if (this.form.password == '') {
 					uni.showToast({
 						title: '请输入密码',
@@ -372,7 +459,7 @@
 					});
 					return;
 				}
-								
+
 				// if (this.form.code == '') {
 				// 	uni.showToast({
 				// 		title: '请填写推荐码',
@@ -381,36 +468,48 @@
 				// 	});
 				// 	return;
 				// }	
-						
-				if(!this.isRead){
+
+				if (!this.isRead) {
 					uni.showToast({
-						title:"请阅读并同意相关政策",icon:"none",mask:true
+						title: "请阅读并同意相关政策",
+						icon: "none",
+						mask: true
 					})
 					return;
 				}
-				
-				uni.showLoading({ title: '登录中..' });
-				this.request
-				.post("register",this.form)
-				.then(res=>{
-					uni.hideLoading();
-					if(res.code == 200) {
-						this.setUser(res.data);
-						this.webSocket.connect();
-						uni.reLaunch({ url:"../index/index"});
-					} else {
-						uni.showToast({ title:res.msg,icon:"none",mask:true});
-					}
-				})
-				.catch(res=>{
-					uni.hideLoading();
-					uni.showModal({title: '系统提示',content: '加载失败,重新点击尝试!',showCancel: false});
+
+				uni.showLoading({
+					title: '登录中..'
 				});
-				
+				this.request
+					.post("register", this.form)
+					.then(res => {
+						uni.hideLoading();
+						if (res.code == 200) {
+							this.setUser(res.data);
+							this.getWebSocket.connect();
+							uni.reLaunch({
+								url: "../index/index"
+							});
+						} else {
+							uni.showToast({
+								title: res.msg,
+								icon: "none",
+								mask: true
+							});
+						}
+					})
+					.catch(res => {
+						uni.hideLoading();
+						uni.showModal({
+							title: '系统提示',
+							content: '加载失败,重新点击尝试!',
+							showCancel: false
+						});
+					});
+
 			}
-			
+
 		}
 	}
-</script>
-
-
+</script>

+ 0 - 8
pages/news/index.vue

@@ -53,12 +53,4 @@
 		z-index: -1;
 		padding: 15px;
 	}
-	/deep/ {
-		/* #ifndef APP */
-		.img {
-			display: block !important;
-			width: 100%;
-		}
-		/* #endif */
-	}
 </style>

+ 239 - 0
pages/user/address/address.nvue

@@ -0,0 +1,239 @@
+<template>
+	<view class="app">
+		<view class="app-items">
+			<view class="item" @tap="clickView(item)" v-for="(item,index) of addList" :key="index">
+				<view class="fx-r">
+					<view class="name">{{ item.name }}</view>
+					<view class="tag" v-if="item.status == 1">默认地址</view>
+				</view>
+				<view class="fx-r fx-bc">
+					<view class="address">{{item.province}}{{item.city}}{{item.area}}{{item.address}}</view>
+					<view class="edit" @tap="editClick(item.id)">
+						<image src="/static/img/edit.png"></image>
+					</view>
+				</view>
+				<view class="mobile">{{mobileTap(item.tel)}}</view>
+
+				<view class="item-foot fx-r">
+					<view class="default fx-r fx-bc" @tap="set_default_address(item.id,index)">
+						<image src="/static/img/radio_buttons_btn.png" v-if="item.status == 1"></image>
+						<image src="/static/img/radio_buttons.png" v-else></image>
+						默认地址
+					</view>
+					<view class="fx-g1"></view>
+					<view class="del" @tap="del_address(item.id,index)">删除</view>
+				</view>
+
+			</view>
+		</view>
+		<view class="foot" style="height: 40px;"></view>
+		<view class="foot-wiget">
+			<view class="foot-btn fx-r fx-bc fx-ac" @tap="addClick">
+				<image src="/static/nimg/address-add.png"></image>新增地址
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<style lang="scss">
+	.app {
+		padding: 10px;
+
+		.app-items {
+			.item {
+				background: #fff;
+				border-radius: 10px;
+				padding: 10px 15px;
+				margin-bottom: 10px;
+
+				.name {
+					color: #333;
+					font-size: 16px;
+					font-weight: 600;
+				}
+
+				.tag {
+					background: rgba(1, 149, 96, 0.1);
+					font-size: 12px;
+					color: #db292b;
+					padding: 2px 6px;
+					margin-left: 4px;
+					border-radius: 4px;
+				}
+
+				.address {
+					width: calc(100% - 20px);
+					color: #333;
+					font-size: 14px;
+					padding: 4px 0;
+				}
+
+				.edit {
+					width: 16px;
+					height: 16px;
+
+					image {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.mobile {
+					color: #919191;
+					font-size: 14px;
+					margin: 4px 0;
+				}
+
+				.default {
+					color: #727272;
+					font-size: 14px;
+
+					image {
+						width: 14px;
+						height: 14px;
+						margin-right: 4px;
+					}
+				}
+
+				.del {
+					color: #727272;
+					font-size: 14px;
+				}
+			}
+		}
+
+		.foot-wiget {
+			position: fixed;
+			bottom: 10px;
+			left: 10px;
+			width: calc(100% - 20px);
+
+			.foot-btn {
+				background: #db292b;
+
+				image {
+					width: 15px;
+					height: 15px;
+					margin-right: 6px;
+				}
+
+				border-radius: 25px;
+				padding: 14px 0;
+				color: #FFF;
+			}
+		}
+
+	}
+</style>
+<script>
+	export default {
+		data() {
+			return {
+				addList: [],
+				type: ""
+			}
+		},
+		onShow() {
+			this.initView();
+		},
+		onLoad(options) {
+			this.type = options.type || '';
+		},
+		methods: {
+			/**
+			 * 地址栏目
+			 */
+			initView: function() {
+				this
+					.request
+					.post("userAddress")
+					.then(res => {
+						if (res.code == 200) {
+							this.addList = res.data;
+						}
+					})
+					.catch(err => {
+						this.utils.Tip("网络错误,请稍后尝试");
+					});
+			},
+			// 设置默认地址
+			set_default_address(id, index) {
+				this.utils.loadIng("提交中..");
+				this
+					.request
+					.post("userAddressDeflault", {
+						id: id
+					})
+					.then(res => {
+						uni.hideLoading();
+						if (res.code == 200) {
+							this.addList.forEach((v, k) => {
+								if (index == k) {
+									v.status = 1;
+								} else {
+									v.status = 0;
+								}
+							})
+						}
+					})
+					.catch(err => {
+						uni.hideLoading();
+						this.utils.Tip("网络错误,请稍后尝试");
+					});
+			},
+			// 删除地址
+			del_address(id, index) {
+				uni.showModal({
+					title: "提示",
+					content: "确认删除该地址吗?",
+					success: (res) => {
+						if (res.confirm) {
+							this.utils.loadIng("提交中...");
+							this
+								.request
+								.post("userAddressDel", {
+									id: id
+								})
+								.then(res => {
+									uni.hideLoading();
+									if (res.code == 200) {
+										this.addList.splice(index, 1);
+									}
+								})
+								.catch(err => {
+									uni.hideLoading();
+									this.utils.Tip("网络错误,请稍后尝试");
+								});
+						}
+					}
+				})
+			},
+			// 编辑地址
+			editClick(id) {
+				uni.navigateTo({
+					url: `/pages/user/address/add/add?id=${id}`
+				})
+			},
+			mobileTap(str1) {
+				let reg = /^(\d{3})\d*(\d{4})$/;
+				return str1.replace(reg, '$1****$2')
+			},
+			addClick() {
+				uni.navigateTo({
+					url: `/pages/user/address/add/add`
+				})
+			},
+
+			clickView: function(item) {
+				if (this.type == 'select') {
+					uni.$emit("selectAddress", {
+						addressId: item.id
+					});
+					uni.navigateBack();
+				}
+			}
+		},
+
+	}
+</script>

+ 1 - 2
pages/user/index.nvue

@@ -73,8 +73,7 @@
 				</view>
 			</view>
 			<!--馆长中心-->
-			<!-- <view class="gz" v-if="user != null && user.isgz" @tap="tapOpen" data-url="/pages/gz/index"> -->
-			<view class="gz" @tap="tapOpen" data-url="/pages/gz/index">
+			<view class="gz" v-if="user != null && user.isgz" @tap="tapOpen" data-url="/pages/gz/index">
 				<image class="bg" src="/static/img/gz-bg.png"></image>
 				<view class="inner">
 					<image class="icon" src="/static/img/gz-zuan.png"></image>

+ 0 - 5
pages/user/index.vue

@@ -235,11 +235,6 @@
 		padding-top: 15rpx;
 	}
 
-	/deep/.u-count-down__text {
-		color: #999;
-		font-size: 12px;
-	}
-
 	.top-view {
 		width: 100%;
 

+ 1 - 4
pages/user/qrcode/index.vue

@@ -16,10 +16,7 @@
 					</block>
 				</swiper>
 			</view>
-
 			<view class="foot-view fx-r">
-
-
 				<view class="save fx-h fx-bc fx-ac" @tap="tapScheng">
 					<image src="/static/img/foot-save.png" mode="widthFix"></image>
 					<view class="text">重新生成</view>
@@ -238,7 +235,7 @@
 	/* #endif */
 
 	.distribution-posters .slide-image {
-		width: calc(54 - 86rpx);
+		width: calc(90vw - 86rpx);
 		height: calc(100vh - 160rpx);
 		margin: 0 auto;
 		border-radius: 15rpx;

+ 11 - 3
store/index.js

@@ -61,9 +61,17 @@ const store = new Vuex.Store({
 				// console.log(page, 'page11111111111111111111')
 				if (utils.isDefine(userStr)) {
 					// console.log(page, 'page11111111111111111111')
-					// console.log(store, 'page111111111112222111')
 					this.commit('setUser', JSON.parse(userStr));
-					// page.webSocket.connect();
+					setTimeout(async ()=>{
+						// #ifdef APP
+						const {globalData} = await utils.getAppStore();
+						globalData.webSocket.connect()
+						// #endif
+						// #ifndef APP
+						Vue.prototype.webSocket.connect()
+						// #endif
+						
+					},5000)
 				}
 
 				if (utils.isDefine(lbs)) {
@@ -127,7 +135,7 @@ const store = new Vuex.Store({
 				key: store.uuid + "_user"
 			});
 			let app = getApp();
-			app.webSocket.ttClose();
+			app.globalData.webSocket.ttClose();
 		},
 		setSys(store, data) {
 			// console.log(store,data,'data')