叶志浩 преди 4 месеца
родител
ревизия
e6624343fb
променени са 14 файла, в които са добавени 1436 реда и са изтрити 1263 реда
  1. 29 19
      App.vue
  2. 42 15
      common/config.js
  3. 446 357
      common/httpRequest.js
  4. 830 809
      common/queue.js
  5. 1 1
      manifest.json
  6. 2 1
      package/my/previewResume/index.vue
  7. 7 5
      package/screen/screen.vue
  8. 5 5
      pages/index/game/gameList.vue
  9. 1 1
      pages/msg/im.vue
  10. 3 2
      pages/msg/index.vue
  11. 24 7
      pages/my/index.vue
  12. 1 1
      pages/public/login.vue
  13. 33 33
      pages/public/loginV2.vue
  14. 12 7
      pages/talentSearch/index.vue

+ 29 - 19
App.vue

@@ -1,6 +1,7 @@
 <script>
 export default {
-  onLaunch: function () {
+  onLaunch: function () {
+	uni.removeStorageSync('web_config')
 	// #ifdef APP-PLUS
 	// 初始化极光推送
 	this.initJPush()
@@ -620,25 +621,34 @@ export default {
 				
 				// 监听:点击通知(用户点击通知栏的通知)
 				jpushModule.addNotificationListener((res) => {
-					// console.log('点击了通知:', res)
-					// setTimeout(() => {
-					// 	// jpushModule.setBadge(0)
-					// 	// jpushModule.setBadgeNumber({ badge: 0 })
-					// 	console.log('设置了Badge')
-					// }, 500)
+					console.log('点击了通知:', res)
 					// 可在这里跳转到指定页面(比如根据通知的extra参数跳转)
-					// if (res.extras && res.extras.page) {
-					// 	// tab页面
-					// 	// /pages/index/index
-					// 	// /pages/talentSearch/index
-					// 	// /pages/msg/index
-					// 	// /pages/my/index
-					// 	setTimeout(() => {
-					// 		uni.switchTab({
-					// 			url: res.extras.page // 例如:/pages/detail/detail?id=123
-					// 		})							
-					// 	}, 500)
-					// }
+					if (res.notificationEventType == 'notificationOpened' && res.extras && res.extras.page) {
+						// tab页面
+						// /pages/index/index
+						// /pages/talentSearch/index
+						// /pages/index/game/gameList
+						// /pages/msg/index
+						// /pages/my/index
+						const tabPages = [
+							'/pages/index/index',
+							'/pages/talentSearch/index',
+							'/pages/index/game/gameList',
+							'/pages/msg/index',
+							'/pages/my/index'
+						]
+						setTimeout(() => {
+							if (tabPages.includes(res.extras?.page)) {
+								uni.switchTab({
+									url: res.extras.page // 例如:/pages/detail/detail?id=123
+								})	
+							} else {
+								uni.navigateTo({
+									url: res.extras.page
+								})
+							}					
+						}, 500)
+					}
 				})
 				
 				jpushModule.getRegistrationID((res) => {

+ 42 - 15
common/config.js

@@ -1,14 +1,19 @@
 const h5Url='https://h5.bosszan.com'
-const ossUrl='https://yi-zhipin.oss-cn-hangzhou.aliyuncs.com/emoji/'
-let isProduction = true // 判断是否是生产环境
+const ossUrl='https://yi-zhipin.oss-cn-hangzhou.aliyuncs.com/emoji/'
+const productionApiUrl = 'https://www.bosszan.com/sqx_fast'
+const productionWssUrl = 'wss://www.bosszan.com/wss/websocket/'
+const productionChatUrl = 'wss://www.bosszan.com/wss/chatSocket/'
+const testApiUrl = 'https://yizhizan.edccc.cn/sqx_fast'
+const testWssUrl = 'wss://yizhizan.edccc.cn/wss/websocket/'
+const testChatUrl = 'wss://yizhizan.edccc.cn/wss/chatSocket/'
+let isProduction = false // 判断是否是生产环境
 if (isProduction) {
 	//正式环境
-	const ROOTPATH = "https://www.bosszan.com/sqx_fast";
-	const ROOTPATH1 = "https://www.bosszan.com/sqx_fast";
-	const ROOTPATH2 = "wss://www.bosszan.com/wss/websocket/"; //联系客服
-	const ROOTPATH3 = "wss://www.bosszan.com/wss/chatSocket/" ; //聊天
+	const ROOTPATH = productionApiUrl;
+	const ROOTPATH1 = productionApiUrl;
+	const ROOTPATH2 = productionWssUrl; //联系客服
+	const ROOTPATH3 = productionChatUrl; //聊天
 	const ROOTPATH4 = "https://www.bosszan.com";
-	const ROOTPATH5 = "https://yf327682.natappfree.cc";
 	module.exports = {
 		APIHOST: ROOTPATH,
 		APIHOST1: ROOTPATH1,
@@ -17,16 +22,26 @@ if (isProduction) {
 		WSHOST4: ROOTPATH4,
 		h5Url,
 		ossUrl,
-		isProduction
+		isProduction,
+		test: {
+			APIHOST: testApiUrl,
+			APIHOST1: testApiUrl,
+			WSHOST: testWssUrl,
+			WSHOST1: testChatUrl
+		},
+		production: {
+			APIHOST: productionApiUrl,
+			APIHOST1: productionApiUrl,
+			WSHOST: productionWssUrl,
+			WSHOST1: productionChatUrl
+		}
 	};
 }else{
 	//测试环境
-	// const ROOTPATH = "/sqx_fast";
-	const ROOTPATH = "https://yizhizan.edccc.cn/sqx_fast";
-	// const ROOTPATH1 = "/sqx_fast";
-	const ROOTPATH1 = "https://yizhizan.edccc.cn/sqx_fast";
-	const ROOTPATH2 = "wss://yizhizan.edccc.cn/wss/websocket/"; //联系客服
-	const ROOTPATH3 = "wss://yizhizan.edccc.cn/wss/chatSocket/"; //聊天
+	const ROOTPATH = testApiUrl;
+	const ROOTPATH1 = testApiUrl;
+	const ROOTPATH2 = testWssUrl; //联系客服
+	const ROOTPATH3 = testChatUrl; //聊天
 	const ROOTPATH4 = "";
 	module.exports = {
 		APIHOST: ROOTPATH,
@@ -36,6 +51,18 @@ if (isProduction) {
 		WSHOST4: ROOTPATH4,
 		h5Url,
 		ossUrl,
-		isProduction
+		isProduction,
+		test: {
+			APIHOST: testApiUrl,
+			APIHOST1: testApiUrl,
+			WSHOST: testWssUrl,
+			WSHOST1: testChatUrl
+		},
+		production: {
+			APIHOST: productionApiUrl,
+			APIHOST1: productionApiUrl,
+			WSHOST: productionWssUrl,
+			WSHOST1: productionChatUrl
+		}
 	};
 }

+ 446 - 357
common/httpRequest.js

@@ -1,357 +1,446 @@
-import configdata from './config'
-import cache from './cache'
-import queue from './queue'
-
-module.exports = {
-	config: function(name) {
-		var info = null;
-		if (name) {
-			var name2 = name.split("."); //字符分割
-			if (name2.length > 1) {
-				info = configdata[name2[0]][name2[1]] || null;
-			} else {
-				info = configdata[name] || null;
-			}
-			if (info == null) {
-				let web_config = cache.get("web_config");
-				if (web_config) {
-					if (name2.length > 1) {
-						info = web_config[name2[0]][name2[1]] || null;
-					} else {
-						info = web_config[name] || null;
-					}
-				}
-			}
-		}
-		return info;
-	},
-	post: function(url, data, header) {
-		header = header || "application/x-www-form-urlencoded";
-		url = this.config("APIHOST") + url;
-		let token = uni.getStorageSync("token");
-		return new Promise((succ, error) => {
-			uni.request({
-				url: url,
-				data: data,
-				method: "POST",
-				header: {
-					"content-type": header,
-					"token": token
-				},
-				success: function(result) {
-					if (result.data.code == 401) {
-						// uni.clearStorage();
-						uni.removeStorageSync("token")
-						uni.removeStorageSync("userId")
-						uni.removeStorageSync("phone")
-						uni.removeStorageSync("openid")
-						uni.removeStorageSync("userName")
-						uni.removeStorageSync("relation")
-						uni.removeStorageSync("relation_id")
-						uni.removeStorageSync("isInvitation")
-						uni.removeStorageSync("zhiFuBao")
-						uni.removeStorageSync("zhiFuBaoName")
-						uni.showToast({
-							title: '请先登录,以便更好使用!',
-							icon: 'none'
-						})
-						
-						   setTimeout(() => {
-						      // 选择合适的路由方法(根据需求切换)
-						      // 1. 跳转到登录页,关闭当前页面(推荐,避免回退到失效页面)
-							  queue.toLogin()
-						    //   uni.redirectTo({
-						    //     url: '/pages/public/login' // 替换为你的登录页路径
-						    //   });
-						
-						      // 2. 如果需要关闭所有页面,强制跳转到登录页(比如退出登录场景)
-						      // uni.reLaunch({
-						      //   url: '/pages/public/login'
-						      // });
-						
-						      // 3. 普通跳转(保留当前页面栈,不推荐此场景)
-						      // uni.navigateTo({
-						      //   url: '/pages/public/login'
-						      // });
-						    }, 500); // 延迟时间必须 ≥ 
-						
-					}
-					succ.call(self, result.data)
-				},
-				fail: function(e) {
-					error.call(self, e)
-				}
-			})
-		})
-	},
-	postT: function(url, data, header, timeout) {
-		header = header || "application/x-www-form-urlencoded";
-		url = this.config("APIHOST1") + url;
-		let token = uni.getStorageSync("token");
-		console.log('timeout', timeout)
-		if (token) {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "POST",
-					timeout: timeout ? timeout : 60000,
-					header: {
-						"content-type": header,
-						"token": token
-					},
-					success: function(result) {
-						if (result.data.code == 401) {
-							uni.removeStorageSync("token")
-							uni.removeStorageSync("userId")
-							uni.removeStorageSync("phone")
-							uni.removeStorageSync("openid")
-							uni.removeStorageSync("userName")
-							uni.removeStorageSync("relation")
-							uni.removeStorageSync("relation_id")
-							uni.removeStorageSync("isInvitation")
-							uni.removeStorageSync("zhiFuBao")
-							uni.removeStorageSync("zhiFuBaoName")
-							uni.showToast({
-								title: '请先登录,以便更好使用!',
-								icon: 'none'
-							})
-						}
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		} else {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "POST",
-					header: {
-						"content-type": header,
-					},
-					success: function(result) {
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		}
-	},
-	postJson: function(url, data, header) {
-		header = header || "application/json";
-		url = this.config("APIHOST1") + url;
-		let token = uni.getStorageSync("token");
-		if (token) {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "POST",
-					header: {
-						"content-type": header,
-						"token": token
-					},
-					success: function(result) {
-						if (result.data.code == 401) {
-							uni.removeStorageSync("token")
-							uni.removeStorageSync("userId")
-							uni.removeStorageSync("phone")
-							uni.removeStorageSync("openid")
-							uni.removeStorageSync("userName")
-							uni.removeStorageSync("relation")
-							uni.removeStorageSync("relation_id")
-							uni.removeStorageSync("isInvitation")
-							uni.removeStorageSync("zhiFuBao")
-							uni.removeStorageSync("zhiFuBaoName")
-							uni.showToast({
-								title: '请先登录,以便更好使用!',
-								icon: 'none'
-							})
-						}else if (result.data.code !=0&&result.data.msg!='未进入公司') {
-							uni.showToast({
-								title: result.data.msg||'查询失败',
-								icon: 'none'
-							})
-						}
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		} else {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "POST",
-					header: {
-						"content-type": header,
-					},
-					success: function(result) {
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		}
-	},
-	getT: function(url, data, header) {
-		header = header || "application/x-www-form-urlencoded";
-		url = this.config("APIHOST1") + url;
-		let token = uni.getStorageSync("token");
-		if (token) {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "GET",
-					header: {
-						"content-type": header,
-						"token": token
-					},
-					success: function(result) {
-						if (result.data.code == 401) {
-							uni.removeStorageSync("token")
-							uni.removeStorageSync("userId")
-							uni.removeStorageSync("phone")
-							uni.removeStorageSync("openid")
-							uni.removeStorageSync("userName")
-							uni.removeStorageSync("relation")
-							uni.removeStorageSync("relation_id")
-							uni.removeStorageSync("isInvitation")
-							uni.removeStorageSync("zhiFuBao")
-							uni.removeStorageSync("zhiFuBaoName")
-							uni.showToast({
-								title: '请先登录,以便更好使用!',
-								icon: 'none'
-							})
-						}else if (result.data.code !=0&&result.data.msg!='未进入公司') {
-							uni.showToast({
-								title: result.data.msg||'查询失败',
-								icon: 'none'
-							})
-							}
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		} else {
-			return new Promise((succ, error) => {
-				uni.request({
-					url: url,
-					data: data,
-					method: "GET",
-					header: {
-						"content-type": header
-					},
-					success: function(result) {
-						if (result.data.code !=0&&result.data.msg!='未进入公司'){
-							uni.showToast({
-								title: result.data.msg||'查询失败',
-								icon: 'none'
-							})
-						}
-						succ.call(self, result.data)
-					},
-					fail: function(e) {
-						error.call(self, e)
-					}
-				})
-			})
-		}
-	},
-	get: function(url, data, header) {
-		header = header || "application/x-www-form-urlencoded";
-		url = this.config("APIHOST") + url;
-		let token = uni.getStorageSync("token");
-		return new Promise((succ, error) => {
-			uni.request({
-				url: url,
-				data: data,
-				method: "GET",
-				header: {
-					"content-type": header,
-					"token": token
-				},
-				success: function(result) {
-					if (result.data.code == 401) {
-						uni.removeStorageSync("token")
-						uni.removeStorageSync("userId")
-						uni.removeStorageSync("phone")
-						uni.removeStorageSync("openid")
-						uni.removeStorageSync("userName")
-						uni.removeStorageSync("relation")
-						uni.removeStorageSync("relation_id")
-						uni.removeStorageSync("isInvitation")
-						uni.removeStorageSync("zhiFuBao")
-						uni.removeStorageSync("zhiFuBaoName")
-						uni.showToast({
-							title: '请先登录,以便更好使用!',
-							icon: 'none'
-						})
-					}else if (result.data.code !=0&&result.data.msg!='未进入公司') {
-							uni.showToast({
-								title: result.data.msg||'查询失败',
-								icon: 'none'
-							})
-					}
-					succ.call(self, result.data)
-				},
-				fail: function(e) {
-					error.call(self, e)
-				}
-			})
-		})
-	},
-	getMsg: function(url, data, header) {
-		header = header || "application/x-www-form-urlencoded";
-		url = this.config("APIHOST2") + url;
-		let token = uni.getStorageSync("token");
-		return new Promise((succ, error) => {
-			uni.request({
-				url: url,
-				data: data,
-				method: "GET",
-				header: {
-					"content-type": header,
-					"token": token
-				},
-				success: function(result) {
-					if (result.data.code == 401) {
-						uni.removeStorageSync("token")
-						uni.removeStorageSync("userId")
-						uni.removeStorageSync("phone")
-						uni.removeStorageSync("openid")
-						uni.removeStorageSync("userName")
-						uni.removeStorageSync("relation")
-						uni.removeStorageSync("relation_id")
-						uni.removeStorageSync("isInvitation")
-						uni.removeStorageSync("zhiFuBao")
-						uni.removeStorageSync("zhiFuBaoName")
-						uni.showToast({
-							title: '请先登录,以便更好使用!',
-							icon: 'none'
-						})
-					}
-					succ.call(self, result.data)
-				},
-				fail: function(e) {
-					error.call(self, e)
-				}
-			})
-		})
-	}
-}
+import configdata from './config'
+import cache from './cache'
+import queue from './queue'
+
+let domainReadyPromise = null
+
+ensureDomainReady()
+
+// 确保已经从后端拿到动态域名配置(只会真实请求一次)
+function ensureDomainReady() {
+	// 1)如果本地已经有 web_config,直接返回
+	const webConfig = cache.get('web_config')
+	if (webConfig && webConfig.APIHOST) {
+		return Promise.resolve()
+	}
+
+	// 2)已经在请求中了,复用同一个 Promise
+	if (domainReadyPromise) return domainReadyPromise
+
+	// 3)第一次:去后端拉取域名配置
+	domainReadyPromise = new Promise((resolve) => {
+		uni.request({
+			url: 'https://www.bosszan.com/sqx_fast/app/dict/list',
+			data: {
+				type: '路由'
+			},
+			method: 'GET',
+			success: (res) => {
+				if (res.data && res.data.code === 0 && res.data.data) {
+					const cfg = res.data.data
+					if (cfg?.length && cfg[0].code) {
+						let webConfigData = cfg[0].code == 'test' ? configdata.test : configdata.production
+						cache.put('web_config', webConfigData)
+					}
+				}
+			},
+			complete: () => {
+				// 无论成功失败,都结束,失败时后面会走 config.js 兜底
+				resolve()
+			}
+		})
+	})
+
+	return domainReadyPromise
+}
+
+module.exports = {
+	config: function(name) {
+		let info = null
+		if (!name) return info
+
+		const name2 = name.split('.')
+		const webConfig = cache.get('web_config')
+
+		// 1. 先看后端下发的动态配置
+		if (webConfig) {
+			if (name2.length > 1) {
+				info = webConfig[name2[0]] && webConfig[name2[0]][name2[1]]
+			} else {
+				info = webConfig[name]
+			}
+		}
+
+		// 2. 动态没有,再用静态 config.js 兜底
+		if (info == null) {
+			if (name2.length > 1) {
+				info = configdata[name2[0]] && configdata[name2[0]][name2[1]]
+			} else {
+				info = configdata[name]
+			}
+		}
+
+		return info == null ? null : info
+	},
+	// config: function(name) {
+	// 	var info = null;
+	// 	if (name) {
+	// 		var name2 = name.split("."); //字符分割
+	// 		if (name2.length > 1) {
+	// 			info = configdata[name2[0]][name2[1]] || null;
+	// 		} else {
+	// 			info = configdata[name] || null;
+	// 		}
+	// 		if (info == null) {
+	// 			let web_config = cache.get("web_config");
+	// 			console.log('web_config', web_config)
+	// 			if (web_config) {
+	// 				if (name2.length > 1) {
+	// 					info = web_config[name2[0]][name2[1]] || null;
+	// 				} else {
+	// 					info = web_config[name] || null;
+	// 				}
+	// 			}
+	// 		}
+	// 	}
+	// 	return info;
+	// },
+	post: function(url, data, header) {
+		header = header || "application/x-www-form-urlencoded";
+		
+		return ensureDomainReady().then(() => {
+		    const host = this.config('APIHOST')
+		    const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			return new Promise((succ, error) => {
+				uni.request({
+					url: fullUrl,
+					data: data,
+					method: "POST",
+					header: {
+						"content-type": header,
+						"token": token
+					},
+					success: function(result) {
+						if (result.data.code == 401) {
+							// uni.clearStorage();
+							uni.removeStorageSync("token")
+							uni.removeStorageSync("userId")
+							uni.removeStorageSync("phone")
+							uni.removeStorageSync("openid")
+							uni.removeStorageSync("userName")
+							uni.removeStorageSync("relation")
+							uni.removeStorageSync("relation_id")
+							uni.removeStorageSync("isInvitation")
+							uni.removeStorageSync("zhiFuBao")
+							uni.removeStorageSync("zhiFuBaoName")
+							uni.showToast({
+								title: '请先登录,以便更好使用!',
+								icon: 'none'
+							})
+
+							setTimeout(() => {
+								// 选择合适的路由方法(根据需求切换)
+								// 1. 跳转到登录页,关闭当前页面(推荐,避免回退到失效页面)
+								queue.toLogin()
+								//   uni.redirectTo({
+								//     url: '/pages/public/login' // 替换为你的登录页路径
+								//   });
+
+								// 2. 如果需要关闭所有页面,强制跳转到登录页(比如退出登录场景)
+								// uni.reLaunch({
+								//   url: '/pages/public/login'
+								// });
+
+								// 3. 普通跳转(保留当前页面栈,不推荐此场景)
+								// uni.navigateTo({
+								//   url: '/pages/public/login'
+								// });
+							}, 500); // 延迟时间必须 ≥ 
+
+						}
+						succ.call(self, result.data)
+					},
+					fail: function(e) {
+						error.call(self, e)
+					}
+				})
+			})
+		})
+	},
+	postT: function(url, data, header, timeout) {
+		header = header || "application/x-www-form-urlencoded";
+		return ensureDomainReady().then(() => {
+			const host = this.config('APIHOST1')
+			const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			console.log('timeout', timeout)
+			if (token) {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "POST",
+						timeout: timeout ? timeout : 60000,
+						header: {
+							"content-type": header,
+							"token": token
+						},
+						success: function(result) {
+							if (result.data.code == 401) {
+								uni.removeStorageSync("token")
+								uni.removeStorageSync("userId")
+								uni.removeStorageSync("phone")
+								uni.removeStorageSync("openid")
+								uni.removeStorageSync("userName")
+								uni.removeStorageSync("relation")
+								uni.removeStorageSync("relation_id")
+								uni.removeStorageSync("isInvitation")
+								uni.removeStorageSync("zhiFuBao")
+								uni.removeStorageSync("zhiFuBaoName")
+								uni.showToast({
+									title: '请先登录,以便更好使用!',
+									icon: 'none'
+								})
+							}
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			} else {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "POST",
+						header: {
+							"content-type": header,
+						},
+						success: function(result) {
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			}
+		})
+	},
+	postJson: function(url, data, header) {
+		header = header || "application/json";
+		return ensureDomainReady().then(() => {
+			const host = this.config('APIHOST1')
+			const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			if (token) {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "POST",
+						header: {
+							"content-type": header,
+							"token": token
+						},
+						success: function(result) {
+							if (result.data.code == 401) {
+								uni.removeStorageSync("token")
+								uni.removeStorageSync("userId")
+								uni.removeStorageSync("phone")
+								uni.removeStorageSync("openid")
+								uni.removeStorageSync("userName")
+								uni.removeStorageSync("relation")
+								uni.removeStorageSync("relation_id")
+								uni.removeStorageSync("isInvitation")
+								uni.removeStorageSync("zhiFuBao")
+								uni.removeStorageSync("zhiFuBaoName")
+								uni.showToast({
+									title: '请先登录,以便更好使用!',
+									icon: 'none'
+								})
+							} else if (result.data.code != 0 && result.data.msg != '未进入公司') {
+								uni.showToast({
+									title: result.data.msg || '查询失败',
+									icon: 'none'
+								})
+							}
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			} else {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "POST",
+						header: {
+							"content-type": header,
+						},
+						success: function(result) {
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			}
+		});
+	},
+	getT: function(url, data, header) {
+		header = header || "application/x-www-form-urlencoded";
+		return ensureDomainReady().then(() => {
+			const host = this.config('APIHOST1')
+			const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			if (token) {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "GET",
+						header: {
+							"content-type": header,
+							"token": token
+						},
+						success: function(result) {
+							if (result.data.code == 401) {
+								uni.removeStorageSync("token")
+								uni.removeStorageSync("userId")
+								uni.removeStorageSync("phone")
+								uni.removeStorageSync("openid")
+								uni.removeStorageSync("userName")
+								uni.removeStorageSync("relation")
+								uni.removeStorageSync("relation_id")
+								uni.removeStorageSync("isInvitation")
+								uni.removeStorageSync("zhiFuBao")
+								uni.removeStorageSync("zhiFuBaoName")
+								uni.showToast({
+									title: '请先登录,以便更好使用!',
+									icon: 'none'
+								})
+							} else if (result.data.code != 0 && result.data.msg != '未进入公司') {
+								uni.showToast({
+									title: result.data.msg || '查询失败',
+									icon: 'none'
+								})
+							}
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			} else {
+				return new Promise((succ, error) => {
+					uni.request({
+						url: fullUrl,
+						data: data,
+						method: "GET",
+						header: {
+							"content-type": header
+						},
+						success: function(result) {
+							if (result.data.code != 0 && result.data.msg != '未进入公司') {
+								uni.showToast({
+									title: result.data.msg || '查询失败',
+									icon: 'none'
+								})
+							}
+							succ.call(self, result.data)
+						},
+						fail: function(e) {
+							error.call(self, e)
+						}
+					})
+				})
+			}
+		});
+	},
+	get: function(url, data, header) {
+		header = header || "application/x-www-form-urlencoded";
+		return ensureDomainReady().then(() => {
+			const host = this.config('APIHOST')
+			const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			return new Promise((succ, error) => {
+				uni.request({
+					url: fullUrl,
+					data: data,
+					method: "GET",
+					header: {
+						"content-type": header,
+						"token": token
+					},
+					success: function(result) {
+						if (result.data.code == 401) {
+							uni.removeStorageSync("token")
+							uni.removeStorageSync("userId")
+							uni.removeStorageSync("phone")
+							uni.removeStorageSync("openid")
+							uni.removeStorageSync("userName")
+							uni.removeStorageSync("relation")
+							uni.removeStorageSync("relation_id")
+							uni.removeStorageSync("isInvitation")
+							uni.removeStorageSync("zhiFuBao")
+							uni.removeStorageSync("zhiFuBaoName")
+							uni.showToast({
+								title: '请先登录,以便更好使用!',
+								icon: 'none'
+							})
+						} else if (result.data.code != 0 && result.data.msg != '未进入公司') {
+							uni.showToast({
+								title: result.data.msg || '查询失败',
+								icon: 'none'
+							})
+						}
+						succ.call(self, result.data)
+					},
+					fail: function(e) {
+						error.call(self, e)
+					}
+				})
+			})
+		});
+	},
+	getMsg: function(url, data, header) {
+		header = header || "application/x-www-form-urlencoded";
+		return ensureDomainReady().then(() => {
+			const host = this.config('APIHOST2')
+			const fullUrl = host + url
+			let token = uni.getStorageSync("token");
+			return new Promise((succ, error) => {
+				uni.request({
+					url: fullUrl,
+					data: data,
+					method: "GET",
+					header: {
+						"content-type": header,
+						"token": token
+					},
+					success: function(result) {
+						if (result.data.code == 401) {
+							uni.removeStorageSync("token")
+							uni.removeStorageSync("userId")
+							uni.removeStorageSync("phone")
+							uni.removeStorageSync("openid")
+							uni.removeStorageSync("userName")
+							uni.removeStorageSync("relation")
+							uni.removeStorageSync("relation_id")
+							uni.removeStorageSync("isInvitation")
+							uni.removeStorageSync("zhiFuBao")
+							uni.removeStorageSync("zhiFuBaoName")
+							uni.showToast({
+								title: '请先登录,以便更好使用!',
+								icon: 'none'
+							})
+						}
+						succ.call(self, result.data)
+					},
+					fail: function(e) {
+						error.call(self, e)
+					}
+				})
+			})
+		});
+	}
+}

+ 830 - 809
common/queue.js

@@ -1,810 +1,831 @@
-/**
- * 
- * @author maxd
- * @date 2019.8.1
- */
-import configdata from './config'
-// #ifdef APP-PLUS 
-import permision from "../js_sdk/wa-permission/permission.js"
-// #endif
-module.exports = {
-	//微信的appId
-	getWxAppid() {
-		return 'wxd0bec3a917085e78'
-	},
-	//全局邀请码
-	getInvitation() {
-		return uni.getStorageSync("publicRelation")
-	},
-	//获取APP下载地址
-	getAppDownUrl() {
-		return uni.getStorageSync("appurl")
-	},
-	//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
-	publicYuMing() {
-		return configdata.h5Url
-	},
-	// 登录判断
-	toLogin(type) {
-		let url = '/pages/public/loginV2'
-		// #ifdef H5
-		url = '/pages/public/login'
-		// #endif
-		switch (type) {
-			case 'navigateTo':
-				uni.navigateTo({ url })
-				break
-			default:
-				uni.reLaunch({ url })
-		}
-	},
-	logout() {
-		this.remove("token");
-		this.remove("userId");
-		this.remove("mobile");
-		this.remove("openid");
-		this.remove("nickName");
-		this.remove("relation");
-		this.remove("image_url");
-		this.remove("relation_id");
-		this.remove("isInvitation");
-		this.remove("userType");
-		this.remove("member");
-		this.remove('companyId')
-		this.remove('avatar')
-		this.remove('age')
-		this.remove('companyName')
-		this.remove('companyStatus')
-		this.remove('isVip')
-		this.remove('vipMsgNum')
-		this.remove('vipMsgPrice')
-		this.remove('vipDueTimes')
-		this.remove('msgNum')
-		this.remove('msgPrice')
-		this.remove('invitationCode')
-		this.remove('inviterCode')
-		this.remove('hadShowPoster')
-	},
-	loginClear() {
-		this.remove("token");
-		this.remove("userId");
-		this.remove("mobile");
-		this.remove("nickName");
-		this.remove("image_url");
-		this.remove("relation_id");
-		this.remove("isInvitation");
-		this.remove("member");
-	},
-	showLoading(title) {
-		uni.showLoading({
-			title: title
-		});
-	},
-	showToast(title) {
-		uni.showToast({
-			title: title,
-			mask: false,
-			duration: 2000,
-			icon: "none"
-		});
-	},
-	getChatSearchKeys: function(key) {
-		let list = uni.getStorageSync("chatSearchKeys");
-		let keys = key.replace(/\s*/g, "")
-		let over = false
-		for (var i = 0; i < keys.length; i++) {
-			// console.error(keys[i])
-			if (list.indexOf(keys[i]) != -1) {
-				over = true;
-				// return over;
-			}
-
-		}
-		return over;
-
-	},
-	setJson: function(key, value) {
-		let jsonString = JSON.stringify(value);
-		try {
-			uni.setStorageSync(key, jsonString);
-		} catch (e) {
-			// error
-		}
-	},
-	setData: function(key, value) {
-		try {
-			uni.setStorageSync(key, value);
-		} catch (e) {
-			// error
-		}
-	},
-	getData: function(key) {
-		try {
-			const value = uni.getStorageSync(key);
-			if (value) {
-				return value;
-			}
-		} catch (e) {
-			// error
-		}
-
-	},
-	getJson: function(key) {
-		try {
-			const value = uni.getStorageSync(key);
-			if (value) {
-				return JSON.parse(value);
-			}
-		} catch (e) {
-			// error
-		}
-
-	},
-	clear: function() {
-		uni.clearStorage();
-	},
-	get: function(key) { //获取队列里面全部的数据
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			return data;
-		}
-		return [];
-	},
-	insert: function(param) { //队列插入数据
-		param.capacityNum = param.capacityNum || 100; //队列容量 默认队列中超过100条数据,自动删除尾部
-		let data = this.getJson(param.key);
-		if (data instanceof Array) {
-			if (data.length > param.capacityNum) {
-				let total = data.length - param.capacityNum;
-				for (let i = 0; i < total; i++) {
-					data.pop();
-				}
-			}
-			data.unshift(param.value);
-		} else {
-			data = [];
-			data.push(param.value);
-		}
-		this.setJson(param.key, data);
-	},
-	removeItem: function(key, itemIds) { //提供itemIds数组 批量删除队列中的某项数据
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			for (let i = 0; i < itemIds.length; i++) {
-				for (let p = 0; p < data.length; p++) {
-					if (itemIds[i] === data[p].itemid) {
-						data.splice(p, 1);
-						break;
-					}
-				}
-			}
-			this.setJson(key, data);
-		}
-	},
-	isExist: function(key, itemId) { //检测某条数据在队列中是否存在
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			for (let p = 0; p < data.length; p++) {
-				if (itemId === data[p].itemid) {
-					return true;
-				}
-			}
-		}
-		return false;
-	},
-	isExistPdd: function(key, itemId) { //检测某条数据在队列中是否存在
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			for (let p = 0; p < data.length; p++) {
-				if (itemId === data[p].goodsId) {
-					return true;
-				}
-			}
-		}
-		return false;
-	},
-	isExistJd: function(key, itemId) { //检测某条数据在队列中是否存在
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			for (let p = 0; p < data.length; p++) {
-				if (itemId === data[p].skuId) {
-					return true;
-				}
-			}
-		}
-		return false;
-	},
-	remove: function(key) { //删除某条队列
-		try {
-			uni.removeStorageSync(key);
-			//localStorage.removeItem(key)
-		} catch (e) {
-			// error
-		}
-	},
-	getCount: function(key) { //获取队列中全部数据数量
-
-		let data = this.getJson(key);
-		if (data instanceof Array) {
-			return data.length;
-		}
-		return 0;
-	},
-	uploadFile: function(path, callback) {
-		const uploadTask = uni.uploadFile({ // 上传接口
-			url: configdata.APIHOST1 + '/alioss/upload', //真实的接口地址
-			filePath: path,
-			name: 'file',
-			success: (uploadFileRes) => {
-				let content = JSON.parse(uploadFileRes.data).data;
-				uni.hideLoading();
-				callback(content)
-			},
-			fail: (err) => {
-				callback(false)
-				console.log(err)
-			}
-		});
-		uploadTask.onProgressUpdate((res) => {
-			uni.showLoading({
-				title: '上传进度' + res.progress + '%',
-			})
-			if (res.progress >= 100) {
-				uni.hideLoading()
-			}
-		})
-	},
-	/**
-	 * 上传文件
-	 * @param {Object} params 参数
-	 *  url:服务器地址
-	 *  path:文件本地地址
-	 *  name:文件名称
-	 *  formData:上传参数
-	 * @param {Object} callback
-	 */
-	uploadFiles: function(params, callback) {
-		let url = params.url ? params.url : ''
-		let filePath = params.path ? params.path : ''
-		let name = params.name ? params.name : ''
-		let formData = params.data ? params.data : {}
-		const uploadTask = uni.uploadFile({ // 上传接口
-			url: `${configdata.APIHOST}${url}`, //真实的接口地址
-			filePath,
-			name,
-			formData,
-			header: {
-				token: uni.getStorageSync('token')
-			},
-			success: (uploadFileRes) => {
-				let content = JSON.parse(uploadFileRes.data)
-				uni.hideLoading();
-				callback(content)
-			},
-			fail: (err) => {
-				callback(false)
-				console.log(err)
-			}
-		});
-		uploadTask.onProgressUpdate((res) => {
-			uni.showLoading({
-				title: '上传进度' + res.progress + '%',
-			})
-			if (res.progress >= 100) {
-				uni.hideLoading()
-			}
-		})
-	},
-	array_column: function(arr, column_key, index_key = null) {
-		if (index_key === null) {
-			return arr.map(item => item[column_key]);
-		}
-
-		return arr.reduce((result, item) => {
-			result[item[index_key]] = item[column_key];
-			return result;
-		}, {});
-	},
-	isCurrentMonth: function(date) {
-		const now = new Date();
-		return now.getFullYear() === date.getFullYear() &&
-			now.getMonth() === date.getMonth();
-	},
-	getHighestEducation: function(educations) {
-		// 定义学历等级映射(从低到高)
-		const educationLevels = {
-			'小学': 1,
-			'初中': 2,
-			'高中': 3,
-			'中专': 4,
-			'大专': 5,
-			'本科': 6,
-			'硕士': 7,
-			'博士': 8,
-			'博士后': 9
-		};
-
-		let highestEducation = null;
-		let highestLevel = -1;
-
-		educations.forEach(edu => {
-			const level = educationLevels[edu.degree] || 0;
-			if (level > highestLevel) {
-				highestLevel = level;
-				highestEducation = edu.degree;
-			}
-		});
-
-		return highestEducation;
-	},
-
-	//职业状态
-	resumesStatus() {
-
-		return [{
-				value: '0',
-				text: '离职-随时到岗',
-				recommended: true
-			},
-			{
-				value: '1',
-				text: '在职-月内到岗',
-				recommended: true
-			},
-			{
-				value: '2',
-				text: '在职-考虑机会',
-				recommended: false
-			},
-			{
-				value: '3',
-				text: '在职-暂不考虑',
-				recommended: false
-			},
-			{
-				value: '4',
-				text: '实习',
-				recommended: false
-			}
-		]
-	},
-
-	appConfirm: function(content = '请确认您的操作?', callback, title = '操作提示', button = ["继续", "取消"]) {
-		// #ifndef APP-PLUS 
-		uni.showModal({
-			title: title,
-			content: content,
-			success: function(res) {
-				if (res.confirm) {
-					callback(true)
-				} else
-					callback(false)
-			}
-		});
-		return
-		//#endif
-		// #ifdef APP-PLUS 
-		plus.nativeUI.confirm(content, function(e) {
-			if (e.index == 0)
-				callback(true)
-			else
-				callback(false)
-		}, title, button);
-		//#endif
-	},
-	isDateExpired: function(targetDate) {
-		const currentTimestamp = new Date().getTime();
-		const targetTimestamp = new Date(targetDate).getTime();
-		const rest = targetTimestamp < currentTimestamp
-		if (rest)
-			return [true, 0]
-		// 计算毫秒差
-		const diffInMs = targetTimestamp - currentTimestamp;
-
-		// 转换为小时(向上取整确保显示完整小时)
-		const hours = Math.ceil(diffInMs / (1000 * 60 * 60));
-
-		return [rest, hours > 0 ? hours : 0]; // 返回非负值
-	},
-	convert12to24: function(time12h) {
-		// 使用正则表达式匹配12小时制格式
-		const regex = /^(0?[1-9]|1[0-2]):([0-5]\d)\s?(AM|PM)$/i;
-		const match = time12h.match(regex);
-
-		if (!match) {
-			throw new Error('无效的时间格式,请使用如 "2:00 PM" 或 "02:00 PM" 的格式');
-		}
-
-		let hour = parseInt(match[1], 10);
-		const minute = match[2];
-		const period = match[3].toUpperCase();
-
-		// 处理AM/PM转换逻辑
-		if (period === 'PM' && hour !== 12) {
-			hour += 12;
-		} else if (period === 'AM' && hour === 12) {
-			hour = 0;
-		}
-
-		// 格式化为两位数
-		const hour24 = hour.toString().padStart(2, '0');
-
-		return `${hour24}:${minute}`;
-	},
-	changeTabbar: function(res) {
-		setTimeout(() => {
-			if (res == 1) {
-				uni.setTabBarItem({
-					index: 0,
-					text: '首页',
-					iconPath: "/static/tabbar/Home.png",
-					selectedIconPath: "/static/tabbar/Iconly_Bold_Home.png",
-				})
-				uni.setTabBarItem({
-					index: 1,
-					text: '急聘',
-					pagePath: "/pages/index/game/gameList",
-					iconPath: "/static/tabbar/jipin.png",
-					selectedIconPath: "/static/tabbar/ACjipin.png",
-				})
-			} else {
-				uni.setTabBarItem({
-					index: 0,
-					text: '牛人',
-					iconPath: "/static/tabbar/niu.png",
-					selectedIconPath: "/static/tabbar/niu2.png",
-				})
-				uni.setTabBarItem({
-					index: 1,
-					pagePath: "/pages/talentSearch/index",
-					iconPath: "/static/tabbar/Hrsearch.png",
-					selectedIconPath: "/static/tabbar/ACsearch.png",
-					text: "搜索"
-				})
-			}
-			// 可以在这里添加 tabbar 更新后的后续操作
-			console.log('tabbar 更新完成');
-		}, 100);
-	},
-	// 核心年龄计算函数
-	calculateAgeFromBirthday: function(birthday) {
-		const birthDate = new Date(birthday);
-		const currentDate = new Date();
-
-		// 验证日期有效性
-		if (isNaN(birthDate.getTime())) {
-			throw new Error('无效的生日日期');
-		}
-
-		if (birthDate > currentDate) {
-			throw new Error('生日日期不能晚于当前日期');
-		}
-
-		let years = currentDate.getFullYear() - birthDate.getFullYear();
-		let months = currentDate.getMonth() - birthDate.getMonth();
-		let days = currentDate.getDate() - birthDate.getDate();
-
-		// 处理天数负数情况
-		if (days < 0) {
-			months--;
-			// 获取上个月的天数
-			const lastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0);
-			days += lastMonth.getDate();
-		}
-
-		// 处理月份负数情况
-		if (months < 0) {
-			years--;
-			months += 12;
-		}
-
-		return years;
-	},
-	// 筛选求职列表
-	getFilterData: function() {
-		const condition = {
-			education: '', //学历
-			experience: '', //经验
-			industry: '', //行业
-			salaryRange: '', //薪资
-			companyPeople: '' //公司规模
-		}
-		//获取选中的筛选条件
-		if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
-			let filter = uni.getStorageSync('filter')
-			filter.map(item => {
-				let arr = []
-				item.list.map(ite => {
-					if (ite.value != '不限') {
-						arr.push(ite.value)
-					}
-				})
-				switch (item.name) {
-					case '学历要求':
-						condition.education = arr.join(',')
-						break;
-					case '薪资范围(单选)':
-						condition.salaryRange = arr.join(',')
-						break;
-					case '经验要求':
-						condition.experience = arr.join(',')
-						break;
-					case '公司规模':
-						condition.companyPeople = arr.join(',')
-						break;
-					case '行业':
-						condition.industry = arr.join(',')
-						break;
-				}
-
-			})
-			// console.log(filter)
-		}
-		return condition
-	},
-	//APP获取手机权限鉴权
-	// APP获取手机权限鉴权(优化版,兼容全权限+多系统)
-	
-	async checkPermission(permission, tip, that,perpop='permission') {
-	    // 权限映射配置
-	    let permisionID = '';
-	    let permisionIosID = '';
-	
-	    return new Promise(async (resolve) => {
-	        // #ifdef H5
-	        resolve(true);
-	        return;
-	        // #endif
-			
-			const appAuthorizeSetting = uni.getAppAuthorizeSetting()
-			if (permission == 'location') {
-			    permisionID = 'android.permission.ACCESS_FINE_LOCATION';
-			    permisionIosID = 'location';
-				if(appAuthorizeSetting.locationAuthorized=='authorized'){
-					resolve(true);
-					return
-				}
-			}
-			if (permission == 'camera') {
-			    permisionID = 'android.permission.CAMERA,android.permission.READ_EXTERNAL_STORAGE';
-			    permisionIosID = 'camera,photoLibrary';
-				if(appAuthorizeSetting.cameraAuthorized=='authorized'){
-					resolve(true);
-					return
-				}
-			}
-			if (permission == 'microphone') {
-			    permisionID = 'android.permission.RECORD_AUDIO';
-			    permisionIosID = 'record';
-				if(appAuthorizeSetting.microphoneAuthorized=='authorized'){
-					resolve(true);
-					return
-				}
-			}
-			
-	        // 特殊处理:相机权限在非iOS平台显示自定义弹窗
-	        if (uni.getSystemInfoSync().platform != 'ios') {
-				switch(perpop){
-					case 'permission':
-						that.$refs.permission.open();
-						break
-					case 'microphonePermission':
-						that.$refs.microphonePermission.open();
-						break
-					case 'locationPermission':
-						that.$refs.locationPermission.open();
-						break
-					default:
-					    console.warn('未知权限类型:', perpop);
-				}
-	            
-	        }
-	        // Android 平台处理
-	        if (uni.getSystemInfoSync().platform === 'android') {
-	            if (permisionID == '') {
-	                resolve(true);
-	                return;
-	            }
-	            
-	            try {
-	                const result = await permision.requestAndroidPermission(permisionID);
-	                console.log(result);
-	                switch(perpop){
-	                	case 'permission':
-	                		that.$refs.permission.close();
-							break
-	                	case 'microphonePermission':
-	                		that.$refs.microphonePermission.close();
-							break
-	                	case 'locationPermission':
-	                		that.$refs.locationPermission.close();
-							break
-	                	default:
-	                	    console.warn('未知权限类型:', perpop);
-	                }
-	                if (result == 1) {
-	                    console.log("已获得授权");
-	                    resolve(true);
-	                } else if (result == 0) {
-	                    console.log("未获得授权");
-	                    resolve(false);
-	                } else {
-	                    console.log("权限被拒绝");
-	                    // 显示确认对话框
-	                    this.appConfirm("权限被拒绝," + tip, function(res) {
-	                        if (res) {
-	                            uni.openAppAuthorizeSetting();
-	                        }
-	                        resolve(false);
-	                    });
-	                }
-	            } catch (error) {
-	                console.error("权限请求失败:", error);
-	                resolve(false);
-	            }
-	        } 
-	        // iOS 平台处理
-	        else {
-	            if (permisionIosID == '') {
-	                resolve(true);
-	                return;
-	            }
-	            
-	            const iosPermissions = permisionIosID.split(',');
-	            let allGranted = 0;
-	            
-	            for (let i = 0; i < iosPermissions.length; i++) {
-	                const currentPermission = iosPermissions[i];
-	                allGranted = permision.judgeIosPermission(currentPermission);
-	                console.log('权限状态码:',allGranted)
-	            }
-				if(allGranted==0){
-					console.log('第一次授权')
-					resolve(true);
-				}else if(allGranted==3){
-					console.log('已授权')
-					resolve(true);
-				}else{
-					this.appConfirm("权限被拒绝," + tip, function(res) {
-						if (res) {
-							uni.openAppAuthorizeSetting();
-						}
-						resolve(false);
-					});
-				}
-	        }
-	    });
-	},
-	appShare(scene,that) {
-		uni.share({
-			provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
-			scene: scene, //场景,可取值参考下面说明。
-			type: 0, //分享形式 0:图文 1:纯文字 2:纯图片 3:音乐 4:视频 5:小程序
-			summary: '亿职赞APP新上线,欢迎前来体验',
-			href:configdata.h5Url+'/pages/index/download',
-			imageUrl:configdata.h5Url+'/40x40.png',
-			success: function(res) {
-				that.shows = false; //成功后关闭底部弹框
-			},
-			fail: (err) =>{
-				this.showToast('分享失败')
-				that.shows = false;
-			}
-		});
-	},
-	connectSocket() {
-		let that = this
-		let userId = this.getData('userId');
-		if(!userId)
-			return;
-		uni.closeSocket()
-		uni.connectSocket({
-			url: configdata.WSHOST1 + '' + userId,
-			data() {
-				return {
-					msg: 'Hello'
-				}
-			},
-			header: {
-				'content-type': 'application/json'
-			},
-			method: 'GET',
-			success(res) {
-				// 这里是接口调用成功的回调,不是连接成功的回调,请注意
-				console.log('连接成功',res)
-				that.onSocketMsg();
-			},
-			fail(err) {
-				console.log('连接失败',res)
-				// 这里是接口调用失败的回调,不是连接失败的回调,请注意
-			}
-		})
-	},
-	onSocketMsg(){
-		let that = this
-		uni.onSocketMessage((res) => {
-		  if (res.data === 'HeartBeat') return // 忽略心跳包
-		  let msg
-		  try {
-		    msg = JSON.parse(res.data)
-		  } catch (e) {
-		    // console.log('消息不是JSON格式:', res.data)
-		    return
-		  }
-		  if (msg.type === 'kickOut') {
-		    uni.showModal({
-		      title: '提示',
-		      content: msg.content,
-		      showCancel: false,
-		      success() {
-		        that.logout();
-				// #ifdef H5	
-		        uni.reLaunch({ url: '/pages/public/loginphone?type=1' })
-				// #endif
-				// #ifndef H5
-				uni.reLaunch({ url: '/pages/public/loginV2' })
-				// #endif
-		      }
-		    })
-		  }
-		})
-	},
-	sendImMessage(userId,content,messageType,chatConversationId,recordId){
-		let data = {
-			userId,
-			content,
-			messageType,
-			chatConversationId
-		}
-		if(recordId){
-			data = {
-				...data,
-				recordId
-			}
-		}
-		data = JSON.stringify(data);
-		return new Promise(async (resolve,reject) => {
-			uni.sendSocketMessage({
-				data: data,
-				success(res) {
-					resolve(res)
-				},
-				fail(err) {
-					reject(err);
-				}
-			})
-		})
-	},
-	
-	/**
-	 * 深合并两个对象:将前一个对象的数据合并到后一个对象(支持嵌套对象)
-	 * @param {Object} sourceObj - 源对象(提供数据的对象,前一个对象)
-	 * @param {Object} targetObj - 目标对象(被合并的对象,后一个对象)
-	 * @returns {Object} 合并后的目标对象
-	 */
-	deepMergeObject(sourceObj, targetObj) {
-		// 1. 参数校验
-		const isValidObj = (obj) => obj !== null && typeof obj === 'object' && !Array.isArray(obj);
-		if (!isValidObj(sourceObj)) return isValidObj(targetObj) ? targetObj : {};
-		if (!isValidObj(targetObj)) return JSON.parse(JSON.stringify(sourceObj)); // 简单深拷贝源对象
-	
-		// 2. 遍历源对象属性
-		Object.keys(sourceObj).forEach((key) => {
-			const sourceValue = sourceObj[key];
-			const targetValue = targetObj[key];
-	
-			// 3. 处理嵌套对象(递归合并)
-			if (isValidObj(sourceValue) && isValidObj(targetValue)) {
-				deepMergeObject(sourceValue, targetValue); // 递归处理嵌套对象
-				return; // 嵌套对象处理完毕,跳过后续逻辑
-			}
-		
-			// 4. 非嵌套对象,按照原规则处理
-			if (!(key in targetObj) || targetValue === null || targetValue === undefined) {
-				targetObj[key] = sourceValue;
-			}
-		});
-	
-		return targetObj;
-	}
+/**
+ * 
+ * @author maxd
+ * @date 2019.8.1
+ */
+import configdata from './config'
+import cache from './cache'
+// #ifdef APP-PLUS 
+import permision from "../js_sdk/wa-permission/permission.js"
+// #endif
+
+function getHost(name) {
+	const webConfig = cache.get('web_config')
+	if (webConfig && webConfig[name]) {
+		return webConfig[name]
+	}
+	return configdata[name]
+}
+
+module.exports = {
+	//微信的appId
+	getWxAppid() {
+		return 'wxd0bec3a917085e78'
+	},
+	//全局邀请码
+	getInvitation() {
+		return uni.getStorageSync("publicRelation")
+	},
+	//获取APP下载地址
+	getAppDownUrl() {
+		return uni.getStorageSync("appurl")
+	},
+	//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
+	publicYuMing() {
+		return configdata.h5Url
+	},
+	// 登录判断
+	toLogin(type) {
+		let url = '/pages/public/loginV2'
+		// #ifdef H5
+		url = '/pages/public/login'
+		// #endif
+		switch (type) {
+			case 'navigateTo':
+				uni.navigateTo({
+					url
+				})
+				break
+			default:
+				uni.reLaunch({
+					url
+				})
+		}
+	},
+	logout() {
+		this.remove("token");
+		this.remove("userId");
+		this.remove("mobile");
+		this.remove("openid");
+		this.remove("nickName");
+		this.remove("relation");
+		this.remove("image_url");
+		this.remove("relation_id");
+		this.remove("isInvitation");
+		this.remove("userType");
+		this.remove("member");
+		this.remove('companyId')
+		this.remove('avatar')
+		this.remove('age')
+		this.remove('companyName')
+		this.remove('companyStatus')
+		this.remove('isVip')
+		this.remove('vipMsgNum')
+		this.remove('vipMsgPrice')
+		this.remove('vipDueTimes')
+		this.remove('msgNum')
+		this.remove('msgPrice')
+		this.remove('invitationCode')
+		this.remove('inviterCode')
+		this.remove('hadShowPoster')
+	},
+	loginClear() {
+		this.remove("token");
+		this.remove("userId");
+		this.remove("mobile");
+		this.remove("nickName");
+		this.remove("image_url");
+		this.remove("relation_id");
+		this.remove("isInvitation");
+		this.remove("member");
+	},
+	showLoading(title) {
+		uni.showLoading({
+			title: title
+		});
+	},
+	showToast(title) {
+		uni.showToast({
+			title: title,
+			mask: false,
+			duration: 2000,
+			icon: "none"
+		});
+	},
+	getChatSearchKeys: function(key) {
+		let list = uni.getStorageSync("chatSearchKeys");
+		let keys = key.replace(/\s*/g, "")
+		let over = false
+		for (var i = 0; i < keys.length; i++) {
+			// console.error(keys[i])
+			if (list.indexOf(keys[i]) != -1) {
+				over = true;
+				// return over;
+			}
+
+		}
+		return over;
+
+	},
+	setJson: function(key, value) {
+		let jsonString = JSON.stringify(value);
+		try {
+			uni.setStorageSync(key, jsonString);
+		} catch (e) {
+			// error
+		}
+	},
+	setData: function(key, value) {
+		try {
+			uni.setStorageSync(key, value);
+		} catch (e) {
+			// error
+		}
+	},
+	getData: function(key) {
+		try {
+			const value = uni.getStorageSync(key);
+			if (value) {
+				return value;
+			}
+		} catch (e) {
+			// error
+		}
+
+	},
+	getJson: function(key) {
+		try {
+			const value = uni.getStorageSync(key);
+			if (value) {
+				return JSON.parse(value);
+			}
+		} catch (e) {
+			// error
+		}
+
+	},
+	clear: function() {
+		uni.clearStorage();
+	},
+	get: function(key) { //获取队列里面全部的数据
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			return data;
+		}
+		return [];
+	},
+	insert: function(param) { //队列插入数据
+		param.capacityNum = param.capacityNum || 100; //队列容量 默认队列中超过100条数据,自动删除尾部
+		let data = this.getJson(param.key);
+		if (data instanceof Array) {
+			if (data.length > param.capacityNum) {
+				let total = data.length - param.capacityNum;
+				for (let i = 0; i < total; i++) {
+					data.pop();
+				}
+			}
+			data.unshift(param.value);
+		} else {
+			data = [];
+			data.push(param.value);
+		}
+		this.setJson(param.key, data);
+	},
+	removeItem: function(key, itemIds) { //提供itemIds数组 批量删除队列中的某项数据
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			for (let i = 0; i < itemIds.length; i++) {
+				for (let p = 0; p < data.length; p++) {
+					if (itemIds[i] === data[p].itemid) {
+						data.splice(p, 1);
+						break;
+					}
+				}
+			}
+			this.setJson(key, data);
+		}
+	},
+	isExist: function(key, itemId) { //检测某条数据在队列中是否存在
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			for (let p = 0; p < data.length; p++) {
+				if (itemId === data[p].itemid) {
+					return true;
+				}
+			}
+		}
+		return false;
+	},
+	isExistPdd: function(key, itemId) { //检测某条数据在队列中是否存在
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			for (let p = 0; p < data.length; p++) {
+				if (itemId === data[p].goodsId) {
+					return true;
+				}
+			}
+		}
+		return false;
+	},
+	isExistJd: function(key, itemId) { //检测某条数据在队列中是否存在
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			for (let p = 0; p < data.length; p++) {
+				if (itemId === data[p].skuId) {
+					return true;
+				}
+			}
+		}
+		return false;
+	},
+	remove: function(key) { //删除某条队列
+		try {
+			uni.removeStorageSync(key);
+			//localStorage.removeItem(key)
+		} catch (e) {
+			// error
+		}
+	},
+	getCount: function(key) { //获取队列中全部数据数量
+
+		let data = this.getJson(key);
+		if (data instanceof Array) {
+			return data.length;
+		}
+		return 0;
+	},
+	uploadFile: function(path, callback) {
+		const host = getHost('APIHOST1')
+		const uploadTask = uni.uploadFile({ // 上传接口
+			url: host + '/alioss/upload', //真实的接口地址
+			filePath: path,
+			name: 'file',
+			success: (uploadFileRes) => {
+				let content = JSON.parse(uploadFileRes.data).data;
+				uni.hideLoading();
+				callback(content)
+			},
+			fail: (err) => {
+				callback(false)
+				console.log(err)
+			}
+		});
+		uploadTask.onProgressUpdate((res) => {
+			uni.showLoading({
+				title: '上传进度' + res.progress + '%',
+			})
+			if (res.progress >= 100) {
+				uni.hideLoading()
+			}
+		})
+	},
+	/**
+	 * 上传文件
+	 * @param {Object} params 参数
+	 *  url:服务器地址
+	 *  path:文件本地地址
+	 *  name:文件名称
+	 *  formData:上传参数
+	 * @param {Object} callback
+	 */
+	uploadFiles: function(params, callback) {
+		let url = params.url ? params.url : ''
+		let filePath = params.path ? params.path : ''
+		let name = params.name ? params.name : ''
+		let formData = params.data ? params.data : {}
+		const host = getHost('APIHOST')
+		const uploadTask = uni.uploadFile({ // 上传接口
+			url: `${host}${url}`, //真实的接口地址
+			filePath,
+			name,
+			formData,
+			header: {
+				token: uni.getStorageSync('token')
+			},
+			success: (uploadFileRes) => {
+				let content = JSON.parse(uploadFileRes.data)
+				uni.hideLoading();
+				callback(content)
+			},
+			fail: (err) => {
+				callback(false)
+				console.log(err)
+			}
+		});
+		uploadTask.onProgressUpdate((res) => {
+			uni.showLoading({
+				title: '上传进度' + res.progress + '%',
+			})
+			if (res.progress >= 100) {
+				uni.hideLoading()
+			}
+		})
+	},
+	array_column: function(arr, column_key, index_key = null) {
+		if (index_key === null) {
+			return arr.map(item => item[column_key]);
+		}
+
+		return arr.reduce((result, item) => {
+			result[item[index_key]] = item[column_key];
+			return result;
+		}, {});
+	},
+	isCurrentMonth: function(date) {
+		const now = new Date();
+		return now.getFullYear() === date.getFullYear() &&
+			now.getMonth() === date.getMonth();
+	},
+	getHighestEducation: function(educations) {
+		// 定义学历等级映射(从低到高)
+		const educationLevels = {
+			'小学': 1,
+			'初中': 2,
+			'高中': 3,
+			'中专': 4,
+			'大专': 5,
+			'本科': 6,
+			'硕士': 7,
+			'博士': 8,
+			'博士后': 9
+		};
+
+		let highestEducation = null;
+		let highestLevel = -1;
+
+		educations.forEach(edu => {
+			const level = educationLevels[edu.degree] || 0;
+			if (level > highestLevel) {
+				highestLevel = level;
+				highestEducation = edu.degree;
+			}
+		});
+
+		return highestEducation;
+	},
+
+	//职业状态
+	resumesStatus() {
+
+		return [{
+				value: '0',
+				text: '离职-随时到岗',
+				recommended: true
+			},
+			{
+				value: '1',
+				text: '在职-月内到岗',
+				recommended: true
+			},
+			{
+				value: '2',
+				text: '在职-考虑机会',
+				recommended: false
+			},
+			{
+				value: '3',
+				text: '在职-暂不考虑',
+				recommended: false
+			},
+			{
+				value: '4',
+				text: '实习',
+				recommended: false
+			}
+		]
+	},
+
+	appConfirm: function(content = '请确认您的操作?', callback, title = '操作提示', button = ["继续", "取消"]) {
+		// #ifndef APP-PLUS 
+		uni.showModal({
+			title: title,
+			content: content,
+			success: function(res) {
+				if (res.confirm) {
+					callback(true)
+				} else
+					callback(false)
+			}
+		});
+		return
+		//#endif
+		// #ifdef APP-PLUS 
+		plus.nativeUI.confirm(content, function(e) {
+			if (e.index == 0)
+				callback(true)
+			else
+				callback(false)
+		}, title, button);
+		//#endif
+	},
+	isDateExpired: function(targetDate) {
+		const currentTimestamp = new Date().getTime();
+		const targetTimestamp = new Date(targetDate).getTime();
+		const rest = targetTimestamp < currentTimestamp
+		if (rest)
+			return [true, 0]
+		// 计算毫秒差
+		const diffInMs = targetTimestamp - currentTimestamp;
+
+		// 转换为小时(向上取整确保显示完整小时)
+		const hours = Math.ceil(diffInMs / (1000 * 60 * 60));
+
+		return [rest, hours > 0 ? hours : 0]; // 返回非负值
+	},
+	convert12to24: function(time12h) {
+		// 使用正则表达式匹配12小时制格式
+		const regex = /^(0?[1-9]|1[0-2]):([0-5]\d)\s?(AM|PM)$/i;
+		const match = time12h.match(regex);
+
+		if (!match) {
+			throw new Error('无效的时间格式,请使用如 "2:00 PM" 或 "02:00 PM" 的格式');
+		}
+
+		let hour = parseInt(match[1], 10);
+		const minute = match[2];
+		const period = match[3].toUpperCase();
+
+		// 处理AM/PM转换逻辑
+		if (period === 'PM' && hour !== 12) {
+			hour += 12;
+		} else if (period === 'AM' && hour === 12) {
+			hour = 0;
+		}
+
+		// 格式化为两位数
+		const hour24 = hour.toString().padStart(2, '0');
+
+		return `${hour24}:${minute}`;
+	},
+	changeTabbar: function(res) {
+		setTimeout(() => {
+			if (res == 1) {
+				uni.setTabBarItem({
+					index: 0,
+					text: '首页',
+					iconPath: "/static/tabbar/Home.png",
+					selectedIconPath: "/static/tabbar/Iconly_Bold_Home.png",
+				})
+				uni.setTabBarItem({
+					index: 1,
+					text: '急聘',
+					pagePath: "/pages/index/game/gameList",
+					iconPath: "/static/tabbar/jipin.png",
+					selectedIconPath: "/static/tabbar/ACjipin.png",
+				})
+			} else {
+				uni.setTabBarItem({
+					index: 0,
+					text: '牛人',
+					iconPath: "/static/tabbar/niu.png",
+					selectedIconPath: "/static/tabbar/niu2.png",
+				})
+				uni.setTabBarItem({
+					index: 1,
+					pagePath: "/pages/talentSearch/index",
+					iconPath: "/static/tabbar/Hrsearch.png",
+					selectedIconPath: "/static/tabbar/ACsearch.png",
+					text: "搜索"
+				})
+			}
+			// 可以在这里添加 tabbar 更新后的后续操作
+			console.log('tabbar 更新完成');
+		}, 100);
+	},
+	// 核心年龄计算函数
+	calculateAgeFromBirthday: function(birthday) {
+		const birthDate = new Date(birthday);
+		const currentDate = new Date();
+
+		// 验证日期有效性
+		if (isNaN(birthDate.getTime())) {
+			throw new Error('无效的生日日期');
+		}
+
+		if (birthDate > currentDate) {
+			throw new Error('生日日期不能晚于当前日期');
+		}
+
+		let years = currentDate.getFullYear() - birthDate.getFullYear();
+		let months = currentDate.getMonth() - birthDate.getMonth();
+		let days = currentDate.getDate() - birthDate.getDate();
+
+		// 处理天数负数情况
+		if (days < 0) {
+			months--;
+			// 获取上个月的天数
+			const lastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0);
+			days += lastMonth.getDate();
+		}
+
+		// 处理月份负数情况
+		if (months < 0) {
+			years--;
+			months += 12;
+		}
+
+		return years;
+	},
+	// 筛选求职列表
+	getFilterData: function() {
+		const condition = {
+			education: '', //学历
+			experience: '', //经验
+			industry: '', //行业
+			salaryRange: '', //薪资
+			companyPeople: '' //公司规模
+		}
+		//获取选中的筛选条件
+		if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
+			let filter = uni.getStorageSync('filter')
+			filter.map(item => {
+				let arr = []
+				item.list.map(ite => {
+					if (ite.value != '不限') {
+						arr.push(ite.value)
+					}
+				})
+				switch (item.name) {
+					case '学历要求':
+						condition.education = arr.join(',')
+						break;
+					case '薪资范围(单选)':
+						condition.salaryRange = arr.join(',')
+						break;
+					case '经验要求':
+						condition.experience = arr.join(',')
+						break;
+					case '公司规模':
+						condition.companyPeople = arr.join(',')
+						break;
+					case '行业':
+						condition.industry = arr.join(',')
+						break;
+				}
+
+			})
+			// console.log(filter)
+		}
+		return condition
+	},
+	//APP获取手机权限鉴权
+	// APP获取手机权限鉴权(优化版,兼容全权限+多系统)
+
+	async checkPermission(permission, tip, that, perpop = 'permission') {
+		// 权限映射配置
+		let permisionID = '';
+		let permisionIosID = '';
+
+		return new Promise(async (resolve) => {
+			// #ifdef H5
+			resolve(true);
+			return;
+			// #endif
+
+			const appAuthorizeSetting = uni.getAppAuthorizeSetting()
+			if (permission == 'location') {
+				permisionID = 'android.permission.ACCESS_FINE_LOCATION';
+				permisionIosID = 'location';
+				if (appAuthorizeSetting.locationAuthorized == 'authorized') {
+					resolve(true);
+					return
+				}
+			}
+			if (permission == 'camera') {
+				permisionID = 'android.permission.CAMERA,android.permission.READ_EXTERNAL_STORAGE';
+				permisionIosID = 'camera,photoLibrary';
+				if (appAuthorizeSetting.cameraAuthorized == 'authorized') {
+					resolve(true);
+					return
+				}
+			}
+			if (permission == 'microphone') {
+				permisionID = 'android.permission.RECORD_AUDIO';
+				permisionIosID = 'record';
+				if (appAuthorizeSetting.microphoneAuthorized == 'authorized') {
+					resolve(true);
+					return
+				}
+			}
+
+			// 特殊处理:相机权限在非iOS平台显示自定义弹窗
+			if (uni.getSystemInfoSync().platform != 'ios') {
+				switch (perpop) {
+					case 'permission':
+						that.$refs.permission.open();
+						break
+					case 'microphonePermission':
+						that.$refs.microphonePermission.open();
+						break
+					case 'locationPermission':
+						that.$refs.locationPermission.open();
+						break
+					default:
+						console.warn('未知权限类型:', perpop);
+				}
+
+			}
+			// Android 平台处理
+			if (uni.getSystemInfoSync().platform === 'android') {
+				if (permisionID == '') {
+					resolve(true);
+					return;
+				}
+
+				try {
+					const result = await permision.requestAndroidPermission(permisionID);
+					console.log(result);
+					switch (perpop) {
+						case 'permission':
+							that.$refs.permission.close();
+							break
+						case 'microphonePermission':
+							that.$refs.microphonePermission.close();
+							break
+						case 'locationPermission':
+							that.$refs.locationPermission.close();
+							break
+						default:
+							console.warn('未知权限类型:', perpop);
+					}
+					if (result == 1) {
+						console.log("已获得授权");
+						resolve(true);
+					} else if (result == 0) {
+						console.log("未获得授权");
+						resolve(false);
+					} else {
+						console.log("权限被拒绝");
+						// 显示确认对话框
+						this.appConfirm("权限被拒绝," + tip, function(res) {
+							if (res) {
+								uni.openAppAuthorizeSetting();
+							}
+							resolve(false);
+						});
+					}
+				} catch (error) {
+					console.error("权限请求失败:", error);
+					resolve(false);
+				}
+			}
+			// iOS 平台处理
+			else {
+				if (permisionIosID == '') {
+					resolve(true);
+					return;
+				}
+
+				const iosPermissions = permisionIosID.split(',');
+				let allGranted = 0;
+
+				for (let i = 0; i < iosPermissions.length; i++) {
+					const currentPermission = iosPermissions[i];
+					allGranted = permision.judgeIosPermission(currentPermission);
+					console.log('权限状态码:', allGranted)
+				}
+				if (allGranted == 0) {
+					console.log('第一次授权')
+					resolve(true);
+				} else if (allGranted == 3) {
+					console.log('已授权')
+					resolve(true);
+				} else {
+					this.appConfirm("权限被拒绝," + tip, function(res) {
+						if (res) {
+							uni.openAppAuthorizeSetting();
+						}
+						resolve(false);
+					});
+				}
+			}
+		});
+	},
+	appShare(scene, that) {
+		uni.share({
+			provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
+			scene: scene, //场景,可取值参考下面说明。
+			type: 0, //分享形式 0:图文 1:纯文字 2:纯图片 3:音乐 4:视频 5:小程序
+			summary: '亿职赞APP新上线,欢迎前来体验',
+			href: configdata.h5Url + '/pages/index/download',
+			imageUrl: configdata.h5Url + '/40x40.png',
+			success: function(res) {
+				that.shows = false; //成功后关闭底部弹框
+			},
+			fail: (err) => {
+				this.showToast('分享失败')
+				that.shows = false;
+			}
+		});
+	},
+	connectSocket() {
+		let that = this
+		let userId = this.getData('userId');
+		const wsHost = getHost('WSHOST1')
+		if (!userId)
+			return;
+		uni.closeSocket()
+		uni.connectSocket({
+			url: wsHost + '' + userId,
+			data() {
+				return {
+					msg: 'Hello'
+				}
+			},
+			header: {
+				'content-type': 'application/json'
+			},
+			method: 'GET',
+			success(res) {
+				// 这里是接口调用成功的回调,不是连接成功的回调,请注意
+				console.log('连接成功', res)
+				that.onSocketMsg();
+			},
+			fail(err) {
+				console.log('连接失败', res)
+				// 这里是接口调用失败的回调,不是连接失败的回调,请注意
+			}
+		})
+	},
+	onSocketMsg() {
+		let that = this
+		uni.onSocketMessage((res) => {
+			if (res.data === 'HeartBeat') return // 忽略心跳包
+			let msg
+			try {
+				msg = JSON.parse(res.data)
+			} catch (e) {
+				// console.log('消息不是JSON格式:', res.data)
+				return
+			}
+			if (msg.type === 'kickOut') {
+				uni.showModal({
+					title: '提示',
+					content: msg.content,
+					showCancel: false,
+					success() {
+						that.logout();
+						// #ifdef H5	
+						uni.reLaunch({
+							url: '/pages/public/loginphone?type=1'
+						})
+						// #endif
+						// #ifndef H5
+						uni.reLaunch({
+							url: '/pages/public/loginV2'
+						})
+						// #endif
+					}
+				})
+			}
+		})
+	},
+	sendImMessage(userId, content, messageType, chatConversationId, recordId) {
+		let data = {
+			userId,
+			content,
+			messageType,
+			chatConversationId
+		}
+		if (recordId) {
+			data = {
+				...data,
+				recordId
+			}
+		}
+		data = JSON.stringify(data);
+		return new Promise(async (resolve, reject) => {
+			uni.sendSocketMessage({
+				data: data,
+				success(res) {
+					resolve(res)
+				},
+				fail(err) {
+					reject(err);
+				}
+			})
+		})
+	},
+
+	/**
+	 * 深合并两个对象:将前一个对象的数据合并到后一个对象(支持嵌套对象)
+	 * @param {Object} sourceObj - 源对象(提供数据的对象,前一个对象)
+	 * @param {Object} targetObj - 目标对象(被合并的对象,后一个对象)
+	 * @returns {Object} 合并后的目标对象
+	 */
+	deepMergeObject(sourceObj, targetObj) {
+		// 1. 参数校验
+		const isValidObj = (obj) => obj !== null && typeof obj === 'object' && !Array.isArray(obj);
+		if (!isValidObj(sourceObj)) return isValidObj(targetObj) ? targetObj : {};
+		if (!isValidObj(targetObj)) return JSON.parse(JSON.stringify(sourceObj)); // 简单深拷贝源对象
+
+		// 2. 遍历源对象属性
+		Object.keys(sourceObj).forEach((key) => {
+			const sourceValue = sourceObj[key];
+			const targetValue = targetObj[key];
+
+			// 3. 处理嵌套对象(递归合并)
+			if (isValidObj(sourceValue) && isValidObj(targetValue)) {
+				deepMergeObject(sourceValue, targetValue); // 递归处理嵌套对象
+				return; // 嵌套对象处理完毕,跳过后续逻辑
+			}
+
+			// 4. 非嵌套对象,按照原规则处理
+			if (!(key in targetObj) || targetValue === null || targetValue === undefined) {
+				targetObj[key] = sourceValue;
+			}
+		});
+
+		return targetObj;
+	}
 };

+ 1 - 1
manifest.json

@@ -196,7 +196,7 @@
                 "JPUSH_GOOGLE_STORAGE_BUCKET" : "",
                 "JPUSH_HONOR_APPID" : "104533692",
                 "JPUSH_HUAWEI_APPID" : "116155907",
-                "JPUSH_ISPRODUCTION_IOS" : "true",
+                "JPUSH_ISPRODUCTION_IOS" : "",
                 "JPUSH_MEIZU_APPID" : "",
                 "JPUSH_MEIZU_APPKEY" : "",
                 "JPUSH_OPPO_APPID" : "36598376",

+ 2 - 1
package/my/previewResume/index.vue

@@ -102,7 +102,8 @@
 		display: flex;
 		justify-content: center;
 		background-color: #fff;
-		height: 80rpx;
+		height: 90rpx;
+		padding-top: 10rpx;
 		.tab {
 			padding: 24rpx 32rpx 12rpx;
 			.tab-name {

+ 7 - 5
package/screen/screen.vue

@@ -76,12 +76,14 @@
 				type: "",
 				isBrowse: false, //是否是从用户浏览记录里过来的
 				isCompyBrowse: false, //是否是从企业浏览记录过来的
-				isCompyHistory: false, //是否是从企业的投递记录过来的
+				isCompyHistory: false, //是否是从企业的投递记录过来的
+				storageKey: 'filter', // 首页 filter,搜索页 filterSearch
 			};
 		},
 		onLoad(option) {
 			if (option.type) {
-				this.type = option.type;
+				this.type = option.type;
+				this.storageKey = option.type == 1 ? 'filterSearch' : 'filter'
 			}
 			if (option.isBrowse) {
 				this.isBrowse = true;
@@ -117,7 +119,7 @@
 				} else if (this.isCompyHistory) {
 					uni.removeStorageSync("isCompyHistory");
 				} else {
-					uni.removeStorageSync("filter");
+					uni.removeStorageSync(this.storageKey);
 				}
 			},
 			/**
@@ -148,7 +150,7 @@
 				} else if (this.isCompyHistory) {
 					uni.setStorageSync("isCompyHistory", arr);
 				} else {
-					uni.setStorageSync("filter", arr);
+					uni.setStorageSync(this.storageKey, arr);
 				}
 				uni.$emit('updateScreenFilterRecord')
 				uni.navigateBack();
@@ -358,7 +360,7 @@
 						this.list = arr;
 						// 从缓存加载选中状态
 						const storageKeys = [{
-								key: 'filter',
+								key: this.storageKey,
 								condition: !this.isBrowse && !this.isCompyBrowse && !this.isCompyHistory
 							},
 							{

+ 5 - 5
pages/index/game/gameList.vue

@@ -88,7 +88,7 @@
                 <view class="company-details">
                   <text>{{ item.company ? item.company.companyPeople : "0人" }}</text>
                   <text>{{
-                    item.company ? item.industry.split(",").join(" ") : "未知行业"
+                    item.company ? item.industry && item.industry.split(",").join(" ") : "未知行业"
                   }}</text>
                 </view>
 
@@ -485,13 +485,13 @@ export default {
         lng: this.longitude,
         lat: this.latitude,
         isDue: 1,
-        userId: uni.getStorageSync("userId") ? uni.getStorageSync("userId") : "",
+        // userId: uni.getStorageSync("userId") ? uni.getStorageSync("userId") : "",
       };
       this.$Request.get("/app/postPush/userGetPostPushList", data).then((res) => {
         if (res.code == 0) {
           res.data.records.map((item) => {
             if (item.positionWelfare) {
-              item.positionWelfare = item.positionWelfare.split(",");
+              item.positionWelfare = item.positionWelfare?.split(",");
             } else {
               item.positionWelfare = [];
             }
@@ -545,7 +545,7 @@ export default {
         lng: this.longitude,
         lat: this.latitude,
         isDue: 1,
-        userId: uni.getStorageSync("userId") ? uni.getStorageSync("userId") : "",
+        // userId: uni.getStorageSync("userId") ? uni.getStorageSync("userId") : "",
         education: this.education || '',//学历
         experience: this.experience || '',//经验
         industry: this.industry || '',//行业
@@ -557,7 +557,7 @@ export default {
         if (res.code == 0) {
           res.data.records.map((item) => {
             if (item.welfareTag) {
-              item.welfareTag = item.welfareTag.split(";");
+              item.welfareTag = item.welfareTag?.split(";");
             } else {
               item.welfareTag = [];
             }

+ 1 - 1
pages/msg/im.vue

@@ -2609,7 +2609,7 @@
 						  logoutJP()
 							that.$queue.logout();
 							// #ifdef H5	
-							uni.reLaunch({ url: '/pages/public/loginphone?type=1' })
+							uni.reLaunch({ url: '/pages/public/loginphone?type=2' })
 							// #endif
 							// #ifndef H5
 							uni.reLaunch({ url: '/pages/public/loginV2' })

+ 3 - 2
pages/msg/index.vue

@@ -70,7 +70,7 @@
 			<template v-if="chatList.length">
 				<scroll-view
 					class="scroll-view"
-					:style="{ height: `calc(100vh - 480rpx - ${BarHeight}px)` }"
+					:style="{ height: `calc(100vh - 380rpx - ${BarHeight}px)` }"
 					:scroll-y="true"
 					:refresher-threshold="100"
 					:refresher-enabled="true"
@@ -859,7 +859,8 @@
 <style lang="scss" scoped>
 	.msg-box {
 		display: flex;
-		flex-direction: column;
+		flex-direction: column;
+		// height: 400px;
 		font-family: DM Sans;
 
 		.chat-title {

+ 24 - 7
pages/my/index.vue

@@ -101,7 +101,7 @@
 						<view class="jobServer-box flex justify-center">
 							<view class="jobServer-box-c">
 								<!-- <view class="jobServer-box-title"> 求职服务 </view> -->
-								<view class="jobServer-box-btn flex justify-between">
+								<view class="jobServer-box-btn flex justify-between" style="padding: 0 30px;">
 									<view class="jobServer-box-btn-item flex justify-center flex-wrap"
 										@click="goNav('/pages/my/onlineResume')">
 										<image src="../../static/images/index/qwzn.svg" mode=""></image>
@@ -118,11 +118,11 @@
 										<image src="../../static/images/index/fwzx.svg" mode=""></image>
 										<view class=""> 求职意向 </view>
 									</view>
-									<view class="jobServer-box-btn-item flex justify-center flex-wrap"
+									<!-- <view class="jobServer-box-btn-item flex justify-center flex-wrap"
 										@click="gojiLuList('/package/records/records', '面试记录')">
 										<image src="../../static/images/index/rmhd.svg" mode=""></image>
 										<view class=""> 项目中心 </view>
-									</view>
+									</view> -->
 								</view>
 							</view>
 						</view>
@@ -226,7 +226,7 @@
 				</view>
 				<view class="user-content">
 					<!-- 升级VIP -->
-					<view v-if="iosAudit == 0" class="vip-upgrade-banner" @click="goVipUpgrade">
+					<view v-if="iosAudit == 0 && showVipBanner" class="vip-upgrade-banner" @click="goVipUpgrade">
 						<view class="vip-banner-content">
 							<view class="vip-banner-text"> 升级VIP专享超值权益 </view>
 							<view class="vip-upgrade-button"> 去升级 </view>
@@ -439,7 +439,8 @@ export default {
 			companyInfo: "",
 			companyStatus: "", //企业认证状态(1:审核中 2:已通过 3:已拒绝 空:未认证)
 			isAndroid: false,
-			iosAudit: 1,
+			iosAudit: 1,
+			showVipBanner: false,
 			showNotice:false,
 			score: 0, // 简历完善度
 			auditModal: false,
@@ -574,7 +575,9 @@ export default {
 				this.openMsg();
 			}
 			// #endif
-		}
+		}
+		
+		this.getConfigData()
 	},
 	methods: {
 		// 入职公司
@@ -1450,6 +1453,20 @@ export default {
 					this.$queue.showToast(err || '扫码失败了,请重新尝试')
 				}
 			})
+		},
+		
+		// 获取配置数据
+		getConfigData() {
+			this.$Request
+				.get('/app/dict/list', {
+					type: 'VIP按钮'
+				})
+				.then((res) => {
+					if (res.code == 0 && res.data?.length) {
+						this.showVipBanner = res.data[0]?.code == '开'
+					}
+					console.log(this.showVipBanner)
+				})
 		}
 	},
 };
@@ -1867,7 +1884,7 @@ page {
 			
 			// 简历完善度
 			.resume-progress {
-				width: 180rpx;
+				width: 190rpx;
 				margin-bottom: 12rpx;
 				.text-tip {
 					font-size: 24rpx;

+ 1 - 1
pages/public/login.vue

@@ -460,7 +460,7 @@
 									
 								} else {
 									uni.navigateTo({
-										url: `/pages/public/loginphone?type=1`,
+										url: `/pages/public/loginphone?type=2`,
 									});
 								}
 							})

+ 33 - 33
pages/public/loginV2.vue

@@ -28,10 +28,10 @@
 			<view class="login-btn" @click="handleLogin">注册登录</view>
 			<!-- #ifdef APP-PLUS -->
 			<view class="other-login">
-				<view class="other-type" @click="handleWxLogin">
+				<!-- <view class="other-type" @click="handleWxLogin">
 					<image src="/static/wechat.png" class="icon"></image>
 					<view class="text">微信登录</view>
-				</view>
+				</view> -->
 				<view class="other-type" @click="handlOneKeyLogin">
 					<image src="/static/phone.png" class="icon"></image>
 					<view class="text">一键登录</view>
@@ -225,37 +225,37 @@
 						uni.hideLoading()
 					})
 			},
-			// 微信登录
-			handleWxLogin() {
-				uni.showLoading({
-					title: '登录中'
-				})
-				uni.login({
-					provider: 'weixin',
-					success: (wxRes) => {
-						this.$queue.setData('openId', wxRes.authResult.openid)
-						this.$queue.setData('unionId', wxRes.authResult.unionId)
-						let data = {
-							wxOpenId: loginRes.authResult.openid,
-							token: loginRes.authResult.access_token
-						}
-						this.$Request
-							.postT('/app/Login/wxAppLogin', data)
-							.then(res => {
-								this.loginFinished(res)
-								uni.hideLoading()
-							})
-							.catch(() => {
-								this.$queue.showToast('登录失败,请稍后重试或更换其他登录方式')
-								uni.hideLoading()
-							})
-					},
-					fail: () => {
-						this.$queue.showToast('登录失败,请稍后重试或更换其他登录方式')
-						uni.hideLoading()
-					}
-				})
-			},
+			// // 微信登录
+			// handleWxLogin() {
+			// 	uni.showLoading({
+			// 		title: '登录中'
+			// 	})
+			// 	uni.login({
+			// 		provider: 'weixin',
+			// 		success: (wxRes) => {
+			// 			this.$queue.setData('openId', wxRes.authResult.openid)
+			// 			this.$queue.setData('unionId', wxRes.authResult.unionId)
+			// 			let data = {
+			// 				wxOpenId: loginRes.authResult.openid,
+			// 				token: loginRes.authResult.access_token
+			// 			}
+			// 			this.$Request
+			// 				.postT('/app/Login/wxAppLogin', data)
+			// 				.then(res => {
+			// 					this.loginFinished(res)
+			// 					uni.hideLoading()
+			// 				})
+			// 				.catch(() => {
+			// 					this.$queue.showToast('登录失败,请稍后重试或更换其他登录方式')
+			// 					uni.hideLoading()
+			// 				})
+			// 		},
+			// 		fail: () => {
+			// 			this.$queue.showToast('登录失败,请稍后重试或更换其他登录方式')
+			// 			uni.hideLoading()
+			// 		}
+			// 	})
+			// },
 			// 一键登录
 			handlOneKeyLogin() {
 				jVerificationLogin((res) => {

+ 12 - 7
pages/talentSearch/index.vue

@@ -32,7 +32,7 @@
 
 					<!-- 筛选 -->
 					<view class="qySx-sx-box-filter flex align-center">
-						<text style="margin-right: 10rpx;" @click="goNav('/package/screen/screen?type=2')">筛选</text>
+						<text style="margin-right: 10rpx;" @click="goNav('/package/screen/screen?type=1')">筛选</text>
 						<u-icon name="arrow-down" color="#999999" size="16"
 							@click="goNav('/package/screen/screen?type=2')"></u-icon>
 					</view>
@@ -54,7 +54,7 @@
 
 		<!-- 人才列表 -->
 		<!-- <view class="talent-list" :style="{ marginTop: talentListMarginTop }"> -->
-			<view class="talent-list">
+			<view class="talent-list" :style="{ paddingTop: (124 + statusBarHeight) + 'px' }">
 			<view class="talent-card" v-for="(talent, index) in talentList" :key="index"
 				@click="goToResumeDetail(talent)">
 				<view class="talent-content">
@@ -223,8 +223,8 @@
 				this.city = ''
 			}
 			//获取选中的筛选条件
-			if (uni.getStorageSync('filter') && (uni.getStorageSync('filter')).length > 0) {
-				let filter = uni.getStorageSync('filter')
+			if (uni.getStorageSync('filterSearch') && (uni.getStorageSync('filterSearch')).length > 0) {
+				let filter = uni.getStorageSync('filterSearch')
 				this.education = '' //学历
 				this.experience = '' //经验
 				this.industry = '' //行业
@@ -657,7 +657,12 @@
 		background-color: #f5f5f5;
 	}
 
-	.topbg-sticky {
+	.topbg-sticky {
+		position: fixed;
+		left: 0;
+		top: 0;
+		right: 0;
+		z-index: 10;
 		display: flex;
 		    flex-direction: column;
 		    justify-content: space-around;
@@ -1036,8 +1041,8 @@
 	.talent-list {
 		// margin-top: 280rpx; // 已改为动态计算,在模板中通过 :style 设置
 		padding: 20rpx;
-		z-index: 100;
-		position: relative;
+		// z-index: 100;
+		// position: relative;
 		//border:1px solid red
 	}