zhengkaixin 1 год назад
Родитель
Сommit
34cdf4acb2

+ 3 - 2
config/.env.dev.js

@@ -8,11 +8,12 @@ const UNI_APP = {
 	SIMPLE_RUN:false,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 
 	openId:"o_5WO4hc7MyyVNjSDePRIft6AokI",//个人企业都注册
-	//openId:"o_5WO4qUozermjNRBqypzMZg56Qw",// 杨所199
+	openId:"o_5WO4qUozermjNRBqypzMZg56Qw",// 杨所199
 	//openId:"o_5WO4tDGT3bJ-9Bpdizcdbs-HbI", //152
 	//openId:"o_5WO4m3IkzHIQ7u4m5itak6juyE",// 客户
 	//openId:"323",// 个人  未注册 ,企业 注册
-	 
+	//openId:"o_5WO4hc7MyyVNjSDePRIft6AokI",
+	// openId:"o_5WO4nW4ykyd1M5NHI55c87pjks",
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	VUE_APP_WXAPPID:"wx1052afafacae1c63",

+ 49 - 5
pages/main/index/index.vue

@@ -148,9 +148,9 @@
 			<u-divider style="margin-top: 10px;" :isnone="showList.length==0" nonetext="没有找到相关内容"
 				@click="gotoUrl('pages/tab/jobInformation/jobInformation')" border-color="#CFD2D5">查看更多</u-divider>
 		</view>
-
+		
 		<tabbar :current="0"></tabbar>
-
+		
 	</view>
 
 
@@ -216,7 +216,7 @@
 					list: [],
 					recordsTotal: 0
 				}],
-
+				cameraShow:false,
 				current: 0,
 				homeList: [],
 
@@ -230,7 +230,8 @@
 
 			//this.getBannerList()
 			this.getNewsInfo()
-			this.findByOpenId(op);
+			this.findByOpenId(op);
+			this.authorize();
 		},
 		computed: {
 			showRecordsTotal() {
@@ -245,7 +246,50 @@
 				url: "/pages/tab/jobInformation/jobInformation"
 			})
 		},
