Bladeren bron

bug修复样式优化

zhaoxw 4 jaren geleden
bovenliggende
commit
bd5fb4dc22

+ 4 - 4
pages/user/index.vue

@@ -39,25 +39,25 @@
 			<view class="order-box">
 				<view class="order-item" @click="orderClick(2)">
 					<view class="iconfont icondaifukuan order-item-icon">
-						<view v-if="num.unPay" class="order-item-icon-num">{{num.unPay}}</view>
+						<view v-if="num.unPay" class="order-item-icon-num">{{num.unPay < 99 ? num.unPay : '99+'}}</view>
 					</view>
 					<view class="order-item-text">待付款</view>
 				</view>
 				<view class="order-item" @click="orderClick(3)">
 					<view class="iconfont icondaifahuo order-item-icon">
-						<view v-if="num.unSend" class="order-item-icon-num">{{num.unSend}}</view>
+						<view v-if="num.unSend" class="order-item-icon-num">{{num.unSend < 99 ? num.unSend : '99+'}}</view>
 					</view>
 					<view class="order-item-text">待发货</view>
 				</view>
 				<view class="order-item" @click="orderClick(4)">
 					<view class="iconfont icondaishouhuo order-item-icon">
-						<view v-if="num.unReceive" class="order-item-icon-num">{{num.unReceive}}</view>
+						<view v-if="num.unReceive" class="order-item-icon-num">{{num.unReceive < 99 ? num.unReceive : '99+'}}</view>
 					</view>
 					<view class="order-item-text">待收货</view>
 				</view>
 				<view class="order-item" @click="orderClick(5)">
 					<view class="iconfont icondaipingjia order-item-icon">
-						<view v-if="num.unComment" class="order-item-icon-num">{{num.unComment}}</view>
+						<view v-if="num.unComment" class="order-item-icon-num">{{num.unComment < 99 ? num.unComment : '99+'}}</view>
 					</view>
 					<view class="order-item-text">待评价</view>
 				</view>

+ 7 - 4
pagesGood/auctionDetail.vue

@@ -5,12 +5,12 @@
 			{{goodData.auctionEndTime}}结束
 		</view>
 		<view class="good-info-box">
-			<image class="goods-img" :src="goodData.imgPath"></image>
+			<image mode="aspectFill" class="goods-img" :src="goodData.imgPath"></image>
 			<view class="goods-info">
 				<view class="goods-name">{{goodData.productName}}</view>
 				<view class="goods-price">
 					<text class="text">当前价格¥</text>
-					<text class="price">{{goodData.currentPrice}}/{{goodData.unit}}</text>
+					<text class="price">{{goodData.currentPrice == 0 ? goodData.auctionStartPrice : goodData.currentPrice}}/{{goodData.unit}}</text>
 				</view>
 			</view>
 		</view>
@@ -28,8 +28,8 @@
 				<view class="auction-line"></view>
 				<view class="auction-point"></view>
 				<view class="auction-title" v-if="item.nickname || item.paySum">
-					<text class="auction-name" v-if="item.nickname">{{item.nickname}}出价:</text>
-					<text class="auction-price" v-if="item.paySum">¥{{item.paySum.slice(0,)}}</text>
+					<text class="auction-name" v-if="item.nickname">{{item.nickname}}</text>
+					<text class="auction-price" v-if="item.paySum">¥{{item.paySum}}</text>
 				</view>
 				<text class="auction-date" v-if="item.payTime">{{item.payTime}}</text>
 			</view>
@@ -51,6 +51,7 @@
 					currentPrice: 0,
 					auctionMinAddPrice: 0,
 					unit: '',
