Browse Source

直播权限问题,第一次进入直播不提示

unknown 4 years ago
parent
commit
77a0891cb2
3 changed files with 80 additions and 39 deletions
  1. 32 13
      pagesGood/videoList.vue
  2. 24 13
      pagesMain/orderDetail.vue
  3. 24 13
      pagesMain/orderItem.vue

+ 32 - 13
pagesGood/videoList.vue

@@ -121,20 +121,39 @@
 				}
 				if(this.videoType == 1){
 					var that=this;
-					wx.getSetting({
-					  success(res) {
-						if (!res.authSetting['scope.camera']){
-						  that.show_qx=false;
-						}else if (!res.authSetting['scope.record']){
-						  that.show_qx=false;
-						}else{
-							uni.navigateTo({
-								url: '/pagesGood/' + (that.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :
-									('videoDetail?videoId=' + item.videoId))
-							});
+					/*uni.setStorage({
+						key: 'firstTimeLive',
+						data: {
+							headImage: JSON.parse(this.wxLoginData.rawData).avatarUrl,
+							userName: res.data.name,
+							userId: res.data.userId,
 						}
-					  }
-					})
+					})*/
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesGood/' + (that.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :
+								('videoDetail?videoId=' + item.videoId))
+						});
+					}else{
+						wx.getSetting({
+						  success(res) {
+							if (!res.authSetting['scope.camera']){
+							  that.show_qx=false;
+							}else if (!res.authSetting['scope.record']){
+							  that.show_qx=false;
+							}else{
+								uni.navigateTo({
+									url: '/pagesGood/' + (that.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :
+										('videoDetail?videoId=' + item.videoId))
+								});
+							}
+						  }
+						})
+					}
 				}else{
 					uni.navigateTo({
 						url: '/pagesGood/' + (this.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :

+ 24 - 13
pagesMain/orderDetail.vue

@@ -439,19 +439,30 @@
 					} else {
 						if (this.orderData.orderStatus == 2) {
 							var that=this;
-							wx.getSetting({
-							  success(res) {
-								if (!res.authSetting['scope.camera']){
-								  that.show_qx=false;
-								}else if (!res.authSetting['scope.record']){
-								  that.show_qx=false;
-								}else{
-									uni.navigateTo({
-										url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
-									});
-								}
-							  }
-							})
+							if(uni.getStorageSync("firstTimeLive")==""){
+								uni.setStorage({
+									key: 'firstTimeLive',
+									data: 1
+								})
+								uni.navigateTo({
+									url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
+								});
+							}else{
+								wx.getSetting({
+								  success(res) {
+									if (!res.authSetting['scope.camera']){
+									  that.show_qx=false;
+									}else if (!res.authSetting['scope.record']){
+									  that.show_qx=false;
+									}else{
+										uni.navigateTo({
+											url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
+										});
+									}
+								  }
+								})
+							}
+							
 							//  自助采摘
 						} else if (this.orderData.orderStatus == 3) {
 							if (e.index == 1) {

+ 24 - 13
pagesMain/orderItem.vue

@@ -196,19 +196,30 @@
 				} else if (type == 4) {
 					//  自助采摘
 					var that=this;
-					wx.getSetting({
-					  success(res) {
-						if (!res.authSetting['scope.camera']){
-						  that.show_qx=false;
-						}else if (!res.authSetting['scope.record']){
-						  that.show_qx=false;
-						}else{
-							uni.navigateTo({
-								url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
-							});
-						}
-					  }
-					})
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
+						});
+					}else{
+						wx.getSetting({
+						  success(res) {
+							if (!res.authSetting['scope.camera']){
+							  that.show_qx=false;
+							}else if (!res.authSetting['scope.record']){
+							  that.show_qx=false;
+							}else{
+								uni.navigateTo({
+									url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
+								});
+							}
+						  }
+						})
+					}
+					
 					return false;
 				} else if (type == 6) {
 					//  追踪物流