xxdezh 7 mēneši atpakaļ
vecāks
revīzija
499c3cc7d8

+ 1 - 1
.hbuilderx/launch.json

@@ -2,7 +2,7 @@
     "version" : "1.0",
     "configurations" : [
         {
-            "customPlaygroundType" : "local",
+            "customPlaygroundType" : "device",
             "playground" : "standard",
             "type" : "uni-app:app-android"
         }

+ 1 - 1
common/config.js

@@ -4,7 +4,7 @@ let mobile=0;
 // #ifdef APP-PLUS
 mobile=1
 //#endif
-if (process.env.NODE_ENV !== 'development'||mobile) {
+if (process.env.NODE_ENV !== 'development'||mobile || true) {
 	//正式环境
 	const ROOTPATH = "http://www.bosszan.com/sqx_fast";
 	const ROOTPATH1 = "http://www.bosszan.com/sqx_fast";

+ 41 - 0
common/queue.js

@@ -463,4 +463,45 @@ module.exports = {
 				}
 				return condition
 			},
+			//APP获取手机权限鉴权
+			checkPermission:function(permission, tip) {
+			  return new Promise((resolve) => {
+			    const permisionObj = uni.getAppAuthorizeSetting();
+			    permisionObj.getSetting({
+			      success: (res) => {
+			        const authStatus = res.authSetting[permission];
+			        if (authStatus === true) {
+			          resolve(true);
+			        } else if (authStatus === false) {
+			          // 已拒绝权限,引导去设置页
+			          uni.showModal({
+			            title: '权限不足',
+			            content: `${tip},请前往设置开启权限`,
+			            confirmText: '去设置',
+			            cancelText: '取消',
+			            success: (modalRes) => {
+			              if (modalRes.confirm) {
+			                permisionObj.openAppAuthorizeSetting({
+			                  success: () => resolve(false),
+			                  fail: () => resolve(false)
+			                });
+			              } else {
+			                resolve(false);
+			              }
+			            }
+			          });
+			        } else {
+			          // 未授权过,发起授权请求
+			          permisionObj.authorize({
+			            scope: permission,
+			            success: () => resolve(true),
+			            fail: () => resolve(false)
+			          });
+			        }
+			      },
+			      fail: () => resolve(false)
+			    });
+			  });
+			},
+			
 };

+ 15 - 4
manifest.json

@@ -24,8 +24,8 @@
             "OAuth" : {},
             "Maps" : {},
             "Push" : {},
-            "Camera" : {},
-            "Geolocation" : {}
+            "Geolocation" : {},
+            "Camera" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -61,7 +61,17 @@
             },
             /* ios打包配置 */
             "ios" : {
-                "dSYMs" : false
+                "dSYMs" : false,
+                "privacyDescription" : {
+                    "NSPhotoLibraryUsageDescription" : "用于从相册选择简历头像、作品照片,完善个人资料",
+                    "NSPhotoLibraryAddUsageDescription" : "用于将编辑好的简历资料、岗位信息保存到相册,方便您查看与分享",
+                    "NSMicrophoneUsageDescription" : "用于录制语音介绍,补充简历的个人展示内容",
+                    "NSLocationWhenInUseUsageDescription" : "用于获取您的当前位置,推荐同城的求职岗位与招聘信息",
+                    "NSCameraUsageDescription" : "于拍摄简历头像、作品照片,完成个人资料的编辑与上传",
+                    "NSContactsUsageDescription" : "用于导入通讯录中的求职联系人,快速分享招聘信息",
+                    "NSCalendarsUsageDescription" : "用于同步面试时间到日历,提醒您及时参加面试",
+                    "NSLocationAlwaysAndWhenInUseUsageDescription" : "用于获取您的当前位置,推荐同城的求职岗位与招聘信息"
+                }
             },
             /* SDK配置 */
             "sdkConfigs" : {
@@ -228,5 +238,6 @@
                 }
             }
         }
-    }
+    },
+    "locale" : "zh-Hans"
 }

+ 17 - 6
my/components/jc-record/jc-record.vue

