he2802 3 жил өмнө
parent
commit
ffdbe9da75

+ 15 - 16
pages2/class/detail.vue

@@ -129,7 +129,12 @@
 			</view>
 		</view>
 		<!-- 播放前拍照end -->
-		<button open-type="openSetting" @bindopensetting="openSetting" class="btnSet">设置授权</button>
+		<u-popup v-model="showSet" :mask-close-able="false" mode="center">
+			<view style="width: 250rpx;height: 250rpx;display: flex;align-items:center">
+				<button open-type="openSetting" @bindopensetting="openSetting" class="btnSet">相机授权</button>
+			</view>
+		</u-popup>
+		
 		<u-mask :show="photoPopup" >
 		<!-- 播放前拍照start -->
 		<view v-if="photoPopup"  :mask-close-able="false" style="bottom: 0;position: fixed;width: 100%;z-index: 999;">
@@ -167,6 +172,7 @@ export default {
 	},
 	data() {
 		return {
+			showSet:false,
 			startStatus: false,
 			detail: {},
 			courseId: 0,
@@ -347,7 +353,7 @@ export default {
 			console.log(res,98)
 		},
 		getCameraSetting () {
-		    const _this = this
+		    const self = this
 		    wx.getSetting({
 		      success: res => {
 		        if (res.authSetting['scope.camera']) {
@@ -361,21 +367,12 @@ export default {
 		             
 		            },
 		            fail() { // 用户不同意授权
-		             
+		             self.showSet = true
 		              wx.showToast({
 		                title: '摄像头授权失败',
 		                icon: 'none',
 		                duration: 3000
 		              })
-					  console.log(232)
-					  wx.openSetting({
-					  success (res) {
-						if(res.authSetting['scope.camera']){
-							console.log(232)
-		  //		          self.setData({ showCamera:true})
-						}
-					  }
-					})
 		            }
 		          })
 		        }
@@ -392,7 +389,7 @@ export default {
 		    })
 		  },
 		openJY(){
-		//	this.getCameraSetting()
+	//		this.getCameraSetting()
 	//		this.openPhoto();
 	//		this.getCameraSetting()
 			/* wx.openSetting({
@@ -846,9 +843,11 @@ export default {
 <style lang="scss" scope>
 	.btnSet{
 		width: 100px;
-		height: 100px;
-		position: fixed;
-		bottom: 0;
+		height: 50px;
+		background: #007AFF;
+		border-radius: 40rpx;
+		color: #FFFFFF;
+		font-size: 28rpx;
 	}
 .btnReply {
 	width: 80rpx;

+ 1 - 1
pages2/wd/class.vue

@@ -39,7 +39,7 @@
 					<view style="width: 60%;">
 						<text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">{{ item.beforeName }}</text>
 					</view>
-					<view><u-button type="primary" size="mini" v-if="false">进入刷题</u-button></view>
+					<view><u-button type="primary" size="mini" >进入刷题</u-button></view>
 				</view>
 			</view>
 		</navigator>