Explorar el Código

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

liuboyan hace 4 años
padre
commit
5c5d0756a1
Se han modificado 5 ficheros con 295 adiciones y 47 borrados
  1. 1 1
      pages/index/index.vue
  2. 3 3
      pagesGood/orderPay.vue
  3. 197 13
      pagesGood/pickVideo.vue
  4. 92 28
      pagesMain/orderDetail.vue
  5. 2 2
      pagesMain/orderItem.vue

+ 1 - 1
pages/index/index.vue

@@ -67,7 +67,7 @@
 			<view class="title-text">猜你喜欢</view>
 		</view>
 		<view v-if="!goodsList.length" style="margin-left: 12px;">暂无商品</view>
-		<scroll-view v-if="goodsList.length" class="content-box" scroll-y="false">
+		<scroll-view v-if="goodsList.length" class="content-box" :scroll-y="false">
 			<view class="goods-row" v-for="(item,index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 				<image class="goods-img" :src="item.imgPath" mode="aspectFill"></image>
 				<view class="goods-info">

+ 3 - 3
pagesGood/orderPay.vue

@@ -308,7 +308,7 @@
 									paySign: res.data.paySign,
 									success: (payRes) => {
 										console.log('success:' + JSON.stringify(payRes));
-										uni.reLaunch({
+										uni.redirectTo({
 											url: '/pagesMain/paySuccess?orderId=' + this.orderId
 										});
 									},
@@ -319,14 +319,14 @@
 											type: 'warning',
 										})
 										setTimeout(() => {
-											uni.reLaunch({
+											uni.redirectTo({
 											    url: '/pagesMain/orderDetail?orderId=' + this.orderId + '&orderStatus=' + 1
 											});
 										}, 1000)
 									}
 								})
 							} else {
-								uni.reLaunch({
+								uni.redirectTo({
 									url: '/pagesMain/paySuccess'
 								});
 							}

+ 197 - 13
pagesGood/pickVideo.vue

@@ -5,6 +5,31 @@
 			<view>当前房间为1v1双人通话房间</view>
 			<view>不希望其他人打扰</view>
 		</view>
+		<view class="popup-open" @click="showGoods()">
+			<view class="iconfont iconzhibo-shangpin"></view>
+		</view>
+		<uni-popup ref="popup" type="bottom">
+			<view class="popup-box">
+				<view class="popup-close" @click="closeGoods()">收起</view>
+				<scroll-view scroll-y="true" class="good-box">
+					<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
+						<image class="goods-img" :src="item.imgPath" mode="aspectFill"></image>
+						<view class="goods-info">
+							<view class="goods-name">{{item.productName}}</view>
+							<!-- <view class="goods-sales">{{item.sellCount}}人付款</view> -->
+							<view class="goods-number">
+								<text class="goods-icon">¥</text>
+								<text class="goods-spec">{{item.bizPrice}}</text>
+								<text class="price">原价:{{item.originalPrice}}</text>
+							</view>
+						</view>
+						<view class="more-button">
+							<view class="iconfont icongengduo"></view>
+						</view>
+					</view>
+				</scroll-view>
+			</view>
+		</uni-popup>
 		<u-top-tips ref="uTips"></u-top-tips>
 		<view class="top_box" :style="{ top: btn_top, left: btn_left}">
 			<image class="top_box_img" :src="head_img"></image>
@@ -45,7 +70,8 @@
 				btn_top:0,
 				title:"",
 				user_name:'1',
-				head_img:"../static/images/loginLogo.png"
+				head_img:"../static/images/loginLogo.png",
+				goodsList: []
 			}
 		},
 		onLoad(options) {
@@ -59,10 +85,12 @@
 				},
 			})
 			NET.request(API.linkPickVideo, {
-				tenantCode : options.tenantCode
+				tenantCode : options.tenantCode,
+				orderId: options.orderId
 			}, 'GET').then(res => {
 				this.liveId = res.data.liveId
 				this.roomId = res.data.roomId
+				this.goodsList = res.data.liveProducResVO
 				wx.setKeepScreenOn({
 					keepScreenOn: true
 				}); // 获取 rtcroom 实例
@@ -85,6 +113,19 @@
 			})
 		},
 		methods: {
+			//  打开弹窗
+			showGoods() {
+				this.$refs.popup.open()
+			},
+			//  关闭弹窗
+			closeGoods() {
+				this.$refs.popup.close()
+			},
+			goToGoodDetails(item) {
+				uni.navigateTo({
+					url: '/pagesGood/goodDetails?goodId=' + item.productId
+				});
+			},
 			setData,
 			enterRoom: function(params) {
 				params.template = params.template || '1v1';
@@ -124,18 +165,21 @@
 				const TRTC_EVENT = this.trtcComponent.EVENT;
 				this.timestamp = []; // 初始化事件订阅
 				this.trtcComponent.on(TRTC_EVENT.LOCAL_JOIN, event => {
-					var userId=this.trtcComponent.getRemoteUserList()[0].userID;
-					NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
-						this.setData({
-							head_img:res.data.merchantImg,
-							title:res.data.merchantNickname
-						})
-					}).catch(error => {
-						this.$refs.uTips.show({
-							title: '获取个人信息失败',
-							type: 'warning',
+					if(this.trtcComponent.getRemoteUserList().length>0){
+						var userId=this.trtcComponent.getRemoteUserList()[0].userID;
+						NET.request(API.getMerchantsMainInfo + userId, {}, 'GET').then(res => {
+							this.setData({
+								head_img:res.data.merchantImg,
+								title:res.data.merchantNickname
+							})
+						}).catch(error => {
+							this.$refs.uTips.show({
+								title: '获取个人信息失败',
+								type: 'warning',
+							})
 						})
-					})
+					}
+					
 					console.log('* room LOCAL_JOIN', event); // 进房成功,触发该事件后可以对本地视频和音频进行设置
 
 					if (this.options.localVideo === true || this.options.template === '1v1') {
@@ -327,5 +371,145 @@
 		  float: left;
 		  margin-top: 10rpx;
 		}
+		.popup-open {
+			width: 50px;
+			height: 50px;
+			position: fixed;
+			bottom: 15px;
+			right: 15px;
+			background: #52A63A;
+			border-radius: 50%;
+			text-align: center;
+			line-height: 50px;
+		    z-index: 20000;
+			.iconzhibo-shangpin {
+				color: #FFFFFF;
+				font-size: 34px;
+			}
+		}
+		.popup-box {
+			width: 100%;
+			height: 265px;
+			float: left;
+			background-color: #FFFFFF;
+			border-radius: 15px 15px 0px 0px;
+			box-sizing: border-box;
+			padding: 16px 0 0 0;
+			position: relative;
+		
+			.popup-close {
+				width: 100%;
+				height: 26px;
+				float: left;
+				box-sizing: border-box;
+				padding: 10px 15px 0 15px;
+				font-size: 15px;
+				font-family: PingFang SC;
+				color: #52A63A;
+				line-height: 16px;
+			}
+		
+			.good-box {
+				width: 100%;
+				height: calc(100% - 26px);
+				box-sizing: border-box;
+				padding: 0 0 10px 0;
+				overflow: auto;
+				position: relative;
+		
+				.goods-row:first-child {
+					margin-top: 12px;
+				}
+		
+				.goods-row {
+					width: calc(100% - 30px);
+					height: 104px;
+					float: left;
+					background: #FFFFFF;
+					box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
+					border-radius: 5px;
+					margin: 0 15px 10px 15px;
+					position: relative;
+		
+					.goods-img {
+						width: 104px;
+						height: 104px;
+						object-fit: cover;
+						float: left;
+						margin-right: 15px;
+					}
+		
+					.goods-info {
+						width: calc(100% - 120px);
+						float: left;
+						padding-top: 10px;
+		
+						.goods-name {
+							width: 100%;
+							height: 30px;
+							float: left;
+							font-size: 15px;
+							font-family: PingFang SC;
+							color: #333333;
+							line-height: 15px;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							display: -webkit-box;
+							-webkit-line-clamp: 2;
+							-webkit-box-orient: vertical;
+							word-wrap: break-word;
+						}
+		
+						.goods-sales {
+							width: 100%;
+							float: left;
+							font-size: 12px;
+							font-family: PingFang SC;
+							color: #666666;
+							line-height: 15px;
+							margin: 4px 0 8px 0;
+						}
+		
+						.goods-number {
+							width: 100%;
+							height: 24px;
+							float: left;
+							white-space: nowrap;
+							font-family: PingFang SC;
+							color: #52A63A;
+							line-height: 24px;
+		
+							.goods-icon {
+								font-size: 14px;
+							}
+		
+							.goods-spec {
+								font-size: 24px;
+							}
+		
+							.price {
+								font-size: 12px;
+								text-decoration: line-through;
+								color: #A67954;
+								margin-left: 6px;
+							}
+						}
+					}
+		
+					.more-button {
+						width: 24px;
+						height: 24px;
+						position: absolute;
+						right: 16px;
+						bottom: 16px;
+		
+						.iconfont {
+							font-size: 36px;
+							color: #999999;
+						}
+					}
+				}
+			}
+		}
 	}
 </style>

+ 92 - 28
pagesMain/orderDetail.vue

@@ -2,7 +2,8 @@
 	<view class="container">
 		<view class="order-type-info">
 			<view class="order-type-title">{{orderType.title}}</view>
-			<view class="order-type-text">{{orderType.text}}</view>
+			<view class="order-type-text">{{orderType.text}}
+			</view>
 		</view>
 		<view class="address-info-box">
 			<view class="address-icon">
@@ -85,7 +86,7 @@
 				<view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
 			</view>
 		</view>
-		<view class="order-info-box">
+		<view class="order-info-box" v-if="orderData.evaluateResVO.evaluateContent">
 			<view class="info-title-box">
 				<view class="info-title">评价信息</view>
 			</view>
@@ -113,10 +114,10 @@
 				</view>
 			</view>
 		</view>
-	<!-- </view> -->
-	<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> -->
+		<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>
 </template>
 
@@ -124,6 +125,8 @@
 	const NET = require('@/utils/request')
 	const API = require('@/config/api')
 	export default {
+		components: {
+		},
 		data() {
 			return {
 				orderType: {
@@ -169,6 +172,20 @@
 				orderStatus: options.orderStatus,
 			}, 'GET').then(res => {
 				this.orderData = res.data
+				if (this.orderData.addOrderTime) {
+					let tempTime = new Date(this.orderData.addOrderTime).getTime()
+					let addTempTime = new Date(tempTime + 1000*60*60*24)
+					let addYear = addTempTime.getFullYear()
+					let addMonth = addTempTime.getMonth()+1
+					let addDay = addTempTime.getDate()
+					let addHours = addTempTime.getHours()
+					let addMin = addTempTime.getMinutes()
+					let addSeconds = addTempTime.getSeconds()
+					this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' + addSeconds
+				    // this.orderData.tempTimeArr = this.orderData.addOrderTime.split(' ')
+				    // let tempDate = new Date(this.orderData.tempTimeArr[0].replace(/-/g, "/"))
+				    // this.orderData.overTime = new Date(tempDate.setDate(tempDate.getDate() + 1))
+				}
 				if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
 					2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
 					this.goodType = 1
@@ -193,15 +210,26 @@
 							return v.productType == 1
 						})
 						if (!someVaule) {
-							this.buttonGroup = [{
-								text: '申请售后',
-								backgroundColor: '#75BD60',
-								color: '#fff'
-							}, {
-								text: '自助采摘',
-								backgroundColor: '#52A63A',
-								color: '#fff'
-							}]
+							if (this.orderData.merchantInfoResVO.products.every(v => {
+								Number(v.productType)
+								return v.productType == 3
+							})) {
+							    this.buttonGroup = [{
+							    	text: '申请售后',
+							    	backgroundColor: '#75BD60',
+							    	color: '#fff'
+							    }, {
+							    	text: '自助采摘',
+							    	backgroundColor: '#52A63A',
+							    	color: '#fff'
+							    }]
+							} else {
+								this.buttonGroup = [{
+									text: '申请售后',
+									backgroundColor: '#75BD60',
+									color: '#fff'
+								}]
+							}
 						} else {
 							this.buttonGroup = [{
 								text: '申请售后',
@@ -263,7 +291,8 @@
 					case 1:
 						this.orderType = {
 							title: '等待买家付款',
-							text: '订单将于' + this.orderData.addOrderTime + '关闭',
+							text: '订单将于' + this.orderData.overTime + '关闭',
+							date: this.orderData.overTime
 						}
 						break;
 					case 2:
@@ -330,7 +359,7 @@
 						if (this.orderData.orderStatus == 2) {
 							//  自助采摘
 							uni.navigateTo({
-								url: '/pagesGood/pickVideo?orderId=' + this.orderData.orderId
+								url: '/pagesGood/pickVideo?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
 							});
 						} else if (this.orderData.orderStatus == 3) {
 							if (e.index == 1) {
@@ -382,12 +411,45 @@
 					})
 				} else if (this.handleType == 2) {
 					//  立即支付
-					this.modalShow = false
-					setTimeout(() => {
-						uni.reLaunch({
-							url: '/pagesMain/orderList?type=' + 3
-						});
-					}, 1000)
+					NET.request(API.payOrder, {
+						mid: uni.getStorageSync("userData").userId,
+						orderCode: this.orderData.orderCode,
+						orderId: this.orderData.orderId,
+					}, 'POST').then(res => {
+						this.modalShow = false
+						uni.requestPayment({
+							provider: 'wxpay',
+							timeStamp: res.data.timeStamp,
+							nonceStr: res.data.nonceStr,
+							package: res.data.packageValue,
+							signType: res.data.signType,
+							paySign: res.data.paySign,
+							success: (payRes) => {
+								console.log('success:' + JSON.stringify(payRes));
+								uni.navigateTo({
+									url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
+								});
+							},
+							fail: (error) => {
+								console.log('fail:' + JSON.stringify(error));
+								this.$refs.uTips.show({
+									title: '支付失败',
+									type: 'warning',
+								})
+							}
+						})
+					}).catch(error => {
+						this.modalShow = false
+						this.$refs.uTips.show({
+							title: error.data.msg,
+							type: 'warning',
+						})
+					})
+					// setTimeout(() => {
+					// 	uni.reLaunch({
+					// 		url: '/pagesMain/orderList?type=' + 3
+					// 	});
+					// }, 1000)
 				} else if (this.handleType == 3) {
 					//  确认收货
 					NET.request(API.confirmOrder, {
@@ -845,7 +907,8 @@
 				.assess-info {
 					width: calc(100% - 62px);
 					margin-left: 12px;
-                    float: left;
+					float: left;
+
 					.assess-name {
 						height: 18px;
 						float: left;
@@ -903,20 +966,21 @@
 						}
 					}
 				}
+
 				.shop-reply-box {
 					width: 100%;
 					float: left;
 					background: #F5F5F5;
 					border-radius: 5px;
 					margin-top: 10px;
-				
+
 					.shop-head {
 						width: 100%;
 						height: 36px;
 						float: left;
 						box-sizing: border-box;
 						padding: 10px 12px;
-				
+
 						.icondianpu {
 							width: 16px;
 							height: 16px;
@@ -925,7 +989,7 @@
 							font-size: 20px;
 							margin-right: 8px;
 						}
-				
+
 						.shop-name {
 							height: 16px;
 							float: left;
@@ -935,7 +999,7 @@
 							line-height: 16px;
 						}
 					}
-				
+
 					.shop-reply {
 						width: 100%;
 						float: left;

+ 2 - 2
pagesMain/orderItem.vue

@@ -163,7 +163,7 @@
 				} else if (type == 4) {
 					//  自助采摘
 					uni.navigateTo({
-						url: '/pagesGood/pickVideo?tenantCode=' + this.orderData.tenantCode
+						url: '/pagesGood/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
 					});
 				} else if (type == 6) {
 					//  追踪物流
@@ -224,7 +224,7 @@
 							success: (payRes) => {
 								console.log('success:' + JSON.stringify(payRes));
 								uni.navigateTo({
-									url: '/pagesMain/paySuccess'
+									url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
 								});
 							},
 							fail: (error) => {