Просмотр исходного кода

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

zhaoxw 4 лет назад
Родитель
Сommit
de2f3d2e18
7 измененных файлов с 477 добавлено и 14 удалено
  1. 2 0
      config/api.js
  2. 1 0
      pages/index/index.vue
  3. 141 3
      pages/media/index.vue
  4. 142 3
      pagesMain/orderDetail.vue
  5. 161 7
      pagesMain/orderItem.vue
  6. 7 0
      pagesMedia/liveDetail.vue
  7. 23 1
      pagesMedia/pickVideo.vue

+ 2 - 0
config/api.js

@@ -75,6 +75,8 @@ module.exports = {
 	creatPickVideo: WX_API_BASE + 'app/liveAndVideo/merchant/addPickLive',
 	//  自助采摘直播获取个人信息
 	getMainInfo: WX_API_BASE + 'app/member/selectUserById/',
+	//  小程序-商户端-发起直播推送给订阅用户推送消息
+	startLivePushMessage: WX_API_BASE + '/app/liveAndVideo/startLivePushMessage/',
     // 我的-查询各状态订单数量
 	getOrderNum: WX_API_BASE + 'app/order/user/my/queryOrderStatus/',
 	

+ 1 - 0
pages/index/index.vue

@@ -295,6 +295,7 @@
 							uni.login({
 								provider: 'weixin',
 								success: (res2) => {
+									console.log("1234444",res2)
 									let wxLoginData = {
 										code: res2.code,
 										encryptedData: data.detail.encryptedData,

+ 141 - 3
pages/media/index.vue

@@ -44,6 +44,22 @@
 			</view>
 		</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>
 	</view>
 </template>
@@ -54,6 +70,7 @@
 	export default {
 		data() {
 			return {
+				show_qx:true,
 				liveId: '',
 				pageIndex: 1,
 				isOver: false,
@@ -71,6 +88,9 @@
 			this.getBaseData('refresh')
 		},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			goManage() {
 				if(!this.userData.roleInfos.some(v=>v.menuInfos.some(vv=>vv.label == '短视频'))){
 					this.$refs.uTips.show({
@@ -130,9 +150,20 @@
 				}
 
 				if (this.liveId) {
-					uni.navigateTo({
-						url: '/pagesMedia/liveDetail?liveId=' + 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
+							});
+						}
+					  }
+					})
 				} else {
 					this.$refs.uTips.show({
 						title: '当前无可进行的直播',
@@ -370,4 +401,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

@@ -115,6 +115,22 @@
 		<uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup"
 		 v-if="(orderData.orderStatus >= 2 && orderData.orderStatus <= 4) || (orderData.orderStatus == 5 && orderData.evaluateReplyStatus == 1)" />
 		<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>
 
@@ -124,6 +140,7 @@
 	export default {
 		data() {
 			return {
+				show_qx:true,
 				orderType: {
 					title: '',
 					text: '',
@@ -236,6 +253,9 @@
 		},
 		onShow() {},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  获取订单类型
 			getOrderType() {
 				switch (this.orderData.orderStatus) {
@@ -286,9 +306,21 @@
 						});
 					} else if (e.index == 1) {
 						//  去自助采摘
-						uni.navigateTo({
-							url: '/pagesMedia/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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+								});
+							}
+						  }
+						})
+						
 					}
 				} else if (this.orderData.orderStatus == 3 || this.orderData.orderStatus == 4) {
 					//  追踪物流
@@ -853,4 +885,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: 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>

+ 161 - 7
pagesMain/orderItem.vue

@@ -1,4 +1,5 @@
 <template>
+	<view class="container">
 	<view class="order-row" @click="goToOrderDetail()">
 		<view class="shop-info" v-if="orderData">
 			<text class="iconfont iconwode"></text>
@@ -34,6 +35,23 @@
 		</view>
 		<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>
 
 <script>
@@ -75,10 +93,15 @@
 			},
 		},
 		data() {
-			return {}
+			return {
+				show_qx:true
+			}
 		},
 		onLoad() {},
 		methods: {
+			closeSetting:function(){
+				this.show_qx=true;
+			},
 			//  获取订单总价
 			getAllPrice() {
 				let price = this.orderData.products.reduce((total, site) => {
@@ -141,9 +164,21 @@
 					});
 				} else if (type == 6) {
 					// 自助采摘
-					uni.navigateTo({
-						url: '/pagesMedia/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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+							});
+						}
+					  }
+					})
+					
 				}
 			},
 			//  跳转订单详情
@@ -154,9 +189,21 @@
 					});
 				} else {
 					//  自助采摘
-					uni.navigateTo({
-						url: '/pagesMedia/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: '/pagesMedia/pickVideo?tenantCode=' + that.orderData.tenantCode + '&orderId=' + that.orderData.orderId
+							});
+						}
+					  }
+					})
+					
 				}
 			},
 		}
@@ -325,4 +372,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>

+ 7 - 0
pagesMedia/liveDetail.vue

@@ -100,6 +100,13 @@
 					type: 'warning',
 				})
 			})
+			NET.request(API.startLivePushMessage + options.liveId, {}, 'GET').then(res => {
+				
+			//this.goodsList = res.data
+			}).catch(res => {
+				
+			})
+			
 		},
 		onReady() {
 			var that=this;

+ 23 - 1
pagesMedia/pickVideo.vue

@@ -8,6 +8,9 @@
 		<view class="popup-open" @click="showGoods()">
 			<view class="iconfont iconzhibo-shangpin"></view>
 		</view>
+		<view class="popup-flip" @click="changeCamera()">
+			<view class="iconfont iconFill"></view>
+		</view>
 		<uni-popup ref="popup" type="bottom">
 			<view class="popup-box">
 				<view class="popup-close" @click="closeGoods()">收起</view>
@@ -110,6 +113,9 @@
 			})
 		},
 		methods: {
+			changeCamera: function() {
+				this.trtcComponent.switchCamera();
+			},
 			//  打开弹窗
 			showGoods() {
 				this.$refs.popup.open()
@@ -306,7 +312,23 @@
 		height: 100%;
 		float: left;
 		position: relative;
-
+		.popup-flip {
+			width: 50px;
+			height: 50px;
+			position: fixed;
+			top: 15px;
+			right: 15px;
+			background: #52A63A;
+			border-radius: 50%;
+			text-align: center;
+			line-height: 50px;
+			z-index: 10000;
+		
+			.iconFill {
+				color: #FFFFFF;
+				font-size: 34px;
+			}
+		}
 		.tip-toast {
 			position: absolute;
 			top: 40vh;