Browse Source

Merge branch 'master' of http://git.jihengcc.cn/liubaiyan/qjd-user-uniapp

zhaoxw 4 years ago
parent
commit
c2769d7e95
5 changed files with 458 additions and 20 deletions
  1. 5 0
      pagesGood/liveDetail.vue
  2. 15 10
      pagesGood/pickVideo.vue
  3. 150 4
      pagesGood/videoList.vue
  4. 142 3
      pagesMain/orderDetail.vue
  5. 146 3
      pagesMain/orderItem.vue

+ 5 - 0
pagesGood/liveDetail.vue

@@ -34,6 +34,9 @@
 			</view>
 		</uni-popup>
 		<u-top-tips ref="uTips"></u-top-tips>
+		
+		
+		
 	</view>
 </template>
 
@@ -92,6 +95,7 @@
 			})
 		},
 		onReady() {
+			var that=this;
 			// NET.request(API.getLiveGoodsDetail + options.liveId, {}, 'GET').then(res => {
 			// 	this.goodsList = res.data
 			// }).catch(res => {
@@ -220,6 +224,7 @@
 					enableAgc: true,
 					enableAns: true,
 					enableMic:false,
+					enableCamera:false,
 					encsmall: false ? 1 : 0,
 					videoWidth: 1280,
 					videoHeight: 720,

+ 15 - 10
pagesGood/pickVideo.vue

@@ -88,6 +88,10 @@
 				tenantCode : options.tenantCode,
 				orderId: options.orderId
 			}, 'GET').then(res => {
+				this.setData({
+					head_img:res.data.liveProducResVO[0].imgPath,
+					title:res.data.liveProducResVO[0].productName
+				})
 				this.liveId = res.data.liveId
 				this.roomId = res.data.roomId
 				this.goodsList = res.data.liveProducResVO
@@ -167,7 +171,7 @@
 				this.trtcComponent.on(TRTC_EVENT.LOCAL_JOIN, event => {
 					if(this.trtcComponent.getRemoteUserList().length>0){
 						var userId=this.trtcComponent.getRemoteUserList()[0].userID;
-						NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
+						/* NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
 							this.setData({
 								head_img:res.data.merchantImg,
 								title:res.data.merchantNickname
@@ -177,7 +181,7 @@
 								title: '获取个人信息失败',
 								type: 'warning',
 							})
-						})
+						}) */
 					}
 					
 					console.log('* room LOCAL_JOIN', event); // 进房成功,触发该事件后可以对本地视频和音频进行设置
@@ -197,7 +201,7 @@
 				}); // 远端用户进房
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_JOIN, event => {
 					var userId=this.trtcComponent.getRemoteUserList()[0].userID;
-					NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
+					/* NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
 						this.setData({
 							head_img:res.data.merchantImg,
 							title:res.data.merchantNickname
@@ -207,7 +211,7 @@
 							title: '获取个人信息失败',
 							type: 'warning',
 						})
-					})
+					}) */
 					console.log('* room REMOTE_USER_JOIN ---  room.vue', event, this.trtcComponent.getRemoteUserList(), this.template);
 					this.timestamp.push(new Date()); // 1v1视频通话时限制人数为两人的简易逻辑,建议通过后端实现房间人数管理
 					// 2人以上同时进行通话请选择网格布局
@@ -231,10 +235,10 @@
 					}
 				}); // 远端用户退出
 				this.trtcComponent.on(TRTC_EVENT.REMOTE_USER_LEAVE, event => {
-					this.setData({
-						head_img:"../static/images/loginLogo.png",
-						title:''
-					})
+					// this.setData({
+					// 	head_img:"../static/images/loginLogo.png",
+					// 	title:''
+					// })
 					console.log('* room REMOTE_USER_LEAVE', event, this.trtcComponent.getRemoteUserList());
 					if (this.template === '1v1') {
 						this.timestamp = [];
@@ -336,7 +340,7 @@
 			font-size: 32rpx;
 		}
 		.top_box{
-		  width: 304rpx;
+		  //width: 304rpx;
 		  height: 86rpx;
 		  position: absolute;
 		  z-index: 100;
@@ -355,7 +359,8 @@
 		  float: left;
 		  color: #fff;
 		  margin-left: 30rpx;
-		  width: 180rpx;
+		  //width: 180rpx;
+		      padding-right: 30rpx;
 		  padding-top: 2rpx;
 		}
 		.text_box_top{

+ 150 - 4
pagesGood/videoList.vue

@@ -19,6 +19,22 @@
 			</view>
 		</scroll-view>
 		<u-top-tips ref="uTips"></u-top-tips>
+		<view class="uni-popup-dialog" :hidden="show_qx">
+			<view class="uni-dialog-title">
+				<text class="uni-dialog-title-text">提示</text>
+			</view>
+			<view class="uni-dialog-content">
+				<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+			</view>
+			<view class="uni-dialog-button-group">
+				<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+					设置权限
+				</button>
+			</view>
+		
+		</view>
+		<view class="qx_bg" :hidden="show_qx">
+		</view>
 	</view>
 </template>
 
@@ -28,6 +44,7 @@
 	export default {
 		data() {
 			return {
+				show_qx:true,
 				videoType: 1,
 				pageIndex: 1,
 				isOver: false,
@@ -50,6 +67,9 @@
 			this.getVideoList('refresh')
 		},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  搜索直播
 			search(data) {
 				this.videoName = data.value
@@ -99,10 +119,29 @@
 						data: item.liveName
 					})
 				}
-				uni.navigateTo({
-					url: '/pagesGood/' + (this.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :
-						('videoDetail?videoId=' + item.videoId))
-				});
+				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))
+							});
+						}
+					  }
+					})
+				}else{
+					uni.navigateTo({
+						url: '/pagesGood/' + (this.videoType == 1 ? ('liveDetail?liveId=' + item.liveId + '&roomId=' + item.roomId) :
+							('videoDetail?videoId=' + item.videoId))
+					});
+				}
+				
 			}
 		},
 	}