@@ -73,12 +73,7 @@
 		onLoad() {
 			var _this = this;
 
-			//获取录音权限
-			uni.authorize({
-				scope: 'scope.record',
-				success() {}
-			})
-
+		
 			//初始化
 			_this.initValue();
 
@@ -133,6 +128,22 @@
 			},
 			//点击确定
 			okClick() {
+				const hasPermission = await this.checkPermission(
+				    'microphone', // 固定传值,双端通用
+				    '录制语音介绍需要麦克风权限,用于完善简历的个人展示内容' // 提示文案统一即可
+				  );
+				
+				  if (!hasPermission) {
+				    uni.showToast({ title: '未获取麦克风权限,无法录制语音', icon: 'none' });
+				    return;
+				  }
+				
+				
+				//获取录音权限
+				uni.authorize({
+					scope: 'scope.microphone',
+					success() {}
+				})
 				// var data = {},list = {},textStr = "",indexStr = "";								
 				this.$emit('okClick', this.voicePath)
 				this.$emit('start', 2)

+ 19 - 0
my/feedback/index.vue

@@ -80,6 +80,25 @@ export default {
       });
     },
     chooseImg() {
+		// // 1. 先判断系统类型,区分Android/iOS权限
+		// const systemInfo = uni.getSystemInfoSync();
+		// const isAndroid = systemInfo.system.includes('Android');
+		// const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+			  
+		// // 2. 权限检查(复用之前封装的 checkPermission 函数)
+		// const hasPermission = this.$queue.checkPermission(
+		//   permissionType,
+		//   isAndroid 
+		//     ? '选择/拍摄照片需要相机/相册权限,用于上传简历/求职资料' // Android 专属提示
+		//     : '选择/拍摄照片需要相机/相册权限,用于上传简历/求职资料'
+		// );
+			  
+		// if (!hasPermission) {
+		//   uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+		//   return;
+		// }
+		
+		
       //选择图片
       uni.chooseImage({
         sourceType: ["camera", "album"],

+ 18 - 0
my/feedback/jubao.vue

@@ -80,6 +80,24 @@
 			//上传图片
 			uploadImg() {
 				let that = this
+					    // 1. 先判断系统类型,区分Android/iOS权限
+					    const systemInfo = uni.getSystemInfoSync();
+					    const isAndroid = systemInfo.system.includes('Android');
+					    const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+					  
+					    // 2. 权限检查(复用之前封装的 checkPermission 函数)
+					    const hasPermission = this.$queue.checkPermission(
+					      permissionType,
+					      isAndroid 
+					        ? '选择/拍摄照片需要相机/相册权限,用于上传举报证据' // Android 专属提示
+					        : '选择/拍摄照片需要相机/相册权限,用于上传举报证据'
+					    );
+					  
+					    if (!hasPermission) {
+					      uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+					      return;
+					    }
+				
 				uni.chooseImage({
 					count: 1, //默认9
 					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有

+ 20 - 0
my/renzheng/companyImg.vue

@@ -110,6 +110,26 @@ export default {
       const that = this;
       const remainingCount = this.maxCount - this.imageList.length;
       
+	  
+	      // 1. 先判断系统类型,区分Android/iOS权限
+			const systemInfo = uni.getSystemInfoSync();
+			const isAndroid = systemInfo.system.includes('Android');
+			const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+		  
+			// 2. 权限检查(复用之前封装的 checkPermission 函数)
+			const hasPermission = this.$queue.checkPermission(
+			  permissionType,
+			  isAndroid 
+				? '选择/拍摄照片需要相机/相册权限,用于上传企业主页照片' // Android 专属提示
+				: '选择/拍摄照片需要相机/相册权限,用于上传企业主页照片'
+			);
+		  
+			if (!hasPermission) {
+			  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+			  return;
+			}
+	  
+	  
       uni.chooseImage({
         count: remainingCount, // 最多选择剩余数量
         sizeType: ["compressed"],

+ 23 - 1
my/renzheng/companyLogo.vue

@@ -90,8 +90,27 @@ export default {
   },
   methods: {
     // 选择图片
-    chooseImage() {
+    async chooseImage() {
       const that = this;
+	    // 1. 先判断系统类型,区分Android/iOS权限
+	    const systemInfo = uni.getSystemInfoSync();
+	    const isAndroid = systemInfo.system.includes('Android');
+	    const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+	  
+	    // 2. 权限检查(复用之前封装的 checkPermission 函数)
+	    const hasPermission = this.$queue.checkPermission(
+	      permissionType,
+	      isAndroid 
+	        ? '选择/拍摄照片需要相机/相册权限,用于上传企业logo/企业资料' // Android 专属提示
+	        : '选择/拍摄照片需要相机/相册权限,用于上传企业logo/企业资料'
+	    );
+	  
+	    if (!hasPermission) {
+	      uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+	      return;
+	    }
+	  
+	  
       uni.chooseImage({
         count: 1,
         sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
@@ -113,6 +132,9 @@ export default {
       });
     },
 
+
+
+
     // 验证并上传图片
     validateAndUploadImage(tempFilePath) {
       const that = this;

+ 20 - 0
my/renzheng/index.vue

@@ -593,6 +593,26 @@ export default {
 
     addImage(e) {
       let that = this;
+	  
+	  // 1. 先判断系统类型,区分Android/iOS权限
+	  const systemInfo = uni.getSystemInfoSync();
+	  const isAndroid = systemInfo.system.includes('Android');
+	  const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+	  	  
+	  // 2. 权限检查(复用之前封装的 checkPermission 函数)
+	  const hasPermission = this.$queue.checkPermission(
+	    permissionType,
+	    isAndroid 
+	      ? '选择/拍摄照片需要相机/相册权限,用于上传企业营业执照/企业资料' // Android 专属提示
+	      : '选择/拍摄照片需要相机/相册权限,用于上传企业营业执照/企业资料'
+	  );
+	  	  
+	  if (!hasPermission) {
+	    uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+	    return;
+	  }
+	  
+	  
       uni.chooseImage({
         count: 1,
         sourceType: ["album", "camera"],

+ 19 - 0
my/setting/chat.vue

@@ -528,6 +528,25 @@
 			},
 			//发送图片
 			chooseImage(sourceType) {
+				
+				// 1. 先判断系统类型,区分Android/iOS权限
+				const systemInfo = uni.getSystemInfoSync();
+				const isAndroid = systemInfo.system.includes('Android');
+				const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+					  
+				// 2. 权限检查(复用之前封装的 checkPermission 函数)
+				const hasPermission = this.$queue.checkPermission(
+				  permissionType,
+				  isAndroid 
+				    ? '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片' // Android 专属提示
+				    : '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片'
+				);
+					  
+				if (!hasPermission) {
+				  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+				  return;
+				}
+				
 				uni.chooseImage({
 					count: 1,
 					sourceType: ['album', 'camera'],

+ 19 - 0
package/jobIntention/basicInfo.vue

@@ -193,6 +193,25 @@
 			// 选择头像
 			chooseAvatar() {
 				var that=this
+				
+					// 1. 先判断系统类型,区分Android/iOS权限
+								const systemInfo = uni.getSystemInfoSync();
+								const isAndroid = systemInfo.system.includes('Android');
+								const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+									  
+								// 2. 权限检查(复用之前封装的 checkPermission 函数)
+								const hasPermission = this.$queue.checkPermission(
+								  permissionType,
+								  isAndroid 
+								    ? '选择/拍摄照片需要相机/相册权限,用于上传用户头像' // Android 专属提示
+								    : '选择/拍摄照片需要相机/相册权限,用于上传消用户头像'
+								);
+									  
+								if (!hasPermission) {
+								  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+								  return;
+								}
+				
 			  uni.chooseImage({
 			    count: 1,
 			    sizeType: ["compressed"],

+ 13 - 1
package/jobIntention/city.vue

@@ -128,8 +128,20 @@
 			/**
 			 * 定位获取经纬度
 			 */
-			getLatOrLng() {
+			async getLatOrLng() {
 				let that = this;
+				  const hasPermission = await this.$queue.checkPermission(
+				    'location', // 固定传 'location',双端通用
+				    '获取您的位置用于推荐附近的求职岗位' // 提示文案也无需区分系统(统一表述即可)
+				  );
+				
+				  if (!hasPermission) {
+				    uni.showToast({ title: '未获取定位权限,无法推荐附近岗位', icon: 'none' });
+				    return;
+				  }
+				
+				
+				
 				uni.getLocation({
 					type: "wgs84", //wgs84  gcj02
 					success: function(res) {

+ 20 - 0
package/jobIntention/completeMsg.vue

@@ -83,6 +83,26 @@
 			// 选择头像
 			chooseAvatar() {
 				var that = this
+				
+				// 1. 先判断系统类型,区分Android/iOS权限
+							const systemInfo = uni.getSystemInfoSync();
+							const isAndroid = systemInfo.system.includes('Android');
+							const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+								  
+							// 2. 权限检查(复用之前封装的 checkPermission 函数)
+							const hasPermission = this.$queue.checkPermission(
+							  permissionType,
+							  isAndroid 
+							    ? '选择/拍摄照片需要相机/相册权限,用于上传HR头像' // Android 专属提示
+							    : '选择/拍摄照片需要相机/相册权限,用于上传消HR头像'
+							);
+								  
+							if (!hasPermission) {
+							  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+							  return;
+							}
+				
+				
 				uni.chooseImage({
 					count: 1,
 					sizeType: ["compressed"],

+ 14 - 1
pages/index/game/gameList.vue

@@ -495,8 +495,21 @@ export default {
       }
     },
     // 获取位置信息
-    getLocation() {
+    async getLocation() {
       let that = this;
+	  
+	  const hasPermission = await this.$queue.checkPermission(
+	    'location', // 固定传 'location',双端通用
+	    '获取您的位置用于推荐附近的求职岗位' // 提示文案也无需区分系统(统一表述即可)
+	  );
+	  				
+	  if (!hasPermission) {
+	    uni.showToast({ title: '未获取定位权限,无法推荐附近岗位', icon: 'none' });
+	    return;
+	  }
+	  				
+	  
+	  
       uni.getLocation({
         type: "wgs84",
         success: function (res) {

+ 43 - 27
pages/index/index.vue

@@ -739,7 +739,8 @@
 				})
 				that.directionList = prefer
 			})
-			//获取经纬度后请求岗位接口,经纬度用于筛选距离
+	
+				  		
 			uni.getLocation({
 				type: 'wgs84', //wgs84  gcj02
 				success: function(res) {
@@ -1171,8 +1172,11 @@
 				this.$Request.get("/app/company/selectCompanyByUserId").then(res => {
 					if (res.code == 0 && res.data) {
 						this.companyStatus = res.data.status
+						this.companyId = res.data.companyId
 						this.companyName = res.data.companyAllName
 						uni.setStorageSync('companyStatus', this.companyStatus)
+						uni.setStorageSync('companyId', res.data.companyId)
+						this.companyId=this.companyId
 						if(this.companyStatus==1){
 							uni.showModal({
 								title: '提示',
@@ -1292,32 +1296,44 @@
 
 				}
 				this.$Request.postJson('/app/resumes/selectResumesList', data).then(res => {
-					uni.stopPullDownRefresh()
-					uni.hideLoading()
-					if (res.code == 0 && res.data) {
-						this.totalPage = res.data.totalPage
-						// res.data.list.map(item => {
-						// 	if (item.positionWelfare) {
-						// 		item.positionWelfare = item.positionWelfare.split(',')
-						// 	} else {
-						// 		item.positionWelfare = []
-						// 	}
-						// })
-
-						const list = res.data.records.map(item => {
-							// 若技能字段为其他名称(如 skillTags),需映射为 skills
-							item.skills = item.skillTags || '';
-							return item;
-						});
-						if (this.page == 1) {
-							this.datasList = list
-						} else {
-							this.datasList = [...this.datasList, ...list]
-						}
-						this.totlo = res.data.totalPage
-					} else {
-						this.datasList = []
-					}
+				  // 1. 停止下拉刷新和隐藏loading(无论请求结果如何都执行)
+				  uni.stopPullDownRefresh()
+				  uni.hideLoading()
+				
+				  // 2. 第一层校验:确保res、res.data、res.data.records都存在且为数组
+				  if (res.code == 0 && res.data && Array.isArray(res.data.records)) {
+				    this.totalPage = res.data.totalPage
+				    this.totlo = res.data.totalPage // 注意:变量名疑似笔误(totlo → totalPage?)
+				
+				    // 3. 处理列表:过滤null/undefined元素 + 安全访问skillTags
+				    const list = res.data.records
+				      .filter(item => item !== null && item !== undefined) // 过滤空元素
+				      .map(item => {
+				        // 安全赋值:item存在时才访问skillTags,否则赋值为空字符串
+				        item.skills = item?.skillTags || '';
+				        return item;
+				      });
+				
+				    // 4. 分页赋值(避免空数组覆盖)
+				    if (this.page == 1) {
+				      this.datasList = list
+				    } else {
+				      this.datasList = [...this.datasList, ...list]
+				    }
+				  } else {
+				    // 5. 异常情况:仅第一页清空列表,避免翻页时丢失数据
+				    if (this.page === 1) {
+				      this.datasList = []
+				    }
+				    // 可选:提示用户无数据
+				    // uni.showToast({ title: '暂无数据', icon: 'none' })
+				  }
+				}).catch(err => {
+				  // 6. 捕获请求异常(如网络错误、接口500)
+				  uni.stopPullDownRefresh()
+				  uni.hideLoading()
+				  uni.showToast({ title: '请求失败,请重试', icon: 'none' })
+				  console.error('简历列表请求失败:', err)
 				})
 			},
 			/**

+ 19 - 0
pages/msg/im.vue

@@ -2625,6 +2625,25 @@
 			//发送图片
 			chooseImage(sourceType) {
 				let that = this
+				// 1. 先判断系统类型,区分Android/iOS权限
+							const systemInfo = uni.getSystemInfoSync();
+							const isAndroid = systemInfo.system.includes('Android');
+							const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+				
+							// 2. 权限检查(复用之前封装的 checkPermission 函数)
+							const hasPermission = this.$queue.checkPermission(
+							  permissionType,
+							  isAndroid 
+								? '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片' // Android 专属提示
+								: '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片'
+							);
+				
+							if (!hasPermission) {
+							  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+							  return;
+							}
+				
+				
 				uni.chooseImage({
 					count: 1,
 					sourceType: ['album'],

+ 20 - 0
pages/my/jobApplicant/workRecord.vue

@@ -405,6 +405,26 @@ export default {
     // 选择头像
     chooseAvatar() {
 		var that=this
+		
+				// 1. 先判断系统类型,区分Android/iOS权限
+									const systemInfo = uni.getSystemInfoSync();
+									const isAndroid = systemInfo.system.includes('Android');
+									const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+						
+									// 2. 权限检查(复用之前封装的 checkPermission 函数)
+									const hasPermission = this.$queue.checkPermission(
+									  permissionType,
+									  isAndroid 
+										? '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片' // Android 专属提示
+										: '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片'
+									);
+						
+									if (!hasPermission) {
+									  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+									  return;
+									}
+		
+		
       uni.chooseImage({
         count: 1,
         sizeType: ["compressed"],

+ 19 - 0
pages/my/userinfo.vue

@@ -236,6 +236,25 @@
 					this.goLoginInfo();
 					return;
 				}
+				
+						// 1. 先判断系统类型,区分Android/iOS权限
+											const systemInfo = uni.getSystemInfoSync();
+											const isAndroid = systemInfo.system.includes('Android');
+											const permissionType = isAndroid ? 'storage' : 'photos'; // Android=存储,iOS=相册
+								
+											// 2. 权限检查(复用之前封装的 checkPermission 函数)
+											const hasPermission = this.$queue.checkPermission(
+											  permissionType,
+											  isAndroid 
+												? '选择/拍摄照片需要相机/相册权限,用于上传头像' // Android 专属提示
+												: '选择/拍摄照片需要相机/相册权限,用于上传头像'
+											);
+								
+											if (!hasPermission) {
+											  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
+											  return;
+											}
+				
 				let that = this;
 				var url = null;
 				uni.showActionSheet({