lyuis vor 7 Monaten
Ursprung
Commit
d9200631a9
4 geänderte Dateien mit 64 neuen und 74 gelöschten Zeilen
  1. 18 18
      my/renzheng/index.vue
  2. 17 18
      my/setting/chat.vue
  3. 18 18
      package/jobIntention/completeMsg.vue
  4. 11 20
      pages/my/jobApplicant/workRecord.vue

+ 18 - 18
my/renzheng/index.vue

@@ -271,6 +271,12 @@
       label-name="value"
       @confirm="comConfirm"
     ></u-select>
+	<!-- 权限说明弹窗 -->
+			<u-popup mode="top" ref="permission">
+				<view class="popup-content">
+					<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
+				</view>
+			</u-popup>
   </view>
 </template>
 
@@ -591,26 +597,20 @@ export default {
       }
     },
 
-    addImage(e) {
+    async 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;
-	  }
+	  // 1. 检查权限状态
+	  				const hasPermission = await this.$queue.checkPermission(
+	  					'camera',
+	  					'选择/拍摄照片需要相机/相册权限,用于上传用户头像',
+	  					this
+	  				);
+	  
+	  				// 2. 如果未授权或者用户拒绝,显示提示
+	  				if (!hasPermission) {
+	  					return;
+	  				}
 	  
 	  
       uni.chooseImage({

+ 17 - 18
my/setting/chat.vue

@@ -132,6 +132,12 @@
 				<view class="save" @tap='setChatSave(1)'>发送</view>
 			</view>
 		</view>
+		<!-- 权限说明弹窗 -->
+				<u-popup mode="top" ref="permission">
+					<view class="popup-content">
+						<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
+					</view>
+				</u-popup>
 	</view>
 </template>
 
@@ -527,25 +533,18 @@
 				this.content = '';
 			},
 			//发送图片
-			chooseImage(sourceType) {
+			async chooseImage(sourceType) {
+				// 1. 检查权限状态
+								const hasPermission = await this.$queue.checkPermission(
+									'camera',
+									'选择/拍摄照片需要相机/相册权限,用于上传用户头像',
+									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;
-				}
+								// 2. 如果未授权或者用户拒绝,显示提示
+								if (!hasPermission) {
+									return;
+								}
 				
 				uni.chooseImage({
 					count: 1,

+ 18 - 18
package/jobIntention/completeMsg.vue

@@ -52,6 +52,12 @@
 			</view>
 			<view class="bottom-btn" @click="submithr">开始招聘</view>
 		</view>
+		<!-- 权限说明弹窗 -->
+				<u-popup mode="top" ref="permission">
+					<view class="popup-content">
+						<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
+					</view>
+				</u-popup>
 	</view>
 </template>
 <script>
@@ -93,26 +99,20 @@ export default {
 
 		},
 		// 选择头像
-		chooseAvatar() {
+		async 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;
-			}
+			/// 1. 检查权限状态
+				const hasPermission = await this.$queue.checkPermission(
+					'camera',
+					'选择/拍摄照片需要相机/相册权限,用于上传用户头像',
+					this
+				);
+
+				// 2. 如果未授权或者用户拒绝,显示提示
+				if (!hasPermission) {
+					return;
+				}
 
 
 			uni.chooseImage({

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

@@ -403,28 +403,19 @@ export default {
 		uni.navigateTo({ url: '/pages/my/educationExperience' })
 	},
     // 选择头像
-    chooseAvatar() {
+    async chooseAvatar() {
 		var that=this
+		// 1. 检查权限状态
+		const hasPermission = await this.$queue.checkPermission(
+			'camera',
+			'选择/拍摄照片需要相机/相册权限,用于上传用户头像',
+			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;
-									}
-		
-		
+		// 2. 如果未授权或者用户拒绝,显示提示
+		if (!hasPermission) {
+			return;
+		}
       uni.chooseImage({
         count: 1,
         sizeType: ["compressed"],