浏览代码

自助采摘商品列表

zhaoxw 4 年之前
父节点
当前提交
544a8ef059
共有 5 个文件被更改,包括 312 次插入8 次删除
  1. 6 0
      pages.json
  2. 2 1
      pages/user/index.vue
  3. 21 4
      pagesMain/orderItem.vue
  4. 107 0
      pagesMain/pickOrderList.vue
  5. 176 3
      pagesMedia/pickVideo.vue

+ 6 - 0
pages.json

@@ -156,6 +156,12 @@
 			"style": {
 				"navigationBarTitleText": "商户信息"
 			}
+		}, {
+			"path": "pickOrderList",
+			"style": {
+				"navigationBarTitleText": "自助采摘订单",
+				"enablePullDownRefresh": true
+			}
 		}]
 	}],
 	"globalStyle": {

+ 2 - 1
pages/user/index.vue

@@ -108,7 +108,8 @@
 			//  自助采摘
 			pickClick() {
 				uni.navigateTo({
-					url: '/pagesMedia/pickVideo'
+					// url: '/pagesMedia/pickVideo',
+					url: '/pagesMain/pickOrderList?type=' + 6
 				});
 			},
 			//  授权

+ 21 - 4
pagesMain/orderItem.vue

@@ -21,7 +21,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="pay-info">总价¥{{getAllPrice()}},实付¥{{orderData.paySum}}</view>
+		<view v-if="noPick" class="pay-info">总价¥{{getAllPrice()}},实付¥{{orderData.paySum}}</view>
 		<view class="handle-box" v-if="(tabIndex > 1 && tabIndex < 5) || (tabIndex == 5 && orderData.evaluateStatus == 2 && orderData.evaluateReplyStatus == 1)">
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 2" @click.stop="handleOrder(1)">发货</u-button>
@@ -29,6 +29,8 @@
 			 v-if="tabIndex == 3 || tabIndex == 4" @click.stop="handleOrder(2)">追踪物流</u-button>
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 5 && orderData.evaluateStatus == 2 && orderData.evaluateReplyStatus == 1" @click.stop="handleOrder(3)">回复</u-button>
+			 <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
+			  v-if="noPick" @click.stop="handleOrder(6)">自助采摘</u-button>
 		</view>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
@@ -42,6 +44,9 @@
 			tabIndex: {
 				default: 1
 			},
+			noPick: {
+				default: true
+			},
 			orderData: {
 				default: {
 					auctionStatus: 0,
@@ -118,13 +123,25 @@
 					uni.navigateTo({
 						url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&mid='+this.orderData.mid
 					});
+				} else if (type == 6) {
+					// 自助采摘
+					uni.navigateTo({
+						url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
+					});
 				}
 			},
 			//  跳转订单详情
 			goToOrderDetail() {
-				uni.navigateTo({
-					url: '/pagesMain/orderDetail?orderId=' + this.orderData.orderId + '&orderStatus=' + this.orderData.orderStatus
-				});
+				if (this.noPick) {
+					uni.navigateTo({
+						url: '/pagesMain/orderDetail?orderId=' + this.orderData.orderId + '&orderStatus=' + this.orderData.orderStatus
+					});
+				} else {
+					//  自助采摘
+					uni.navigateTo({
+						url: '/pagesMedia/pickVideo?tenantCode=' + this.orderData.tenantCode + '&orderId=' + this.orderData.orderId
+					});
+				}
 			},
 		}
 	}

+ 107 - 0
pagesMain/pickOrderList.vue

