Răsfoiți Sursa

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

unknown 4 ani în urmă
părinte
comite
9bd4d5398b
3 a modificat fișierele cu 93 adăugiri și 54 ștergeri
  1. 23 13
      pages/media/index.vue
  2. 24 13
      pagesMain/orderDetail.vue
  3. 46 28
      pagesMain/orderItem.vue

+ 23 - 13
pages/media/index.vue

@@ -151,19 +151,29 @@
 
 				if (this.liveId) {
 					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: '/pagesMedia/liveDetail?liveId=' + that.liveId
-							});
-						}
-					  }
-					})
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/liveDetail?liveId=' + that.liveId
+						});
+					}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: '/pagesMedia/liveDetail?liveId=' + that.liveId
+								});
+							}
+						  }
+						})
+					}
 				} else {
 					this.$refs.uTips.show({
 						title: '当前无可进行的直播',

+ 24 - 13
pagesMain/orderDetail.vue

@@ -307,19 +307,30 @@
 					} else if (e.index == 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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
-								});
-							}
-						  }
-						})
+						if(uni.getStorageSync("firstTimeLive")==""){
+							uni.setStorage({
+								key: 'firstTimeLive',
+								data: 1
+							})
+							uni.navigateTo({
+								url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+							});
+						}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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+									});
+								}
+							  }
+							})
+						}
+						
 						
 					}
 				} else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {

+ 46 - 28
pagesMain/orderItem.vue

@@ -165,20 +165,29 @@
 				} else if (type == 6) {
 					// 自助采摘
 					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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
-							});
-						}
-					  }
-					})
-					
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+						});
+					}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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+								});
+							}
+						  }
+						})
+					}
 				}
 			},
 			//  跳转订单详情
@@ -190,20 +199,29 @@
 				} else {
 					//  自助采摘
 					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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
-							});
-						}
-					  }
-					})
-					
+					if(uni.getStorageSync("firstTimeLive")==""){
+						uni.setStorage({
+							key: 'firstTimeLive',
+							data: 1
+						})
+						uni.navigateTo({
+							url: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+						});
+					}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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+								});
+							}
+						  }
+						})
+					}
 				}
 			},
 		}