@@ -224,4 +263,111 @@
 			}
 		}
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 11;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 10;
+	}
 </style>

+ 142 - 3
pagesMain/orderDetail.vue

@@ -118,6 +118,22 @@
 		<uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup" />
 		<u-modal v-model="modalShow" :content="modalContent" @confirm="submitHandle" :async-close="true" :show-cancel-button="true"></u-modal>
 		<u-top-tips ref="uTips"></u-top-tips>
+		<view class="uni-popup-dialog" :hidden="show_qx">
+			<view class="uni-dialog-title">
+				<text class="uni-dialog-title-text">提示</text>
+			</view>
+			<view class="uni-dialog-content">
+				<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+			</view>
+			<view class="uni-dialog-button-group">
+				<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+					设置权限
+				</button>
+			</view>
+		
+		</view>
+		<view class="qx_bg" :hidden="show_qx">
+		</view>
 	</view>
 </template>
 
@@ -128,6 +144,7 @@
 		components: {},
 		data() {
 			return {
+				show_qx:true,
 				orderType: {
 					title: '',
 					text: '',
@@ -301,6 +318,9 @@
 		},
 		onShow() {},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  获取订单类型
 			getOrderType() {
 				if (!this.orderData.auctionStatus) {
@@ -418,10 +438,22 @@
 						})
 					} 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
+									});
+								}
+							  }
+							})
 							//  自助采摘
-							uni.navigateTo({
-								url: '/pagesGood/pickVideo?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
-							});
+							
 						} else if (this.orderData.orderStatus == 3) {
 							if (e.index == 1) {
 								//  确认收货
@@ -1107,4 +1139,111 @@
 			border-top: 1px solid #cccccc;
 		}
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 1001;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 1000;
+	}
 </style>

+ 146 - 3
pagesMain/orderItem.vue