+					auctionStartPrice:0
 				},
 				price: 0,
 				auctionBaseList: [{
@@ -89,9 +90,11 @@
 						productName: res.data.productName,
 						currentPrice: parseFloat(res.data.currentPrice),
 						auctionMinAddPrice: parseFloat(res.data.auctionMinAddPrice),
+						auctionStartPrice: res.data.auctionStartPrice,
 						unit: res.data.unit,
 						auctionEndTime: res.data.auctionEndTime,
 					}
+					this.auctionBaseList[0].paySum = res.data.auctionStartPrice
 					this.auctionBaseList[1].payTime = '竞拍截止时间:' + res.data.auctionEndTime
 					this.auctionBaseList[2].payTime = '竞拍于 '+res.data.auctionStartTime +' 正式开始!'
 					this.auctionList = res.data.userPriceResVOs.concat(this.auctionBaseList)

+ 9 - 0
pagesGood/goodDetails.vue

@@ -167,6 +167,15 @@
 					this.swiperHeight = res.windowWidth
 				}
 			})
+			if (this.minePlant) {
+				uni.setNavigationBarTitle({
+				    title:'我的种植'
+				})
+			} else {
+				uni.setNavigationBarTitle({
+				    title:'商品详情'
+				})
+			}
 		},
 		onReady() {
 			this.getGoodsList()

+ 47 - 21
pagesGood/goodList.vue

@@ -5,9 +5,6 @@
 			 bgColor="#ffffff" @confirm="search" class="search-bar" />
 		</view>
 		<scroll-view class="goods-box" scroll-y="true" @scrolltolower="handleLoadMore()">
-			<view style="padding-top: 20px;background-color: transparent;" v-if="!goodsList.length">
-				<u-divider color="#909399" border-color="#909399" bg-color="transparent">没有更多了</u-divider>
-			</view>
 			<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">
@@ -22,7 +19,7 @@
 					</view>
 				</view>
 				<view class="goods-cart">
-					<view class="cart-button" v-if="goodType == 1 || goodType == 3" @click.stop="addCart(item)">
+					<view class="cart-button" v-if="goodType == 1 || goodType == 3 || goodType == 5" @click.stop="addCart(item)">
 						<view class="iconfont icongouwuche"></view>
 					</view>
 					<view class="more-button" v-else>
@@ -30,6 +27,9 @@
 					</view>
 				</view>
 			</view>
+			<view style="padding-top: 20px;background-color: transparent;" v-if="isOver">
+				<u-divider color="#909399" border-color="#909399" bg-color="transparent">没有更多了</u-divider>
+			</view>
 		</scroll-view>
 		<u-modal v-model="modalShow" content="是否将该商品添加至购物车" @confirm="submitAddCart()" :async-close="true"
 		 :show-cancel-button="true"></u-modal>
@@ -60,6 +60,9 @@
 			});
 			this.getGoodsList()
 		},
