Selaa lähdekoodia

Merge branch 'master' of https://gitee.com/he2802/saas_applet

chenxiong 3 vuotta sitten
vanhempi
commit
4d256d5e4a
2 muutettua tiedostoa jossa 27 lisäystä ja 15 poistoa
  1. 26 14
      pages2/class/detail.vue
  2. 1 1
      pages2/wd/class.vue

+ 26 - 14
pages2/class/detail.vue

@@ -128,6 +128,14 @@
 				</view>
 			</view>
 		</view>
+		<!-- 播放前拍照end -->
+		<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;">
 			<view class="photoBox">
@@ -145,8 +153,8 @@
 				<view class="btnResult" @click="takePhoto">拍照</view>
 			</view>
 		</view>
-		<!-- 播放前拍照end -->
-		
+
+		</u-mask>
 	</view>
 	
 </template>
@@ -164,6 +172,7 @@ export default {
 	},
 	data() {
 		return {
+			showSet:false,
 			startStatus: false,
 			detail: {},
 			courseId: 0,
@@ -340,8 +349,11 @@ export default {
 		});
 	},
 	methods: {
+		openSetting(res){
+			console.log(res,98)
+		},
 		getCameraSetting () {
-		    const _this = this
+		    const self = this
 		    wx.getSetting({
 		      success: res => {
 		        if (res.authSetting['scope.camera']) {
@@ -355,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})
-						}
-					  }
-					})
 		            }
 		          })
 		        }
@@ -386,7 +389,8 @@ export default {
 		    })
 		  },
 		openJY(){
-		//	this.openPhoto();
+	//		this.getCameraSetting()
+	//		this.openPhoto();
 	//		this.getCameraSetting()
 			/* wx.openSetting({
 			      success (res) {
@@ -837,6 +841,14 @@ export default {
 </script>
 
 <style lang="scss" scope>
+	.btnSet{
+		width: 100px;
+		height: 50px;
+		background: #007AFF;
+		border-radius: 40rpx;
+		color: #FFFFFF;
+		font-size: 28rpx;
+	}
 .btnReply {
 	width: 80rpx;
 	height: 40rpx;

+ 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>