@@ -1,4 +1,5 @@
 <template>
+	<view class="container">
 	<view class="order-row" @click="goToOrderDetail()">
 		<view class="shop-info" v-if="orderData" @click.stop="gotoShop()">
 			<text class="iconfont icondianpu"></text>
@@ -47,6 +48,24 @@
 		</view>
 		<u-modal v-model="modalShow" :content="modalContent" @confirm="submitHandle" :async-close="true" :show-cancel-button="true"></u-modal>
 		<u-top-tips ref="uTips"></u-top-tips>
+		
+	</view>
+	<view class="uni-popup-dialog" :hidden="show_qx">
+		<view class="uni-dialog-title">
+			<text class="uni-dialog-title-text">提示</text>
+		</view>
+		<view class="uni-dialog-content">
+			<text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
+		</view>
+		<view class="uni-dialog-button-group">
+			<button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
+				设置权限
+			</button>
+		</view>
+	
+	</view>
+	<view class="qx_bg" :hidden="show_qx">
+	</view>
 	</view>
 </template>
 
@@ -85,6 +104,7 @@
 		},
 		data() {
 			return {
+				show_qx:true,
 				pickHandle: false,
 				sharePlant: false,
 				modalShow: false,
@@ -97,6 +117,9 @@
 			this.sharePlant = this.orderData.products.filter(site => site.productType == 4).length > 0
 		},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  跳转商铺
 			gotoShop() {
 				if (this.orderData.tenantCode != 'admin') {
@@ -172,9 +195,21 @@
 					})
 				} else if (type == 4) {
 					//  自助采摘
-					uni.navigateTo({
-						url: '/pagesGood/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
-					});
+					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
+							});
+						}
+					  }
+					})
+					return false;
 				} else if (type == 6) {
 					//  追踪物流
 					uni.navigateTo({
@@ -451,4 +486,112 @@
 	/deep/.u-round-circle {
 		padding: 0 12px;
 	}
+	.uni-popup-dialog {
+		width: 80vw;
+		border-radius: 15px;
+		background-color: #fff;
+		position: fixed;
+		margin-left: 10vw;
+		top: 34vh;
+		z-index: 11;
+		left: 0px;
+	}
+	
+	.uni-dialog-title {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		padding-top: 15px;
+		padding-bottom: 5px;
+	}
+	
+	.uni-dialog-title-text {
+		font-size: 16px;
+		font-weight: 500;
+	}
+	
+	.uni-dialog-content {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		padding: 5px 15px 15px 15px;
+		text-align: center;
+	}
+	
+	.uni-dialog-content-text {
+		font-size: 14px;
+		color: #6e6e6e;
+	}
+	
+	.uni-dialog-button-group {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: row;
+		border-top-color: #f5f5f5;
+		border-top-style: solid;
+		border-top-width: 1px;
+	}
+	
+	.uni-dialog-button {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		    background: rgba(0, 0, 0, 0);
+		    border: none;
+		flex: 1;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 45px;
+	}
+	
+	.uni-border-left {
+		border-left-color: #f0f0f0;
+		border-left-style: solid;
+		border-left-width: 0px;
+	}
+	
+	.uni-dialog-button-text {
+		font-size: 14px;
+	}
+	
+	.uni-button-color {
+		color: #007aff;
+	}
+	
+	.uni-dialog-input {
+		flex: 1;
+		font-size: 14px;
+	}
+	
+	.uni-popup__success {
+		color: #4cd964;
+	}
+	
+	.uni-popup__warn {
+		color: #f0ad4e;
+	}
+	
+	.uni-popup__error {
+		color: #dd524d;
+	}
+	
+	.uni-popup__info {
+		color: #909399;
+	}
+	.qx_bg{
+		width: 100vw;
+		height: 100vh;
+		background: rgba(0, 0, 0, 0.25);
+		position: fixed;
+		top: 0px;
+		left: 0px;
+		z-index: 10;
+	}
 </style>