-		methods: {
+		methods: {
+			authorize2(){
+				wx.authorize({
+					scope:'scope.camera',
+					success:()=> {
+						uni.showToast({
+							title:"授权成功"
+						})
+						this.cameraShow=true;
+					},
+					fail(res){
+						console.log(res)
+						//authorize:fail auth deny  关闭了
+
+						//if(res.errMsg=="authorize:fail privacy permission is not authorized"){
+							// uni.showModal({
+							// 	showCancel:false,
+							// 	content:"授权失败,可点击'右上角...'-'设置'-'摄像头'授权",
+							// 	title:"提示",
+							// })
+							// uni.showToast({
+							// 	title:"授权成功"
+							// })
+						//}
+					},
+					complete:()=> {
+						//this.authorize()
+					}
+				})
+			},
+			authorize(){
+				wx.getSetting({
+					success:(settingRes)=> {
+						
+						if(!settingRes.authSetting['scope.camera']){
+							this.authorize2()
+						}else{
+							
+						}
+					},fail(res){
+						console.log(res)
+					}
+				})
+			},
 			getNewsInfo() {
 
 				API_weixin.bannerList({

+ 2 - 0
pages/packages/as-components/limeClipper/limeClipper.vue

@@ -669,6 +669,8 @@ export default {
 			this.moveStop();
 		},
 		uploadImage() {
+			
+			
 			const itemList = Object.entries(this.source)
 			const sizeType = ['original', 'compressed']
 			const success = ({tempFilePaths:a, tempFiles: b}) => {

+ 50 - 0
pages/packages/mine/otherServices/authentication.vue

@@ -178,6 +178,9 @@
 						<u-upload v-else ref="uUpload" :action="action" name="photoFile" :file-list="listPic"
 							:form-data="formData" :header="header" width="686" max-count="1" @on-success="onSuccess">
 						</u-upload>
+						<view v-show="!showPrivacy">点击<span style="color: #4496f8;">“+ 选择图片”</span> <span style="color: red;">无反应</span>可尝试点击<span style="color: #4496f8;">“右上角...”</span> -> <span style="color: #4496f8;">“重新进入小程序”</span></view>
+						<view v-show="showPrivacy" @click="authorize2" >如果<span style="color: #4496f8;">“+ 选择图片”</span>无反应, 则需要授权摄像头,点击授权 </view>
+						
 					</view>
 					
 				</view>
@@ -318,6 +321,7 @@
 				formData: {},
 				newsList:[],
 				valueradio:'',
+				showPrivacy:false,
 			}
 		},
 		onLoad() {
@@ -335,7 +339,53 @@
 			this.getFindByOpenId();
 			this.getNewsInfo()
 		},
+		onShow(){
+			this.authorize()
+			
+		},
 		methods: {
+			authorize2(){
+				
+				uni.authorize({
+					scope:'scope.camera',
+					success() {
+						uni.showToast({
+							title:"授权成功"
+						})
+					},
+					fail(res){
+						console.log(res)
+					
+						if(res.errMsg=="authorize:fail auth deny"||res.errMsg=="authorize:fail:auth deny"){
+							
+						}
+						uni.showModal({
+							showCancel:false,
+							content:"授权失败,可点击'右上角...'-'设置'-'摄像头'授权",
+							title:"提示",
+						})
+						
+					},
+					complete:()=> {
+						this.authorize()
+					}
+				})
+			},
+			authorize(bl){
+				uni.getSetting({
+					success:(settingRes)=> {
+						
+						if(!settingRes.authSetting['scope.camera']){
+							 this.showPrivacy=true
+							
+						}else{
+							 this.showPrivacy=false
+						}
+					},fail(res){
+						console.log(res)
+					}
+				})
+			},
 			gotoInfo(item){
 				
 			},

+ 72 - 5
pages/tab/mine/mine.vue

@@ -158,6 +158,16 @@
 						<view class="grid-text">联系客服</view>
 					</button>
 				</u-grid-item>
+				
+				<u-grid-item v-show="showPrivacy" @click="authorize2" >
+					<button class="btncontact"  open-type="agreePrivacyAuthorization">
+						<view class="icon">
+							
+							<img src="@/assets/img/riLine-logout-box-r-line@1x.png" alt="">
+						</view>
+						<view class="grid-text">授权</view>
+					</button>
+				</u-grid-item>
 				
 				<!-- <u-grid-item>
 			 			<view class="icon">
@@ -176,8 +186,10 @@
 					登录荆州经开区共享用工平台
 				</view>
 				<view>
-					<button class="login-btn" @click="decryptPhoneNumberH5" open-type="getPhoneNumber"
-						@getphonenumber="decryptPhoneNumber">
+					<button class="login-btn" @click="decryptPhoneNumberH5" open-type="getPhoneNumber|agreePrivacyAuthorization"
+						@getphonenumber="decryptPhoneNumber"
+						bindagreeprivacyauthorization="handleAgreePrivacyAuthorization"
+						>
 						<u-icon name="phone-fill" size="46"></u-icon> <text>手机号码一键登录</text>
 					</button>
 
@@ -229,6 +241,7 @@
 				updateintention:false,
 				bannerlist: [
 				],
+				showPrivacy:false,
 				intentionList:[
 					{
 											value: '1',
@@ -245,15 +258,68 @@
 		onLoad() {
 			this.userInfo = this.carhelp.getPersonInfo()
 			this.findByOpenId();
-			this.getNewsInfo()
+			this.getNewsInfo()
+			
+			
+			this.authorize(true)
+			
+			 
+			
 		},
 		onShow(){
+			this.authorize()
 			if(this.isReady){
 				this.findByOpenId();
 				
 			}
 		},
 		methods: {
+			authorize2(){
+				
+				uni.authorize({
+					scope:'scope.camera',
+					success() {
+						uni.showToast({
+							title:"授权成功"
+						})
+					},
+					fail(res){
+						console.log(res)
+					
+						if(res.errMsg=="authorize:fail auth deny"||res.errMsg=="authorize:fail:auth deny"){
+							
+						}
+						uni.showModal({
+							showCancel:false,
+							content:"授权失败,可点击'右上角...'-'设置'-'摄像头'授权",
+							title:"提示",
+						})
+						
+					},
+					complete:()=> {
+						this.authorize()
+					}
+				})
+			},
+			authorize(bl){
+				uni.getSetting({
+					success:(settingRes)=> {
+						
+						if(!settingRes.authSetting['scope.camera']){
+							 this.showPrivacy=true
+							
+						}else{
+							 this.showPrivacy=false
+						}
+					},fail(res){
+						console.log(res)
+					}
+				})
+			},
+			handleAgreePrivacyAuthorization(){
+				
+			},
+			
 			getNewsInfo(){
 				
 				API_weixin.bannerList({
@@ -446,7 +512,8 @@
 				API_weixin.findByOpenId({
 					openId: this.carhelp.getOpenId(),
 					noerror: true
-				}).then((res) => {
+				}).then((res) => {
+					
 					this.isReady=true;
 					this.carhelp.setPersonInfo(res.data.regUser);
 					this.carhelp.setToken(res.data.token);
@@ -474,7 +541,7 @@
 					if (this.ck2()) {
 						this.getNum2()
 					}
-
+					
 				}).catch(error => {
 					//.log("11111")
 					this.carhelp.logoff();