zhaoxw 4 tahun lalu
induk
melakukan
65e3f48882

+ 42 - 4
pagesGood/goodDetails.vue

@@ -33,6 +33,14 @@
 			<!-- 			<text class="iconfont iconfangxiang"></text>
  -->
 		</view>
+		<view class="buy-num" v-if="goodData.productType != 2">
+			<view class="buy-text">购买数量:</view>
+			<view>
+				<uni-icons type="minus-filled" size="20" color="#A67A54" @click="number>1?number--:''"></uni-icons>
+				<text class="buy-select">{{number}}</text>
+				<uni-icons type="plus-filled" size="20" color="#A67A54" @click="number++"></uni-icons>
+			</view>
+		</view>
 		<view class="tab-box">
 			<view class="tab-col" :class="tabIndex == 1 ? 'tab-col-active' :''" @click="tabIndex = 1">产品介绍</view>
 			<view class="tab-col" :class="tabIndex == 2 ? 'tab-col-active' :''" v-if="goodData.productType != 2 && goodData.productType != 4 "
@@ -118,6 +126,7 @@
 					areaSize: '',
 					imgs: [],
 				},
+				orderId: '',
 				currentPrice: '',
 				assessList: [],
 				goodsList: [],
@@ -162,6 +171,7 @@
 		onLoad(options) {
 			this.goodId = options.goodId ? options.goodId : ''
 			this.minePlant = options.minePlant ? options.minePlant : false
+			this.orderId = options.orderId ? options.orderId : ''
 			uni.getSystemInfo({
 				success: (res) => {
 					this.swiperHeight = res.windowWidth
@@ -260,13 +270,17 @@
 						} else {
 							uni.navigateTo({
 								url: '/pagesMain/entrustList?productId=' + this.goodData.productId + '&tenantCode=' + this.goodData.tenantCode +
-									'&productName=' + this.goodData.productName + '&areaSize=' + this.goodData.areaSize
+									'&productName=' + this.goodData.productName + '&areaSize=' + this.orderId + '&orderId=' + this.orderId
 							});
 						}
 					} else {
-						uni.navigateTo({
-							url: '/pagesGood/orderPay?flag=2&orderType=3&paySum=' + this.goodData.bizPrice
-						});
+						// if (e.index == 0) {
+						// 	this.$refs.popup.open()
+						// } else if (e.index == 1) {
+							uni.navigateTo({
+								url: '/pagesGood/orderPay?flag=2&orderType=3&paySum=' + this.goodData.bizPrice
+							});
+						// }
 					}
 				} else {
 					this.$refs.popup.open()
@@ -485,6 +499,30 @@
 				color: #999999;
 			}
 		}
+		
+		.buy-num {
+			display: flex;
+			justify-content: flex-end;
+			height: 46px;
+			margin-top: 10px;
+			box-sizing: border-box;
+			background-color: #FFFFFF;
+			padding: 14px 16px;
+			font-family: PingFang SC;
+			// font-size: 12px;
+			// line-height: 14px;
+			.buy-text {
+				margin-right: 10px;
+			}			
+			.buy-select {
+				font-size: 16px;
+				font-family: PingFang SC;
+				color: #343434;
+				margin: 0 12px;
+				line-height: 20px;
+				margin-right: 10px;
+			}
+		}
 
 		.tab-box {
 			height: 50px;

+ 7 - 3
pagesGood/goodList.vue

@@ -5,12 +5,13 @@
 			 bgColor="#ffffff" @confirm="search" class="search-bar" />
 		</view>
 		<scroll-view class="goods-box" scroll-y="true" @scrolltolower="handleLoadMore()">
-			<view class="goods-row" v-for="(item, index) in goodsList" :key="index" @click="goToGoodDetails(item)">
+			<view class="goods-row" :style="{height: (item.productType == 2 ? '124px' : '104px')}" 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-details" v-if="item.productType != 4">{{item.productDescribe}}</view>
 					<view class="goods-area" v-if="item.productType == 4">面积:{{item.areaSize}}㎡&nbsp;&nbsp;&nbsp;&nbsp;时长:{{item.term}}天</view>
+					<view class="goods-endTime" v-if="item.productType == 2">结束时间: {{item.auctionEndTime}}</view>
 					<view class="goods-number">
 						<text class="goods-icon">¥</text>
 						<text class="goods-spec">{{item.bizPrice}}{{item.productType != 4 ? '/' + item.unit : ''}}</text>
@@ -256,7 +257,7 @@
 						-webkit-line-clamp: 2;
 						-webkit-box-orient: vertical;
 						word-wrap: break-word;
-						margin: 4px 0 12px 0;
+						margin: 4px 0 10px 0;
 					}
 
 					.goods-area {
@@ -267,7 +268,10 @@
 						font-family: PingFang SC;
 						color: #666666;
 					}