@@ -0,0 +1,107 @@
+<template>
+	<view class="container">
+		<scroll-view class="order-list" scroll-y="true" @scrolltolower="handleLoadMore(6)">
+			<view style="padding: 10px 0" v-if="!orderList.length">
+				<u-divider color="#909399" border-color="#909399" bg-color="#f7f7f7">没有更多了</u-divider>
+			</view>
+			<orderItem v-for="(item, index) in orderList" :key="index" :orderData="item" :noPick="false"></orderItem>
+		</scroll-view>
+		<u-top-tips ref="uTips"></u-top-tips>
+	</view>
+</template>
+
+<script>
+	const NET = require('@/utils/request')
+	const API = require('@/config/api')
+	import orderItem from '@/pagesMain/orderItem.vue'
+	export default {
+		components: {
+			orderItem
+		},
+		data() {
+			return {
+				pageIndex: 1,
+				isOver: false,
+				orderList: [],
+				type: 6
+			}
+		},
+		onLoad(options) {
+			this.type = options.type
+		},
+		onShow(options) {
+			this.pageIndex = 1
+			this.isOver = false
+			this.orderList = []
+			this.getOrderList(this.type)
+		},
+		onPullDownRefresh() {
+			this.pageIndex = 1
+			this.isOver = false
+			this.orderList = []
+			this.getOrderList(this.type, 'refresh')
+		},
+		methods: {
+			//  刷新数据
+			reasetList() {
+				this.pageIndex = 1
+				this.isOver = false
+				this.orderList = []
+				this.getOrderList(this.type)
+			},
+			//  懒加载
+			handleLoadMore(type) {
+				if (!this.isOver) {
+					this.pageIndex++
+					this.getOrderList(type)
+				}
+			},
+			//  获取全部订单
+			getOrderList(type, refresh) {
+				NET.request(API.getOrderList + this.pageIndex + '/10', {
+					flag: type,
+				}, 'GET').then(res => {
+					if (refresh == 'refresh') {
+						uni.stopPullDownRefresh();
+					}
+					this.isOver = res.data.list.length != 10
+					this.orderList = this.orderList.concat(res.data.list)
+				}).catch(error => {
+					this.$refs.uTips.show({
+						title: error.data.msg,
+						type: 'warning',
+					})
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+	page {
+		width: 100%;
+		height: 100%;
+	}
+
+	.container {
+		width: 100%;
+		height: 100%;
+		float: left;
+		background-color: #f7f7f7;
+
+		.order-tab {
+			width: 100%;
+			height: 45px;
+			float: left;
+		}
+
+		.order-list {
+			width: calc(100% - 30px);
+			height: calc(100% - 46px);
+			float: left;
+			margin: 0 15px;
+			box-sizing: border-box;
+			padding-top: 15px;
+		}
+	}
+</style>

+ 176 - 3
pagesMedia/pickVideo.vue

@@ -5,6 +5,27 @@
 			<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">
+						<image class="goods-img" :src="item.imgPath" mode="aspectFill"></image>
+						<view class="goods-info">
+							<view class="goods-name">{{item.productName}}</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>
+				</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>
@@ -46,10 +67,12 @@
 				btn_top:0,
 				title:"测试",
 				user_name:'123',
-				head_img:"../static/images/loginLogo.png"
+				head_img:"../static/images/loginLogo.png",
+				orderId: '',
+				goodsList: []
 			}
 		},
-		onLoad() {
+		onLoad(options) {
 			let menuButtonObject = wx.getMenuButtonBoundingClientRect();
 			 wx.getSystemInfo({
 			    success: res => {
@@ -65,10 +88,12 @@
 			this.options = {
 				template: '1v1'
 			}
-			NET.request(API.creatPickVideo, {}, 'GET').then(res => {
+			this.orderId = options.orderId
+			NET.request(API.creatPickVideo, {orderId: this.orderId}, 'GET').then(res => {
 				this.liveId = res.data.liveId
 				this.roomId = Number(res.data.roomId)
 				this.trtcComponent = this.$refs['trtc-component'] // 监听TRTC Room 关键事件
+				this.goodsList = res.data.liveProducResVO
 				this.enterRoom({
 					roomID: this.roomId,
 					userID: uni.getStorageSync("userData").userId, //设置为用户id
@@ -85,6 +110,14 @@
 			})
 		},
 		methods: {
+			//  打开弹窗
+			showGoods() {
+				this.$refs.popup.open()
+			},
+			//  关闭弹窗
+			closeGoods() {
+				this.$refs.popup.close()
+			},
 			setData,
 			enterRoom: function(params) {
 				params.template = params.template || '1v1';
@@ -329,5 +362,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>