+		onShow() {
+			this.getGoodsList()
+		},
 		onReady() {
 			if (this.goodName) {
 				this.$refs.searchBar.show = true
@@ -89,28 +92,46 @@
 			},
 			//  获取商品
 			getGoodsList(type) {
-				NET.request(API.getGoodsByType, {
-					name: this.goodName,
-					productType: this.goodType,
-					pageIndex: this.pageIndex,
-					pageSize: 10,
-				}, 'POST').then(res => {
-					if (type == 'refresh') {
-						uni.stopPullDownRefresh();
-					}
-					this.isOver = res.data.list.length != 10
-					this.goodsList = this.goodsList.concat(res.data.list)
-				}).catch(error => {
-					this.$refs.uTips.show({
-						title: '获取商品列表失败',
-						type: 'warning',
+				if (this.goodType == 5) {
+					NET.request(API.getPreferentialGoods+'/' + this.pageIndex+'/10', {
+						name: this.goodName
+					}, 'GET').then(res => {
+						if (type == 'refresh') {
+							uni.stopPullDownRefresh();
+						}
+						this.isOver = res.data.list.length != 10
+						this.goodsList = this.goodsList.concat(res.data.list)
+					}).catch(error => {
+						this.$refs.uTips.show({
+							title: '获取今日特惠商品列表失败',
+							type: 'warning',
+						})
 					})
-				})
+				} else {
+					NET.request(API.getGoodsByType, {
+						name: this.goodName,
+						productType: this.goodType,
+						pageIndex: this.pageIndex,
+						pageSize: 10,
+					}, 'POST').then(res => {
+						if (type == 'refresh') {
+							uni.stopPullDownRefresh();
+						}
+						this.isOver = res.data.list.length != 10
+						this.goodsList = this.goodsList.concat(res.data.list)
+					}).catch(error => {
+						this.$refs.uTips.show({
+							title: '获取商品列表失败',
+							type: 'warning',
+						})
+					})
+				}
 			},
 			//  添加购物车
 			addCart(item) {
+                debugger
 				this.goodItem = {
-					productId: item.id,
+					productId: this.goodType == 5 ? item.productId : item.id,
 					productName: item.productName,
 					imgUrl: item.imgPath,
 					bizPrice: item.bizPrice,
@@ -139,6 +160,9 @@
 			},
 			//  跳转商品详情
 			goToGoodDetails(item) {
+				if (this.goodType == 5) {
+					item.id = item.productId
+				}
 				uni.navigateTo({
 					url: '/pagesGood/goodDetails?goodId=' + item.id
 				});
@@ -149,6 +173,8 @@
 
 <style>
 	page {
+		width: 100%;
+		height: 100%;
 		background-color: #f7f7f7;
 	}
 </style>

+ 2 - 2
pagesMain/couponList.vue

@@ -14,8 +14,8 @@
 				<view class="coupon-info">
 					<view class="coupon-text1">{{site.couponName}}</view>
 					<view class="coupon-text1" style="margin-bottom: 4px;">满{{site.fullAmount}}减{{site.discountAmount}}</view>
-					<view class="coupon-text2">{{site.couponType == 1 ? '仅限用于' + site.name + '的店铺' : ''}}</view>
-					<view class="coupon-text2" style="color: #999999;">有效期:{{site.term}}</view>
+					<view class="coupon-text2">{{site.couponType == 1 ? '仅限用于' + site.name + '的店铺' : '通用优惠券'}}</view>
+					<view class="coupon-text2" style="color: #999999;">有效期:{{site.termDate}}</view>
 				</view>
 			</view>
 			<u-divider :color="isOver ? '#909399' : '#51A539'" :border-color="isOver ? '#909399' : '#51A539'" @click="handleLoadMore()">

+ 1 - 1
pagesMain/entrustForm.vue

@@ -5,7 +5,7 @@
 				<u-cell-item title="委托金额" title-width="180" :arrow="false" :value="price">
 					<!-- <u-number-box digit :positive-integer="false" :min="0" v-model="entrustForm.payAomount" bg-color="#51A539" color="#ffffff"></u-number-box> -->
 				</u-cell-item>
-				<u-cell-item title="委托时长" title-width="180" :arrow="false">
+				<u-cell-item title="委托时长(小时)" title-width="190" :arrow="false">
 					<u-number-box digit :min="1" v-model="entrustForm.entrustDurationTime" bg-color="#51A539" color="#ffffff"></u-number-box>
 				</u-cell-item>
 				<u-cell-item title="委托开始时间" title-width="180" @click="dateShow = true">

+ 2 - 1
pagesMain/entrustList.vue

@@ -117,7 +117,8 @@
 
 	.container {
 		width: 100%;
-		height: 100%;
+		// height: 100%;
+		height: 100vh;
 		float: left;
 		background-color: #f7f7f7;
 		// background-color: #FFFFFF;

+ 104 - 47
pagesMain/orderDetail.vue

@@ -21,7 +21,7 @@
 			<view class="shop-info" @click.stop="gotoShop()">
 				<text class="iconfont icondianpu"></text>
 				<text class="shop-name">{{orderData.merchantInfoResVO.supplierName}}</text>
-				<text class="iconfont iconfangxiang"></text>
+				<text class="iconfont iconfangxiang" v-if="orderData.tenantCode != 'admin'"></text>
 			</view>
 			<view class="goods-list">
 				<view class="goods-row" v-for="(item, index) in orderData.merchantInfoResVO.products" :key="index">
@@ -81,8 +81,8 @@
 				<view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
 				<view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
 				<view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime ? orderData.payTime : orderData.addOrderTime}}</view>
-				<view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6 && orderData.orderStatus != 4">发货时间:{{orderData.sendTime}}</view>
-				<view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6 && orderData.orderStatus != 4">收货时间:{{orderData.confirmTime}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6 && orderData.orderStatus != 4">发货时间:{{orderData.sendTime ? orderData.sendTime : '-'}}</view>
+				<view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6 && orderData.orderStatus != 4">收货时间:{{orderData.confirmTime ? orderData.sendTime : '-'}}</view>
 				<view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
 			</view>
 		</view>
@@ -92,7 +92,7 @@
 			</view>
 			<view class="info-content-box">
 				<view class="assess-row">
-					<image class="assess-head" :src="orderData.merchantInfoResVO.headImg"></image>
+					<image class="assess-head" mode="aspectFill" :src="orderData.merchantInfoResVO.headImg"></image>
 					<view class="assess-info">
 						<view class="assess-name">{{orderData.nickname}}</view>
 						<view class="assess-date">{{orderData.evaluateResVO.evaluateTime ? orderData.evaluateResVO.evaluateTime : ''}}</view>
@@ -101,7 +101,7 @@
 						</view>
 						<view class="assess-text">{{orderData.evaluateResVO.evaluateContent ? orderData.evaluateResVO.evaluateContent : '暂无评价'}}</view>
 						<view class="assess-img-box">
-							<image class="img-col" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs" :key="i"></image>
+							<image class="img-col" mode="aspectFill" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs" :key="i" @tap="_previewImage(item.imgUrl,i)"></image>
 						</view>
 					</view>
 					<view class="shop-reply-box" v-if="orderData.evaluateResVO.replyContent">
@@ -288,43 +288,88 @@
 		methods: {
 			//  获取订单类型
 			getOrderType() {
-				switch (this.orderData.orderStatus) {
-					case 1:
-						this.orderType = {
-							title: '等待买家付款',
-							text: '订单将于' + this.orderData.overTime + '关闭',
-							date: this.orderData.overTime
-						}
-						break;
-					case 2:
-						this.orderType = {
-							title: '等待卖家发货',
-							text: '您的商品正在打包等待发货',
-						}
-						break;
-					case 3:
-						this.orderType = {
-							title: '等待商品送达',
-							text: '您的商品已发出正在路上,请耐心等待',
-						}
-						break;
-					case 4:
-						this.orderType = {
-							title: '商品已送达',
-							text: '',
-						}
-						break;
-					case 5:
-						this.orderType = {
-							title: '交易已完成',
-							text: '',
-						}
-						break;
-					default:
-						this.orderType = {
-							title: '交易已取消',
-							text: '',
-						}
+				if (!this.orderData.auctionStatus) {
+					switch (this.orderData.orderStatus) {
+						case 1:
+							this.orderType = {
+								title: '等待买家付款',
+								text: '订单将于' + this.orderData.overTime + '关闭',
+								date: this.orderData.overTime
+							}
+							break;
+						case 2:
+							this.orderType = {
+								title: '等待卖家发货',
+								text: '您的商品正在打包等待发货',
+							}
+							break;
+						case 3:
+							this.orderType = {
+								title: '等待商品送达',
+								text: '您的商品已发出正在路上,请耐心等待',
+							}
+							break;
+						case 4:
+							this.orderType = {
+								title: '商品已送达',
+								text: '',
+							}
+							break;
+						case 5:
+							this.orderType = {
+								title: '交易已完成',
+								text: '',
+							}
+							break;
+						default:
+							this.orderType = {
+								title: '交易已取消',
+								text: '',
+							}
+					}
+				} else {
+					switch (this.orderData.auctionStatus) {
+						case 1:
+							this.orderType = {
+								title: '竞拍中',
+								text: '',
+							}
+							break;
+						case 2:
+						    switch (this.orderData.orderStatus) {
+						    	case 2:
+						    		this.orderType = {
+						    			title: '竞拍成功-等待卖家发货',
+						    			text: '您的商品正在打包等待发货',
+						    		}
+						    		break;
+								case 3:
+									this.orderType = {
+										title: '竞拍成功-等待商品送达',
+										text: '您的商品已发出正在路上,请耐心等待',
+									}
+									break;
+								case 4:
+									this.orderType = {
+										title: '竞拍成功-商品已送达',
+										text: '',
+									}
+									break;
+								case 5:
+									this.orderType = {
+										title: '竞拍成功-交易已完成',
+										text: '',
+									}
+									break;
+							}
+							break;
+						case 3:
+							this.orderType = {
+								title: '竞拍失败',
+								text: '',
+							}
+							break;
+					}
 				}
 			},
 			//  操作
@@ -483,12 +528,24 @@
 			},
 			//  跳转商铺
 			gotoShop() {
-				if (this.orderData.merchantInfoResVO.products.length) {
-					uni.navigateTo({
-						url: '/pagesGood/shopDetails?goodId=' + this.orderData.merchantInfoResVO.products[0].productId
-					});
+				if (this.orderData.tenantCode != 'admin') {
+					if (this.orderData.merchantInfoResVO.products.length) {
+						uni.navigateTo({
+							url: '/pagesGood/shopDetails?goodId=' + this.orderData.merchantInfoResVO.products[0].productId
+						});
+					}
 				}
-			}
+			},
+			// 图片预览
+			_previewImage(image,index) {
+				var imgArr = [];
+				imgArr.push(image);
+				//预览图片
+				uni.previewImage({
+					urls: imgArr,
+					current: imgArr[index]
+				});
+			} 
 		}
 	}
 </script>

+ 3 - 3
pagesMain/orderItem.vue

@@ -4,7 +4,7 @@
 			<text class="iconfont icondianpu"></text>
 			<text class="shop-name">{{orderData.supplierName}}</text>
 			<text class="iconfont iconfangxiang" v-if="orderData.tenantCode != 'admin'"></text>
-			<text class="order-type">{{orderData.auctionStatus == null ? getOrderType(orderData.orderStatus) : getAuctionType(orderData.auctionStatus)}}</text>
+			<text class="order-type">{{orderData.auctionStatus == null ? getOrderType(orderData.orderStatus) : getAuctionType(orderData.auctionStatus,orderData.orderStatus)}}</text>
 		</view>
 		<view class="goods-list" v-if="orderData">
 			<view class="goods-row" v-for="(site, index) in orderData.products" :key="index">
@@ -129,13 +129,13 @@
 				}
 			},
 			//  获取拍卖状态
-			getAuctionType(type) {
+			getAuctionType(type, orderStatus) {
 				switch (type) {
 					case 1:
 						return '竞拍中'
 						break;
 					case 2:
-						return '竞拍成功'
+						return '竞拍成功' + '-' + this.getOrderType(orderStatus)
 						break;
 					case 3:
 						return '竞拍失败'

+ 6 - 0
pagesMain/paySuccess.vue

@@ -5,6 +5,7 @@
 		</view>
 		<view class="pay-title">支付成功</view>
 		<view class="pay-text">您已支付成功,您所购买的商品正在向您飞奔, 请耐心等待!</view>
+		<view class="pay-text">3秒后自动跳转订单详情...</view>
 		<view class="pay-handle">
 			<u-button type="success" shape="circle" :ripple="true" @click="goToOrderList()" class="button1">查看订单</u-button>
 			<u-button type="success" shape="circle" :ripple="true" :hair-line="false" :plain="true" @click="goToIndex()" class="button2">返回首页</u-button>
@@ -23,6 +24,11 @@
 		},
 		onLoad(options) {
 			this.orderId = options.orderId
+			setTimeout(() => {
+				uni.redirectTo({
+					url: '/pagesMain/orderDetail?orderId=' + this.orderId + '&orderStatus=' + 2
+				});
+			},3000)
 		},
 		methods: {
 			//  查看订单