Jelajahi Sumber

增加定位

@dongkboy 2 tahun lalu
induk
melakukan
845b1a6e32
5 mengubah file dengan 345 tambahan dan 307 penghapusan
  1. 108 64
      App.vue
  2. 5 4
      config/baseUrl.js
  3. 9 6
      config/socket.js
  4. 217 218
      manifest.json
  5. 6 15
      pages/login/login.vue

+ 108 - 64
App.vue

@@ -4,16 +4,18 @@
 </style>
 <script>
 	import store from "@/store";
-	import socket from "@/config/socket";
 	import DB from "@/common/sqlite";
 	export default {
+		data() {
+			return {
+				locationInterval: null // 用于存储定时器ID
+			};
+		},
 		onLaunch: function(e) {
 
 			//取出缓存数据
 			store.commit("setCacheData");
-			if (store.state.token) {
-				socket.init();
-			} else {
+			if (store.state.token) {} else {
 
 				var url = window.location.href;
 				if ((url.indexOf("pages/carInsure/payVerify") >
@@ -25,9 +27,7 @@
 				} else {}
 			}
 			// #ifdef H5
-			if (store.state.token) {
-				socket.init();
-			} else {
+			if (store.state.token) {} else {
 				var url = window.location.href;
 				if ((url.indexOf("pages/carInsure/payVerify") >
 						0) || (url
@@ -57,66 +57,110 @@
 			// #endif
 		},
 		onShow: function(e) {
-			// uni.authorize({
-			// 	scope: 'scope.userLocation',
-			// 	success() {
-			// 		uni.getLocation()
-			// 	}
-			// })
-			// uni.getLocation({
-			// 	type: 'gcj02',
-			// 	geocode: true,
-			// 	success: function(res) {
-			// 		console.log(res);
-			// 		uni.setStorage({
-			// 			key: 'location',
-			// 			data: {
-			// 				latitude: res.latitude,
-			// 				longitude: res.longitude,
-			// 			},
-			// 			success: function() {
-			// 				console.log('位置信息保存成功');
-			// 			}
-			// 		});
-			// 	},
-			// 	fail: function(err) {
-			// 		console.log(err);
-			// 		// #ifdef APP-PLUS
-			// 		uni.showModal({
-			// 			title: '提示',
-			// 			content: '请打开定位服务',
-			// 			success: ({
-			// 				confirm,
-			// 				cancel
-			// 			}) => {
-			// 				if (confirm) {
-			// 					// android平台
-			// 					if (uni.getSystemInfoSync().platform == 'android') {
-			// 						var Intent = plus.android.importClass(
-			// 							'android.content.Intent');
-			// 						var Settings = plus.android.importClass(
-			// 							'android.provider.Settings');
-			// 						var intent = new Intent(Settings
-			// 							.ACTION_LOCATION_SOURCE_SETTINGS);
-			// 						var main = plus.android.runtimeMainActivity();
-			// 						main.startActivity(intent); // 打开系统设置GPS服务页面
-
-			// 					}
-			// 				}
-			// 用户取消前往开启定位服务
-			// 				if (cancel) {
-			// 					uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
-			// 						delta: 1
-			// 					});
-			// 				}
-			// 			}
-			// 		});
-			// 		// #endif
-			// 	}
-			// });
+			// this.getLocation();
+
 		},
 		onHide: function() {},
 		methods: {
+			getLocation() {
+				uni.getLocation({
+					type: 'gcj02', // 根据需要选择坐标类型
+					geocode: true,
+					success: (res) => {
+						let address = res.address.province + res.address.city + res.address.district + res
+							.address.street + res.address.poiName;
+						this.saveLocation(res, address);
+
+						// 清除之前的定时器
+						if (this.locationInterval) {
+							clearInterval(this.locationInterval);
+						}
+						// 设置每两分钟重新获取坐标
+						this.locationInterval = setInterval(() => {
+							this.updateLocation();
+						}, 120000); // 120000毫秒 = 2分钟
+					},
+					fail: (err) => {
+						console.log(err);
+						this.handleLocationError(err);
+
+					}
+				});
+			},
+			updateLocation() {
+				uni.getLocation({
+					type: 'gcj02',
+					geocode: true,
+					success: (res) => {
+						let address = res.address.province + res.address.city + res.address.district + res
+							.address.street + res.address.poiName;
+						this.saveLocation(res, address);
+					},
+					fail: (err) => {
+						console.log('更新位置失败:', err);
+						this.handleLocationError(err)
+						// 清除之前的定时器
+
+
+					}
+				});
+			},
+			saveLocation(res, address) {
+				uni.setStorage({
+					key: 'location',
+					data: {
+						city: res.address.city,
+						latitude: res.latitude,
+						longitude: res.longitude,
+						address: address,
+					},
+					success: () => {
+						uni.getStorage({
+							key: 'location',
+							success: function(res) {}
+						});
+					}
+				});
+			},
+			handleLocationError(err) {
+				// #ifdef APP-PLUS
+				clearInterval(this.locationInterval);
+				uni.showModal({
+					title: '获取权限',
+					content: '为了不影响功能的正常使用,请允许晋掌柜获取位置信息',
+					success: ({
+						confirm,
+						cancel
+					}) => {
+						if (confirm) {
+							this.openLocationSettings();
+						}
+						if (cancel) {
+							// 清除之前的定时器
+							this.exitApp();
+						}
+					}
+				});
+				// #endif
+			},
+			openLocationSettings() {
+				// Android平台
+				if (uni.getSystemInfoSync().platform == 'android') {
+					var Intent = plus.android.importClass('android.content.Intent');
+					var Settings = plus.android.importClass('android.provider.Settings');
+					var intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
+					var main = plus.android.runtimeMainActivity();
+					main.startActivity(intent); // 打开系统设置GPS服务页面
+				}
+			},
+
+			exitApp() {
+				if (plus.os.name === "Android") {
+					plus.runtime.quit();
+				} else {
+					plus.ios.import("UIApplication").sharedApplication().performSelector("exit");
+				}
+			},
 			//  TODO 开屏广告 后续优化添加
 			launch() {
 				try {

+ 5 - 4
config/baseUrl.js

@@ -4,14 +4,15 @@ let socketUrl = "";
 if (process.env.NODE_ENV === 'development') {
 	// 开发环境
 	// baseUrl = "http://192.168.0.106:8080"; //屈晨
-	// baseUrl = "http://192.168.0.253:8080"; //蔡雅茹
-	// baseUrl = "https://test.baoxianzhanggui.com/web-api"; //测试
+	// baseUrl = "http://192.168.0.52:8080"; //贺礼霄
+	// baseUrl = "http://192.168.0.253:8080"; //田智
+	baseUrl = "https://test.baoxianzhanggui.com/web-api"; //测试
 	// h5BaseUrl = "https://test.baoxianzhanggui.com/h5";
 	// baseUrl = "https://pre.baoxianzhanggui.com/web-api"; //预生产
 	// h5BaseUrl = "https://pre.baoxianzhanggui.com/h5";
-	baseUrl = "https://sxzgkj.baoxianzhanggui.com/web-api"; //生产
+	// baseUrl = "https://sxzgkj.baoxianzhanggui.com/web-api"; //生产
 	h5BaseUrl = "https://sxzgkj.baoxianzhanggui.com/h5";
-	socketUrl = "";
+	socketUrl = "wss://test.baoxianzhanggui.com/web-api/websocket";
 } else if (process.env.NODE_ENV === 'production') {
 	// 生产环境
 	// baseUrl = "https://test.baoxianzhanggui.com/web-api"; //测试

+ 9 - 6
config/socket.js

@@ -3,17 +3,21 @@ import store from '@/store';
 class socket {
 	constructor(options) {
 		//地址
-		this.socketUrl = base.socketUrl;
+		this.socketUrl = 'ws://192.168.0.52:8080/websocket/99140109M13D01001';
 		this.socketStart = false;
 		this.monitorSocketError();
 		this.monitorSocketClose();
 		this.socketReceive();
 	}
+	setUrl(url) {
+		this.socketUrl = url; // 设置新的 WebSocket URL
+		this.close(); // 关闭当前的连接
+		this.init(); // 重新初始化连接
+	}
 	init(callback) {
 		const _this = this;
 		if (base.socketUrl) {
-			if(this.socketStart){
-			}else{
+			if (this.socketStart) {} else {
 				uni.connectSocket({
 					url: this.socketUrl,
 					method: 'GET'
@@ -26,8 +30,7 @@ class socket {
 					_this.getHeartbeat();
 				}, 5000);
 			}
-		}else{
-		}
+		} else {}
 	}
 	//Socket给服务器发送消息
 	send(data, callback) {
@@ -96,4 +99,4 @@ class socket {
 	}
 };
 const mySocket = new socket();
-export default mySocket;
+export default mySocket;

+ 217 - 218
manifest.json

@@ -1,220 +1,219 @@
 {
-	"name": "晋掌柜",
-	"appid": "__UNI__D4FE29A",
-	"description": "保险类app",
-	"transformPx": false,
-	"icons": [{
-		"sizes": "分辨率,192x192",
-		"src": "图片路径"
-	}],
-	"versionName": "2.5.6",
-	"versionCode": 256,
-	"app-plus": {
-		"permissions": {
-			"ACCESS_FINE_LOCATION": {
-				"desc": "使用您的位置信息以提供相关功能"
-			}
-		},
-		"error": {
-			"url": "hybrid/html/error.html"
-		},
-		"compatible": {
-			"ignoreVersion": true
-		},
-		"privacy": {
-			"prompt": "template",
-			"template": {
-				"title": "平台协议和隐私协议",
-				"message": "欢迎使用晋掌柜app,我们非常重视您的个人信息和隐私保护。我们将通过《隐私权保护政策》帮助您了解我们收集、使用、存储、共享和保护个人信息的情况,以及您所享有的相关权利。<br/> 为了更好的向您提供注册认证、线上投保、以及周边服务等相关服务功能,我们会收集、使用必要的信息。包括但不限于:<br/>1、为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。2、在使用道路救援功能时,基于您的授权我们可能会获取您的位置信息,以便为您提供服务。您有权拒绝或取消授权。在使用线上投保以及注册等功能时, 基于您的授权我们会获取您的相册存储的权限, 以便在使用时能够正确的上传个人资料。获取通知权限, 用于向您发送重要通知, 如服务更新或安全提醒。<br/>   请仔细阅读<a href='https://sxzgkj.baoxianzhanggui.com/h5/#/pages/login/xieyi'>《平台协议》</a>和<a href='https://sxzgkj.baoxianzhanggui.com/h5/#/pages/login/mimi'>《隐私协议》</a>了解详细信息。我们将按照您同意的条款使用您的个人信息,以便为您提供服务。",
-				"buttonAccept": "同意",
-				"buttonRefuse": "暂不同意"
-			}
-		},
-		"modules": {
-			"Messaging": {},
-			"OAuth": {},
-			"Payment": {},
-			"Share": {},
-			"SQLite": {
-				"description": "iBeacon"
-			},
-			"Camera": {},
-			"Maps": {},
-			"Geolocation": {}
-		},
-		"distribute": {
-			"android": {
-				"permissionPhoneState": {
-					"request": "none",
-					"prompt": "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
-				},
-				"permissionExternalStorage": {
-					"request": "none",
-					"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
-				},
-				"permissions": [
-					"<uses-feature android:name=\"android.hardware.camera\"/>",
-					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
-					"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
-					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
-					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-					"<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
-					"<uses-permission android:name=\"android.permission.INTERNET\"/>",
-					"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
-					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.READ_SMS\"/>",
-					"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
-					"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
-					"<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
-					"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
-					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>"
-				],
-				"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
-				"minSdkVersion": 21,
-				"schemes": "zgcxapp",
-				"targetSdkVersion": 30
-			},
-			"sdkConfigs": {
-				"ad": {
-					"ks": {}
-				},
-				"payment": {
-					"weixin": {
-						"__platform__": ["android"],
-						"appid": "wx612ca90988c46947",
-						"UniversalLinks": ""
-					}
-				},
-				"share": {
-					"weixin": {
-						"appid": "wx612ca90988c46947",
-						"UniversalLinks": ""
-					}
-				},
-				"oauth": {
-					"weixin": {
-						"appid": "wx612ca90988c46947",
-						"appsecret": "75b7d4cda453b2075dec23f849278bc0",
-						"UniversalLinks": ""
-					}
-				},
-				"geolocation": {
-					"amap": {
-						"name": "amap_18335592986CWFSxSLAB",
-						"__platform__": ["android"],
-						"appkey_ios": "e410fdbf6be7110af9267b6d56c93c8d",
-						"appkey_android": "e410fdbf6be7110af9267b6d56c93c8d"
-					}
-				},
-				"push": {
-					"unipush": {
-						"appid": "YDcU8mcWRO6MWIT1i4naP2",
-						"appkey": "DK2LTzhnc87pFFFhcTSgs8",
-						"appsecret": "wTUMKWB4ReAoPyCp7Jyaz9"
-					}
-				},
-				"maps": {
-					"amap": {
-						"name": "amap_18335592986CWFSxSLAB",
-						"appkey_ios": "e410fdbf6be7110af9267b6d56c93c8d",
-						"appkey_android": "e410fdbf6be7110af9267b6d56c93c8d"
-					}
-				}
-			},
-			"icons": {
-				"android": {
-					"hdpi": "unpackage/res/icons/72x72.png",
-					"xhdpi": "unpackage/res/icons/96x96.png",
-					"xxhdpi": "unpackage/res/icons/144x144.png",
-					"xxxhdpi": "unpackage/res/icons/192x192.png"
-				},
-				"ios": {
-					"appstore": "unpackage/res/icons/1024x1024.png",
-					"ipad": {
-						"app": "unpackage/res/icons/76x76.png",
-						"app@2x": "unpackage/res/icons/152x152.png",
-						"notification": "unpackage/res/icons/20x20.png",
-						"notification@2x": "unpackage/res/icons/40x40.png",
-						"proapp@2x": "unpackage/res/icons/167x167.png",
-						"settings": "unpackage/res/icons/29x29.png",
-						"settings@2x": "unpackage/res/icons/58x58.png",
-						"spotlight": "unpackage/res/icons/40x40.png",
-						"spotlight@2x": "unpackage/res/icons/80x80.png"
-					},
-					"iphone": {
-						"app@2x": "unpackage/res/icons/120x120.png",
-						"app@3x": "unpackage/res/icons/180x180.png",
-						"notification@2x": "unpackage/res/icons/40x40.png",
-						"notification@3x": "unpackage/res/icons/60x60.png",
-						"settings@2x": "unpackage/res/icons/58x58.png",
-						"settings@3x": "unpackage/res/icons/87x87.png",
-						"spotlight@2x": "unpackage/res/icons/80x80.png",
-						"spotlight@3x": "unpackage/res/icons/120x120.png"
-					}
-				}
-			},
-			"splashscreen": {
-				"androidStyle": "common",
-				"useOriginalMsgbox": true
-			},
-			"ios": {
-				"dSYMs": false,
-				"urltypes": "zgcxapp"
-			}
-		},
-		"compilerVersion": 3,
-		"nvueLaunchMode": "fast",
-		"splashscreen": {
-			"alwaysShowBeforeRender": true
-		},
-		"nativePlugins": {}
-	},
-	// 5+App特有相关
-	"quickapp": {},
-	// 快应用特有相关
-	"mp-weixin": {
-		"setting": {
-			"urlCheck": false,
-			"es6": false,
-			"postcss": false,
-			"minified": false
-		},
-		"usingComponents": true,
-		"appid": "wxe57ddfbe230bcfba",
-		"permission": {}
-	},
-	"h5": {
-		"template": "template.h5.html",
-		"router": {
-			"mode": "hash",
-			"base": "./"
-		},
-		"optimization": {
-			"treeShaking": {
-				"enable": true
-			}
-		},
-		"devServer": {
-			"https": false,
-			"port": 80
-		},
-		"sdkConfigs": {
-			"maps": {}
-		},
-		"uniStatistics": {
-			"enable": false
-		}
-	},
-	"mp-jd": {
-		"unipush": {
-			"enable": false
-		}
-	}
+    "name" : "晋掌柜",
+    "appid" : "__UNI__D4FE29A",
+    "description" : "保险类app",
+    "transformPx" : false,
+    "icons" : [
+        {
+            "sizes" : "分辨率,192x192",
+            "src" : "图片路径"
+        }
+    ],
+    "versionName" : "2.5.7",
+    "versionCode" : 257,
+    "app-plus" : {
+        "error" : {
+            "url" : "hybrid/html/error.html"
+        },
+        "compatible" : {
+            "ignoreVersion" : true
+        },
+        "privacy" : {
+            "prompt" : "template",
+            "template" : {
+                "title" : "平台协议和隐私协议",
+                "message" : "欢迎使用晋掌柜app,我们非常重视您的个人信息和隐私保护。我们将通过《隐私权保护政策》帮助您了解我们收集、使用、存储、共享和保护个人信息的情况,以及您所享有的相关权利。<br/> 为了更好的向您提供注册认证、线上投保、以及周边服务等相关服务功能,我们会收集、使用必要的信息。包括但不限于:<br/>1、为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。2、在使用道路救援功能时,基于您的授权我们可能会获取您的位置信息,以便为您提供服务。您有权拒绝或取消授权。在使用线上投保以及注册等功能时, 基于您的授权我们会获取您的相册存储的权限, 以便在使用时能够正确的上传个人资料。获取通知权限, 用于向您发送重要通知, 如服务更新或安全提醒。<br/>   请仔细阅读<a href='https://sxzgkj.baoxianzhanggui.com/h5/#/pages/login/xieyi'>《平台协议》</a>和<a href='https://sxzgkj.baoxianzhanggui.com/h5/#/pages/login/mimi'>《隐私协议》</a>了解详细信息。我们将按照您同意的条款使用您的个人信息,以便为您提供服务。",
+                "buttonAccept" : "同意",
+                "buttonRefuse" : "暂不同意"
+            }
+        },
+        "modules" : {
+            "Messaging" : {},
+            "OAuth" : {},
+            "Payment" : {},
+            "Share" : {},
+            "SQLite" : {
+                "description" : "iBeacon"
+            },
+            "Camera" : {},
+            "Maps" : {},
+            "Geolocation" : {}
+        },
+        "distribute" : {
+            "android" : {
+                "permissionPhoneState" : {
+                    "request" : "none",
+                    "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
+                },
+                "permissionExternalStorage" : {
+                    "request" : "none",
+                    "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
+                },
+                "permissions" : [
+                    "<uses-feature android:name=\"android.hardware.camera\"/>",
+                    "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
+                    "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
+                    "<uses-permission android:name=\"android.permission.CAMERA\"/>",
+                    "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+                    "<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
+                    "<uses-permission android:name=\"android.permission.INTERNET\"/>",
+                    "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_SMS\"/>",
+                    "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
+                    "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
+                    "<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
+                    "<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
+                    "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+                    "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
+                    "<uses-permission android:name=\"android.permission.WRITE_SMS\"/>"
+                ],
+                "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
+                "minSdkVersion" : 21,
+                "schemes" : "zgcxapp",
+                "targetSdkVersion" : 30
+            },
+            "sdkConfigs" : {
+                "ad" : {
+                    "ks" : {},
+                    "sigmob" : {}
+                },
+                "payment" : {
+                    "weixin" : {
+                        "__platform__" : [ "android" ],
+                        "appid" : "wx612ca90988c46947",
+                        "UniversalLinks" : ""
+                    }
+                },
+                "share" : {
+                    "weixin" : {
+                        "appid" : "wx612ca90988c46947",
+                        "UniversalLinks" : ""
+                    }
+                },
+                "oauth" : {
+                    "weixin" : {
+                        "appid" : "wx612ca90988c46947",
+                        "appsecret" : "75b7d4cda453b2075dec23f849278bc0",
+                        "UniversalLinks" : ""
+                    }
+                },
+                "geolocation" : {
+                    "amap" : {
+                        "name" : "amap_18335592986CWFSxSLAB",
+                        "__platform__" : [ "android" ],
+                        "appkey_ios" : "e410fdbf6be7110af9267b6d56c93c8d",
+                        "appkey_android" : "e410fdbf6be7110af9267b6d56c93c8d"
+                    }
+                },
+                "push" : {
+                    "unipush" : {
+                        "appid" : "YDcU8mcWRO6MWIT1i4naP2",
+                        "appkey" : "DK2LTzhnc87pFFFhcTSgs8",
+                        "appsecret" : "wTUMKWB4ReAoPyCp7Jyaz9"
+                    }
+                },
+                "maps" : {
+                    "amap" : {
+                        "name" : "amap_18335592986CWFSxSLAB",
+                        "appkey_ios" : "e410fdbf6be7110af9267b6d56c93c8d",
+                        "appkey_android" : "e410fdbf6be7110af9267b6d56c93c8d"
+                    }
+                }
+            },
+            "icons" : {
+                "android" : {
+                    "hdpi" : "unpackage/res/icons/72x72.png",
+                    "xhdpi" : "unpackage/res/icons/96x96.png",
+                    "xxhdpi" : "unpackage/res/icons/144x144.png",
+                    "xxxhdpi" : "unpackage/res/icons/192x192.png"
+                },
+                "ios" : {
+                    "appstore" : "unpackage/res/icons/1024x1024.png",
+                    "ipad" : {
+                        "app" : "unpackage/res/icons/76x76.png",
+                        "app@2x" : "unpackage/res/icons/152x152.png",
+                        "notification" : "unpackage/res/icons/20x20.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "proapp@2x" : "unpackage/res/icons/167x167.png",
+                        "settings" : "unpackage/res/icons/29x29.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "spotlight" : "unpackage/res/icons/40x40.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png"
+                    },
+                    "iphone" : {
+                        "app@2x" : "unpackage/res/icons/120x120.png",
+                        "app@3x" : "unpackage/res/icons/180x180.png",
+                        "notification@2x" : "unpackage/res/icons/40x40.png",
+                        "notification@3x" : "unpackage/res/icons/60x60.png",
+                        "settings@2x" : "unpackage/res/icons/58x58.png",
+                        "settings@3x" : "unpackage/res/icons/87x87.png",
+                        "spotlight@2x" : "unpackage/res/icons/80x80.png",
+                        "spotlight@3x" : "unpackage/res/icons/120x120.png"
+                    }
+                }
+            },
+            "splashscreen" : {
+                "androidStyle" : "common",
+                "useOriginalMsgbox" : true
+            },
+            "ios" : {
+                "dSYMs" : false,
+                "urltypes" : "zgcxapp"
+            }
+        },
+        "compilerVersion" : 3,
+        "nvueLaunchMode" : "fast",
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true
+        },
+        "nativePlugins" : {}
+    },
+    // 5+App特有相关
+    "quickapp" : {},
+    // 快应用特有相关
+    "mp-weixin" : {
+        "setting" : {
+            "urlCheck" : false,
+            "es6" : false,
+            "postcss" : false,
+            "minified" : false
+        },
+        "usingComponents" : true,
+        "appid" : "wxe57ddfbe230bcfba",
+        "permission" : {}
+    },
+    "h5" : {
+        "template" : "template.h5.html",
+        "router" : {
+            "mode" : "hash",
+            "base" : "./"
+        },
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
+            }
+        },
+        "devServer" : {
+            "https" : false,
+            "port" : 80
+        },
+        "sdkConfigs" : {
+            "maps" : {}
+        },
+        "uniStatistics" : {
+            "enable" : false
+        }
+    },
+    "mp-jd" : {
+        "unipush" : {
+            "enable" : false
+        }
+    }
 }
-// 小程序特有相关
+// 小程序特有相关
+

+ 6 - 15
pages/login/login.vue

@@ -127,7 +127,7 @@
 		mapState,
 		mapMutations
 	} from 'vuex';
-	import socket from '@/config/socket';
+
 	import DB from "@/common/sqlite";
 	export default {
 		components: {
@@ -159,8 +159,10 @@
 				codetime: 0, //验证码获取倒计时
 				code: "", //用户code
 				listData: [],
+
 			};
 		},
+
 		onReady() {
 			this.isLoading = true;
 		},
@@ -248,7 +250,6 @@
 							title: res.msg,
 							icon: 'none'
 						});
-						socket.init();
 						return;
 					})
 				}
@@ -367,9 +368,7 @@
 							title: res.msg,
 							icon: 'none'
 						});
-					} else {
-						socket.init();
-					}
+					} else {}
 
 				})
 			},
@@ -394,7 +393,6 @@
 						this.openSQL();
 						this.createTable(); //创建表
 						this.insertTableData(this.username, this.password); //新增表数据
-						socket.init();
 					}
 
 				})
@@ -426,9 +424,7 @@
 								title: res.msg,
 								icon: 'none'
 							});
-						} else {
-							socket.init();
-						}
+						} else {}
 					})
 					// }
 					//#endif
@@ -450,9 +446,7 @@
 											title: res.msg,
 											icon: 'none'
 										});
-									} else {
-										socket.init();
-									}
+									} else {}
 								})
 
 							} else {
@@ -478,7 +472,6 @@
 								this.openSQL(); //打开数据库
 								this.createTable(); //创建表
 								this.insertTableData(this.username, this.password); //新增表数据
-								socket.init();
 							}
 						})
 					}
@@ -505,7 +498,6 @@
 								icon: 'none'
 							});
 						}
-						// socket.init();
 						return;
 					})
 				}
@@ -560,7 +552,6 @@
 						title: res.msg,
 						icon: 'none'
 					});
-					socket.init();
 					return;
 				})
 			},