lyuis hai 7 meses
pai
achega
699a00915f

+ 4 - 0
App.vue

@@ -584,4 +584,8 @@ page {
 .m-ellipsis-l3 {
   -webkit-line-clamp: 3;
 }
+.popup-content .popup-text-permission{
+	padding: 100rpx;
+	color: #343546;
+}
 </style>

+ 32 - 13
common/queue.js

@@ -470,7 +470,7 @@ module.exports = {
 	//APP获取手机权限鉴权
 	// APP获取手机权限鉴权(优化版,兼容全权限+多系统)
 	
-	async checkPermission(permission, tip, that) {
+	async checkPermission(permission, tip, that,perpop='permission') {
 	    // 权限映射配置
 	    let permisionID = '';
 	    let permisionIosID = '';
@@ -496,7 +496,20 @@ module.exports = {
 	
 	        // 特殊处理:相机权限在非iOS平台显示自定义弹窗
 	        if (uni.getSystemInfoSync().platform != 'ios') {
-	            that.$refs.permission.open();
+				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 平台处理
@@ -509,23 +522,29 @@ module.exports = {
 	            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("已获得授权");
-	                    that.$refs.permission?.close();
 	                    resolve(true);
 	                } else if (result == 0) {
 	                    console.log("未获得授权");
-	                    that.$refs.permission?.close();
 	                    resolve(false);
 	                } else {
-	                    console.log("被永久拒绝");
-	                    if (uni.getSystemInfoSync().platform != 'ios') {
-	                        that.$refs.permission?.close();
-	                    }
-	                    
+	                    console.log("权限被拒绝");
 	                    // 显示确认对话框
-	                    this.appConfirm("权限被永久拒绝," + tip, function(res) {
+	                    this.appConfirm("权限被拒绝," + tip, function(res) {
 	                        if (res) {
 	                            uni.openAppAuthorizeSetting();
 	                        }
@@ -557,9 +576,9 @@ module.exports = {
 	                    console.log(`未获得 ${currentPermission} 授权`);
 	                    
 	                    // 特殊处理相机和相册权限
-	                    if (currentPermission == 'camera' || currentPermission == 'photoLibrary') {
+	                    /* if (currentPermission == 'camera' || currentPermission == 'photoLibrary') {
 	                        that.$refs.camera?.open();
-	                    }
+	                    } */
 	                } else {
 	                    console.log(`已获得 ${currentPermission} 授权`);
 	                }

+ 1 - 1
package/jobIntention/basicInfo.vue

@@ -109,7 +109,7 @@
 		<!-- 权限说明弹窗 -->
 		<u-popup mode="top" ref="permission">
 			<view class="popup-content">
-				<view class="popup-text" :style="{ paddingTop: 30 + BarHeight + 'px' }">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
+				<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
 			</view>
 		</u-popup>
 	</view>

+ 7 - 1
package/jobIntention/city.vue

@@ -54,6 +54,11 @@
 				{{ item.toUpperCase() }}
 			</view>
 		</view>
+		<u-popup mode="top" ref="permission">
+			<view class="popup-content">
+				<view class="popup-text-permission">获取位置需要定位权限,用于推荐同城的求职岗位或牛人</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -133,7 +138,8 @@
 				// #ifdef APP
 				  const hasPermission = await this.$queue.checkPermission(
 				    'location', // 固定传 'location',双端通用
-				    '获取您的位置用于推荐附近的求职岗位' // 提示文案也无需区分系统(统一表述即可)
+				    '获取您的位置用于推荐附近的求职岗位', // 提示文案也无需区分系统(统一表述即可)
+					this
 				  );
 				
 				  if (!hasPermission) {

+ 34 - 15
package/search/search.vue

@@ -69,8 +69,8 @@
 							</view>
 						</view>
 						<view class="topbg-sx-box-r flex align-center">
-							<view class="city-container" @click="goNav('/package/screen/city?city='+city+'&county='+county)">
-								<text class="city-text" style="margin-right: 10rpx;">{{county?county:city}}</text>
+							<view class="city-container" @click="selectCity">
+								<text class="city-text" style="margin-right: 10rpx;">{{county?county:(city?city:'选择城市')}}</text>
 								<u-icon name="arrow-down" color="#999999" size="20"></u-icon>
 							</view>
 
@@ -240,6 +240,11 @@
 				</view>
 			</view>
 		</view>
+		<u-popup mode="top" ref="permission">
+			<view class="popup-content">
+				<view class="popup-text-permission">获取位置需要定位权限,用于推荐同城的求职岗位或牛人</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -321,19 +326,7 @@
 				that.getUserList();
 			})
 			this.token = uni.getStorageSync('token');
-			//获取经纬度后请求岗位接口,经纬度用于筛选距离
-			uni.getLocation({
-				type: 'wgs84', //wgs84  gcj02
-				success: function(res) {
-					console.log(res, '地理位置');
-					that.latitude = res.latitude;
-					that.longitude = res.longitude;
-					// that.getUserList();
-				},
-				fail: function() {
-					console.log('获取地址失败');
-				}
-			})
+			
 			this.getMyRecordList()
 			this.getHotList()
 			
@@ -391,6 +384,32 @@
 					},
 				});
 			},
+			async selectCity(){
+				//获取经纬度后请求岗位接口,经纬度用于筛选距离
+				var that=this
+				// #ifdef APP
+				const hasLocation = await this.$queue.checkPermission(
+					'location',
+					'获取位置需要定位权限,用于推荐同城的求职岗位或牛人',
+					this
+				);
+				if (!hasLocation) return that.goNav('/package/screen/city?city='+that.city+'&county='+that.county);
+				// #endif
+				uni.getLocation({
+					type: 'wgs84', //wgs84  gcj02
+					success: function(res) {
+						console.log(res, '地理位置');
+						that.latitude = res.latitude;
+						that.longitude = res.longitude;
+						// that.getUserList();
+						that.goNav('/package/screen/city?city='+that.city+'&county='+that.county)
+					},
+					fail: function() {
+						console.log('获取地址失败');
+						that.goNav('/package/screen/city?city='+that.city+'&county='+that.county)
+					}
+				})
+			},
 			/**
 			 * 返回上一页
 			 */

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

@@ -66,7 +66,7 @@
 
             <view class="topbg-sx-box-r flex align-center">
               <!-- 城市 -->
-              <view class="topbg-sx-box-r-i flex align-center" style="" @click="goNav('/package/screen/city?city='+city+'&county='+county+'&type='+'search')">
+              <view class="topbg-sx-box-r-i flex align-center" style="" @click="getLocation">
                 <text style="margin-right: 10rpx">{{county?county:city?city:'选择城市'}}</text>
                 <u-icon
                   name="arrow-down"
@@ -262,6 +262,11 @@
         </view>
       </view>
     </view>
+	<u-popup mode="top" ref="permission">
+		<view class="popup-content">
+			<view class="popup-text-permission">获取位置需要定位权限,用于推荐同城的求职岗位或牛人</view>
+		</view>
+	</u-popup>
   </view>
 </template>
 
@@ -362,7 +367,7 @@ export default {
 	this.industry = condition.industry //行业
 	this.salaryRange = condition.salaryRange //薪资
 	this.companyPeople = condition.companyPeople //公司规模
-    this.getLocation();
+	this.getTypeList();
   },
   onUnload(){
 	  uni.$off('filterCity');
@@ -500,12 +505,12 @@ export default {
 	  // #ifdef APP
 	  const hasPermission = await this.$queue.checkPermission(
 	    'location', // 固定传 'location',双端通用
-	    '获取您的位置用于推荐附近的求职岗位' // 提示文案也无需区分系统(统一表述即可)
+	    '获取您的位置用于推荐附近的求职岗位或牛人', // 提示文案也无需区分系统(统一表述即可)
+		this
 	  );
 	  				
 	  if (!hasPermission) {
-	    uni.showToast({ title: '未获取定位权限,无法推荐附近岗位', icon: 'none' });
-	    return;
+	    return that.goNav('/package/screen/city?city='+that.city+'&county='+that.county);
 	  }
 	  // #endif
 	  
@@ -516,9 +521,11 @@ export default {
           that.latitude = res.latitude;
           that.longitude = res.longitude;
           that.getSelectCity(res.longitude,res.latitude)
+		  that.goNav('/package/screen/city?city='+that.city+'&county='+that.county+'&type='+'search')
         },
         fail: function () {
 			that.getTypeList();
+			that.goNav('/package/screen/city?city='+that.city+'&county='+that.county+'&type='+'search')
         },
       });
     },

+ 11 - 11
pages/index/index.vue

@@ -435,6 +435,11 @@
 			<image style="width: 88rpx;height: 88rpx;border-radius: 50%;" src="../../static/images/up.jpg" mode="">
 			</image>
 		</view>
+		<u-popup mode="top" ref="permission">
+			<view class="popup-content">
+				<view class="popup-text-permission">获取位置需要定位权限,用于推荐同城的求职岗位或牛人</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -846,7 +851,7 @@
 			} else {
 				this.city = ''
 			}
-			if (this.city) {
+			if (this.city||true) {
 				if (this.userType == 1) {
 					if (this.current != this.typeList.length - 1) {
 						this.getPostType();
@@ -874,20 +879,15 @@
 			// 
 			async getLocalJobs() {
 				// #ifdef APP
+				let that = this;
 				const hasLocation = await this.$queue.checkPermission(
 					'location',
-					'获取位置需要定位权限,用于推荐同城的求职岗位'
+					'获取位置需要定位权限,用于推荐同城的求职岗位或牛人',
+					this
 				);
-				if (!hasLocation) return;
+				if (!hasLocation) return that.goNav('/package/screen/city?city='+that.city+'&county='+that.county);
 				// #endif
-				let that = this;
-				if(!uni.getStorageSync('city') || uni.getStorageSync('city') == '' || uni.getStorageSync('city') == null)
-					this.$queue.appConfirm('获取您的位置信息是为了方便筛选适合您所在城市的岗位或牛人',function(res){
-						if(res)
-						 that.getCity()
-					})
-				else
-					that.getCity()
+				that.getCity()
 			},
 			
 			getCity(){

+ 50 - 17
pages/msg/im.vue

@@ -866,6 +866,24 @@
 		<u-popup v-model="attachmentShow" z-index="99999" mode="bottom" border-radius="14" height="auto" :closeable="true">
 			<attachment @select="selectAttachment" :content="attachmentContent"></attachment>
 		</u-popup>
+		
+		<u-popup mode="top" ref="permission">
+			<view class="popup-content">
+				<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于发送媒体消息</view>
+			</view>
+		</u-popup>
+		
+		<u-popup mode="top" ref="microphonePermission">
+			<view class="popup-content">
+				<view class="popup-text-permission">录制语音需要录音权限,用于发送语音消息</view>
+			</view>
+		</u-popup>
+		
+		<u-popup mode="top" ref="locationPermission">
+			<view class="popup-content">
+				<view class="popup-text-permission">获取位置需要定位权限,用于发送位置消息</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -1111,7 +1129,7 @@
 				uni.hideLoading();
 			});
 			// #ifdef APP
-				this.getAudioPermision()
+				//this.getAudioPermision()
 			// #endif
 		},
 		onShow() {
@@ -1367,8 +1385,16 @@
 					}
 				});
 			},
-			goMapss() {
+			async goMapss() {
 				let that = this
+				// #ifdef APP
+				const hasLocation = await this.$queue.checkPermission(
+					'location',
+					'获取位置需要定位权限,用于发送位置消息',
+					this,'locationPermission'
+				);
+				if (!hasLocation) return;
+				// #endif
 				uni.chooseLocation({
 					success: function(res) {
 						console.log('位置名称:' + res.name);
@@ -2198,7 +2224,20 @@
 				});
 			},
 			// 录音开始
-			voiceBegin(e) {
+			async voiceBegin(e) {
+				let that = this
+				// 1. 先判断系统类型,区分Android/iOS权限
+							const hasPermission = await this.$queue.checkPermission(
+								'microphone',
+								'选择/拍摄照片需要相机/相册权限,用于发送图片消息',
+								this,
+								'microphonePermission'
+							);
+							
+							// 2. 如果未授权或者用户拒绝,显示提示
+							if (!hasPermission) {
+								return;
+							}
 				if (e.touches.length > 1) {
 					return;
 				}
@@ -2640,24 +2679,18 @@
 
 			},
 			//发送图片
-			chooseImage(sourceType) {
+			async 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 专属提示
-								: '选择/拍摄照片需要相机/相册权限,用于上传消息沟通图片'
+							const hasPermission = await this.$queue.checkPermission(
+								'camera',
+								'选择/拍摄照片需要相机/相册权限,用于发送图片消息',
+								this
 							);
-				
+							
+							// 2. 如果未授权或者用户拒绝,显示提示
 							if (!hasPermission) {
-							  uni.showToast({ title: '未获取权限,无法选择照片', icon: 'none' });
-							  return;
+								return;
 							}
 				
 				

+ 1 - 1
pages/my/index.vue

@@ -362,7 +362,7 @@
 							<view class="info-box-header flex align-center" @click="goNav('/my/renzheng/editCompany')">
 								<view class="info-box-header-l">
 									<image :src="avatar ? avatar : '../../static/logo.png'"
-										@click="goNav('/pages/my/userinfo')" mode=""></image>
+										@click.stop="goNav('/pages/my/userinfo')" mode=""></image>
 								</view>
 								<view class="info-box-header-r">
 									<view class="info-box-header-r-name flex align-center">

+ 18 - 24
pages/my/userinfo.vue

@@ -128,6 +128,12 @@
 		<view class="footer-btn">
 			<view class="usermain-btn" @click="messagebtn()">保存</view>
 		</view>
+		<!-- 权限说明弹窗 -->
+		<u-popup mode="top" ref="permission">
+			<view class="popup-content">
+				<view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -230,7 +236,7 @@
 					url: '../jifen/myaddress'
 				});
 			},
-			uploadImg() {
+			async uploadImg() {
 				let token = uni.getStorageSync('token')
 
 				if (!token) {
@@ -238,34 +244,12 @@
 					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({
 					// itemList按钮的文字接受的是数组
 					itemList: ["查看头像", "从相册选择图片"],
-					success(e) {
+					async success(e) {
 						var index = e.tapIndex
 						if (index === 0) {
 							// 用户点击了预览当前图片
@@ -278,6 +262,16 @@
 								urls: arr
 							})
 						} else if (index === 1) {
+							const hasPermission = await that.$queue.checkPermission(
+								'camera',
+								'选择/拍摄照片需要相机/相册权限,用于上传用户头像',
+								that
+							);
+							
+							// 2. 如果未授权或者用户拒绝,显示提示
+							if (!hasPermission) {
+								return;
+							}
 							uni.chooseImage({
 								count: 1, //默认9
 								sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有

+ 4 - 1
pages/public/login.vue

@@ -45,7 +45,7 @@
         手机号登录
       </button> -->
 			<!-- #ifdef APP -->
-			<view class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="wxAppLogin">
+			<view v-if="isAndroid" class="login-btn wechat" :class="{ disabled: !checked }" :disabled="checked" @click="wxAppLogin">
 				<image src="@/static/images/jobApplicant/wx.svg" mode="scaleToFill" />微信登录
 			</view>
 			<!-- #endif -->
@@ -99,12 +99,15 @@
 				sessionkey: "",
 				phoneNum: false,
 				isopen: false,
+				isAndroid:false,
 			};
 		},
 		onLoad(e) {
 			if (e.inviterCode) {
 				this.$queue.setData("inviterCode", e.inviterCode);
 			}
+			console.log(uni.getSystemInfoSync());
+			this.isAndroid=uni.getSystemInfoSync().platform=='android'
 			this.sessionkey = uni.getStorageSync("sessionkey");
 			this.weixinPhone = uni.getStorageSync("weixinPhone");
 			console.log(this.weixinPhone);