-
+                    .goods-endTime {
+						margin-bottom: 10px;
+						font-size: 12px;
+					}
 					.goods-number {
 						height: 16px;
 						font-family: PingFang SC;

+ 12 - 10
pagesGood/orderPay.vue

@@ -32,7 +32,7 @@
 						<view class="plant-area" v-if="orderType == 3">面积:{{orderData.areaSize}}㎡</view>
 						<view class="goods-price-number">
 							<text class="goods-unit">¥</text>
-							<text class="goods-price">{{orderType == 1 ? item.bizPrice : paySum}}</text>
+							<text class="goods-price">{{(orderType == 1 || orderType == 3) ? item.bizPrice : paySum}}</text>
 							<text class="goods-number">x{{item.buyNum}}</text>
 							<text class="plant-text" v-if="orderType == 3">有效期:{{orderData.term}}天</text>
 						</view>
@@ -42,7 +42,7 @@
 			<view class="order-info">
 				<u-cell-group :border="false">
 					<u-cell-item title="商品金额" :arrow="false" :border-bottom="false" title-width="170" :title-style="{textAlign: 'right'}">
-						<text class="order-text-right">¥{{orderType == 1 ? getAllGoodsInitialPrice() : paySum}}</text>
+						<text class="order-text-right">¥{{(orderType == 1 || orderType == 3) ? getAllGoodsInitialPrice() : paySum}}</text>
 					</u-cell-item>
 					<u-cell-item title="积分抵扣" :arrow="false" :border-bottom="false" title-width="170" :title-style="{textAlign: 'right'}"
 					 v-if="orderType == 1">
@@ -65,14 +65,14 @@
 			<view class="pay-info">
 				<text class="pay-text">共{{getAllGoodsNumber()}}件</text>
 				<text class="pay-text">总计</text>
-				<text class="pay-price">¥{{orderType == 1 ? getAllGoodsPrice() : paySum}}</text>
+				<text class="pay-price">¥{{(orderType == 1 || orderType == 3) ? getAllGoodsPrice() : paySum}}</text>
 			</view>
 		</view>
 		<view class="handle-box">
 			<view class="handle-info">
 				<text class="handle-text" style="margin-right: 12px;">共{{getAllGoodsNumber()}}件</text>
 				<text class="handle-text">合计:</text>
-				<text class="handle-price">¥{{orderType == 1 ? getAllGoodsPrice() : paySum}}</text>
+				<text class="handle-price">¥{{(orderType == 1 || orderType == 3) ? getAllGoodsPrice() : paySum}}</text>
 			</view>
 			<view class="handle-button" @click="submitOrder()">提交订单</view>
 		</view>
@@ -253,7 +253,7 @@
 						type: 'warning',
 					})
 				} else {
-					let paySum = this.orderType == 1 ? this.getAllGoodsPrice() : this.paySum
+					let paySum = (this.orderType == 1 || this.orderType == 3) ? this.getAllGoodsPrice() : this.paySum
 					NET.request(API.submitOrder, {
 						//  会员
 						mid: this.userData.userId,
@@ -275,22 +275,24 @@
 								...site,
 								supplierName: this.orderData.supplierName,
 								tenantCode: this.orderData.tenantCode,
-								bizPrice: this.orderType == 1 ? site.bizPrice : this.paySum,
+								bizPrice: (this.orderType == 1 || this.orderType == 3) ? site.bizPrice : this.paySum,
 							}
 						}),
 						//  优惠券
 						couponId: this.orderType == 1 ? this.coupon.couponId : '',
+						// 优惠券优惠总额
 						couponDiscountAmount: this.orderType == 1 ? this.coupon.discountAmount : '',
 						couponType: this.orderType == 1 ? this.coupon.couponType : '',
 						//  积分
 						integralValue: this.orderType == 1 ? this.getIntegral() : 0,
+						// 积分优惠总额
 						integralAmount: this.orderType == 1 ? this.getIntegral() / 100 : 0,
-						//  金额
-						discountAmount: this.orderType == 1 ? (parseFloat(this.coupon.discountAmount) + (this.getIntegral() / 100)) : 0,
-						orderSum: this.orderType == 1 ? this.orderData.goodsList.reduce((total, site) => {
+						//  总优惠金额
+						discountAmount: this.orderType == 1 ? (parseFloat(this.coupon.discountAmount) + (this.getIntegral() / 100)) : 0,               // 订单总金额(优惠前)
+						orderSum: (this.orderType == 1 || this.orderType == 3) ? this.orderData.goodsList.reduce((total, site) => {
 							return total + site.bizPrice * site.buyNum
 						}, 0) : this.paySum,
-						paySum: this.orderType == 1 ? this.getAllGoodsPrice() : this.paySum,
+						paySum: (this.orderType == 1 || this.orderType == 3) ? this.getAllGoodsPrice() : this.paySum,
 						//  支付类型
 						flag: this.flag,
 						orderType: this.orderType,

+ 3 - 1
pagesMain/entrustForm.vue

@@ -61,6 +61,7 @@
 			this.entrustForm.tenantCode = options.tenantCode
 			this.entrustForm.areaSize = options.areaSize
 			this.getPrice()
+			this.orderId = options.orderId
 		},
 		methods: {
 			//  设置时间
@@ -106,7 +107,8 @@
 					//  数据
 					...this.entrustForm,
 					entrustDurationTime: JSON.stringify(this.entrustForm.entrustDurationTime),
-					payAomount: this.price * Number(this.entrustForm.entrustDurationTime)
+					payAomount: this.price * Number(this.entrustForm.entrustDurationTime),
+					orderId: Number(this.orderId)
 				}, 'POST').then(res => {
 					if (res.isSuccess) {
 						if (res.data) {

+ 3 - 1
pagesMain/entrustList.vue

@@ -35,6 +35,7 @@
 				isOver: false,
 				entrustList: [],
 				entrustTotle: 0,
+				orderId: ''
 			}
 		},
 		onLoad(options) {
@@ -44,6 +45,7 @@
 				tenantCode: options.tenantCode,
 				areaSize: options.areaSize,
 			}
+			this.orderId = options.orderId
 		},
 		onShow() {
 			this.pageIndex = 1
@@ -97,7 +99,7 @@
 			goToAdd() {
 				uni.navigateTo({
 					url: '/pagesMain/entrustForm?productId=' + this.productData.productId + '&tenantCode=' + this.productData.tenantCode +
-						'&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize
+						'&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize + '&orderId=' + this.orderId
 				});
 			},
 		},

+ 20 - 5
pagesMain/orderDetail.vue

@@ -254,11 +254,26 @@
 						}]
 						break;
 					case '4':
-						this.buttonGroup = [{
-							text: '申请售后',
-							backgroundColor: '#75BD60',
-							color: '#fff'
-						}]
+						if (this.orderData.merchantInfoResVO.products.every(v => {
+								Number(v.productType)
+								return v.productType == 4
+							})) {
+								this.buttonGroup = [{
+									text: '申请售后',
+									backgroundColor: '#75BD60',
+									color: '#fff'
+								}, {
+									text: '我的种植',
+									backgroundColor: '#52A63A',
+									color: '#fff'
+								}]
+						} else {
+							this.buttonGroup = [{
+								text: '申请售后',
+								backgroundColor: '#75BD60',
+								color: '#fff'
+							}]
+						}
 						break;
 					default:
 						this.buttonGroup = [{

+ 13 - 0
pagesMain/orderItem.vue

@@ -32,10 +32,16 @@
 			 v-if="tabIndex != 1 && tabIndex != 2" @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="tabIndex == 3 && pickHandle" @click.stop="handleOrder(4)">自助采摘</u-button>
+			 <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
+			  v-if="tabIndex == 3 && sharePlant" @click.stop="handleOrder(8)">我的种植</u-button>
+			  <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
+			   v-if="tabIndex == 4 && sharePlant" @click.stop="handleOrder(8)">我的种植</u-button>
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 4" @click.stop="handleOrder(5)">确认收货</u-button>
 			<u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
 			 v-if="tabIndex == 4" @click.stop="handleOrder(6)">追踪物流</u-button>
+			 <u-button size="medium" :plain="true" type="success" shape="circle" :ripple="true" :hair-line="false" class="handle-button"
+			  v-if="tabIndex == 5 && sharePlant" @click.stop="handleOrder(8)">我的种植</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 == 1" @click.stop="handleOrder(7)">评价</u-button>
 		</view>
@@ -80,6 +86,7 @@
 		data() {
 			return {
 				pickHandle: false,
+				sharePlant: false,
 				modalShow: false,
 				modalContent: '',
 				handleType: '',
@@ -87,6 +94,7 @@
 		},
 		onReady() {
 			this.pickHandle = this.orderData.products.filter(site => site.productType == 3).length > 0
+			this.sharePlant = this.orderData.products.filter(site => site.productType == 4).length > 0
 		},
 		methods: {
 			//  跳转商铺
@@ -180,6 +188,11 @@
 								return site.productId
 							}).join(',')
 					});
+				} else if (type == 8) {
+					//  去我的种植
+					uni.navigateTo({
+						url: '/pagesGood/goodDetails?minePlant=true&goodId=' + this.orderData.products[0].productId + '&orderId=' + this.orderData.orderId
+					});
 				}
 			},
 			//  跳转订单详情

+ 1 - 1
pagesMain/plantList.vue

@@ -84,7 +84,7 @@
 			//  跳转详情
 			goToGoodDetail(item) {
 				uni.navigateTo({
-					url: '/pagesGood/goodDetails?minePlant=true&goodId=' + item.id
+					url: '/pagesGood/goodDetails?minePlant=true&goodId=' + item.id + '&orderId=' + item.orderId
 				});
 			},
 		},