zhaoxw 4 år sedan
förälder
incheckning
abf1a98501

+ 60 - 4
pages/cart/cart.vue

@@ -1,11 +1,16 @@
 <template>
 	<view class="container">
-		<view class="swiper">
+		<view class="swiper" :style="{height: getCartAllGoods() ? '120px' : '60px'}">
 			<view class="swiper-text">共{{getCartAllGoods()}}件商品</view>
-			<view class="swiper-text" style="float: right;" @click="manageType = !manageType">{{manageType ? '完成' :'管理'}}</view>
+			<view v-if="cartsList.length" class="swiper-text" style="float: right;" @click="manageType = !manageType">{{manageType ? '完成' :'管理'}}</view>
 		</view>
 		<view class="cart-box" :style="{bottom: manageType ? '52px' : '0px'}">
-			<view class="shop-row" v-for="(item, index1) in cartsList" :key="index1">
+			<view class="no-cart" v-if="!cartsList.length">
+				<image class="no-cart-img" src="../../static/images/noCart.png" mode="aspectFill"></image>
+				<text class="no-cart-text">购物车暂无商品</text>
+				<u-button type="success" shape="circle" :ripple="true" :hair-line="false" :plain="true" @click="goToMall" class="button1">去逛逛</u-button>
+			</view>
+			<view v-if="cartsList.length" class="shop-row" v-for="(item, index1) in cartsList" :key="index1">
 				<view class="shop-info">
 					<view class="iconfont" :class="item.allCheck ? 'iconqueding' : 'iconfeigouxuan'" @click="checkShop(item)"></view>
 					<view class="shop-info-right" @click="goToShop(item)">
@@ -67,6 +72,9 @@
 				manageType: false,
 				modalShow: false,
 			}
+		},
+		onLoad() {
+			
 		},
 		onShow() {
 			this.cartsList = []
@@ -77,6 +85,12 @@
 			this.getCartData('refresh')
 		},
 		methods: {
+			// 跳转商城
+			goToMall() {
+				uni.switchTab({
+					url: '/pages/shop/index'
+				});
+			},
 			//  跳转商铺页
 			goToShop(item) {
 				uni.navigateTo({
@@ -293,7 +307,49 @@
 				padding: 16px 15px;
 			}
 		}
-
+		.swiper2 {
+			width: 100%;
+			height: 60px;
+			float: left;
+			background-color: #56a83a;
+			border-radius: 0 0 40px 40px;
+		
+			.swiper-text {
+				float: left;
+				line-height: 16px;
+				font-size: 15px;
+				color: #FFFFFF;
+				padding: 16px 15px;
+			}
+		}
+        .no-cart {
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			align-items: center;
+			top: 50px;
+			position: relative;
+			.no-cart-img {
+				width: 155px;
+				height: 200px;
+				margin-bottom: 20px;
+			}
+			.no-cart-text {
+				font-size: 16px;
+				font-family: PingFang SC;
+				color: #999999;
+				margin-bottom: 60px;
+			}
+			.button1 {
+				/deep/button {
+					background-color: #ffffff !important;
+					border: 1px solid #74bd60 !important;
+					color: #74bd60 !important;
+				}
+				width: 40%;
+				height: 34px;
+			}
+		}
 		.cart-box {
 			width: calc(100% - 30px);
 			min-height: calc(100vh - 40px - 50px);

+ 7 - 1
pagesGood/evaluateList.vue

@@ -40,13 +40,18 @@
 				pageIndex: 1,
 				isOver: false,
 				assessList: [],
+				preview: false
 			}
 		},
 		onLoad(options) {
 			this.goodId = options.goodId
 		},
 		onShow() {
-			this.getMessageList()
+			if (!this.preview) {
+				this.pageIndex = 1
+				this.assessList = []
+				this.getMessageList('refresh')
+			}
 		},
 		onPullDownRefresh() {
 			this.pageIndex = 1
@@ -78,6 +83,7 @@
 			},
 			// 图片预览
 			_previewImage(image,index) {
+				this.preview = true
 				var imgArr = [];
 				imgArr.push(image);
 				//预览图片

+ 100 - 30
pagesGood/goodDetails.vue

@@ -1,5 +1,35 @@
 <template>
 	<view class="container">
+		<view v-if="goodData.productType == 2">
+			<view class="auction-title" @click="isOpen = !isOpen">拍卖规则
+			    <u-icon :name="isOpen?'arrow-up-fill':'arrow-down-fill'" color="#ffffff" style="margin-left:5px"></u-icon>
+			</view>
+			<view v-if="isOpen" class="auction-explain">
+				<span>特别注意:</span>
+				<p>本商城拍卖采用竞拍即付款的拍卖方式,每名会员每次拍卖仅能购买一件拍卖商品,同时根据拍卖商品的数量也可能会有多个会员竞拍成功。</p>
+				<span>关于退款:</span>
+				<p>会员出价如果已经不具有竞拍成功资质(也就是出价已经不是最高出价的几名会员之一时),则会立刻退还费用。同一会员多次出价会立刻退还上次出价的费用。</p>
+				<span>关于竞拍结果:</span>
+				<p>拍卖结束时,出价最高的几名会员竞拍成功,至多有"拍卖商品数量"个竞拍成功的会员。</p>
+			</view>
+		</view>
+		<!-- <u-collapse v-if="goodType == 2" :head-style="auctiontitle">
+			<u-collapse-item>
+				<view slot="title-all" class="auction-title" @click="isOpen = !isOpen">拍卖规则
+					<u-icon :name="isOpen?'arrow-up-fill':'arrow-down-fill'" color="#ffffff" style="margin-left:5px"></u-icon>
+				</view>
+				<view class="auction-main">
+					<view class="auction-explain">
+						<span>特别注意:</span>
+						<p>本商城拍卖采用竞拍即付款的拍卖方式,每名会员每次拍卖仅能购买一件拍卖商品,同时根据拍卖商品的数量也可能会有多个会员竞拍成功。</p>
+						<span>关于退款:</span>
+						<p>会员出价如果已经不具有竞拍成功资质(也就是出价已经不是最高出价的几名会员之一时),则会立刻退还费用。同一会员多次出价会立刻退还上次出价的费用。</p>
+						<span>关于竞拍结果:</span>
+						<p>拍卖结束时,出价最高的几名会员竞拍成功,至多有"拍卖商品数量"个竞拍成功的会员。</p>
+					</view>
+				</view>
+			</u-collapse-item>
+		</u-collapse> -->
 		<swiper class="swiper" :style="{width: swiperHeight+'px', height: swiperHeight+'px'}" :indicator-dots="true" indicator-color="#9A9A9A" indicator-active-color="#52A63A" :autoplay="true"
 		 :interval="3000" :duration="500">
 			<swiper-item v-for="(item,index) in goodData.imgs" :key="index">
@@ -34,27 +64,34 @@
  -->
 		</view>
 		<view class="buy-num" v-if="goodData.productType != 2 && !minePlant">
-			<view class="buy-text">购买数量:</view>
-			<!-- <view style="display: flex;">
-				<uni-icons type="minus-filled" size="20" color="#A67A54" @click="number>1?number--:''"></uni-icons>
-				<text class="buy-select">{{number}}</text>
-				<u-input
-				  v-model="number"
-				  type="number"
-				  height="40"
-				  placeholder=" "
-				  :clearable="false"
-				  input-align="center"
-				  :custom-style="{width:'40px'}"/>
-				<uni-icons type="plus-filled" size="20" color="#A67A54" @click="number++"></uni-icons>
-			</view> -->
-			<view>
-				<CnumberBox @getNum="getNum" :isDisabled="true" minNum="1"></CnumberBox>
+			<view class="buy-num1">
+				<view class="buy-text">库存:</view>
+				<view class="buy-select">{{goodData.stock}}</view>
+			</view>
+			<view class="buy-line"></view>
+			<view class="buy-num1">
+				<view class="buy-text">购买数量:</view>
+				<!-- <view style="display: flex;">
+					<uni-icons type="minus-filled" size="20" color="#A67A54" @click="number>1?number--:''"></uni-icons>
+					<text class="buy-select">{{number}}</text>
+					<u-input
+					  v-model="number"
+					  type="number"
+					  height="40"
+					  placeholder=" "
+					  :clearable="false"
+					  input-align="center"
+					  :custom-style="{width:'40px'}"/>
+					<uni-icons type="plus-filled" size="20" color="#A67A54" @click="number++"></uni-icons>
+				</view> -->
+				<view>
+					<CnumberBox @getNum="getNum" :isDisabled="true" minNum="1"></CnumberBox>
+				</view>
 			</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 "
+			<view class="tab-col" :class="tabIndex == 2 ? 'tab-col-active' :''" v-if="goodData.productType != 2"
 			 @click="tabIndex = 2">用户评价</view>
 		</view>
 		<rich-text :nodes="goodData.sellDesc" v-if="tabIndex == 1"></rich-text>
@@ -187,6 +224,7 @@
 					backgroundColor: '#52A63A',
 					color: '#fff'
 				}],
+				isOpen: false,
 			}
 		},
 		onLoad(options) {
@@ -450,6 +488,24 @@
 				border-radius: 8px;
 			}
 		}
+		.auction-title {
+			height: 35px;
+			background:#52A63A;
+			color: #FFFFFF;
+			text-align: center;
+			padding: 5px;
+		}
+		.auction-explain {
+			background:#52A63A;
+			color: #FFFFFF;
+			border-radius: 0 0 8px 8px;
+			// text-align: center;
+			padding: 10px;
+			p {
+			  margin-bottom: 5px;
+			  text-indent:25px;
+			}
+		}
 
 		.good-info {
 			box-sizing: border-box;
@@ -588,26 +644,40 @@
 		}
 		
 		.buy-num {
-			display: flex;
-			justify-content: space-between;
-			height: 46px;
-			margin-top: 10px;
+			height: 90px;
 			box-sizing: border-box;
 			background-color: #FFFFFF;
 			padding: 14px 16px;
 			font-family: PingFang SC;
+			margin-top: 10px;
 			// font-size: 12px;
 			// line-height: 14px;
-			.buy-text {
-				margin-right: 10px;
+			.buy-num1 {
+				display: flex;
+				justify-content: space-between;
+				margin-bottom: 10px;
+				font-size: 14px;
+				.buy-text {
+					margin-right: 10px;
+					font-size: 14px;
+				}
+				.buy-select {
+					font-size: 14px;
+					font-family: PingFang SC;
+					color: #343434;
+					// margin: 0 12px;
+					line-height: 20px;
+					// margin-right: 10px;
+				}
 			}
-			.buy-select {
-				font-size: 16px;
-				font-family: PingFang SC;
-				color: #343434;
-				margin: 0 12px;
-				line-height: 20px;
-				margin-right: 10px;
+			.buy-line {
+				width:100%;
+				height: 1px;
+				//border: 1px solid #e2e2e2;
+				margin-bottom: 10px;
+			}
+			.buy-num2 {
+				
 			}
 		}
 

+ 0 - 31
pagesGood/goodList.vue

@@ -1,35 +1,5 @@
 <template>
 	<view class="container">
-		<view v-if="goodType == 2" class="auction-main">
-			<view class="auction-title" @click="isOpen = !isOpen">拍卖规则
-			    <u-icon :name="isOpen?'arrow-up-fill':'arrow-down-fill'" color="#ffffff" style="margin-left:5px"></u-icon>
-			</view>
-			<view v-if="isOpen" class="auction-explain">
-				<span>特别注意:</span>
-				<p>本商城拍卖采用竞拍即付款的拍卖方式,每名会员每次拍卖仅能购买一件拍卖商品,同时根据拍卖商品的数量也可能会有多个会员竞拍成功。</p>
-				<span>关于退款:</span>
-				<p>会员出价如果已经不具有竞拍成功资质(也就是出价已经不是最高出价的几名会员之一时),则会立刻退还费用。同一会员多次出价会立刻退还上次出价的费用。</p>
-				<span>关于竞拍结果:</span>
-				<p>拍卖结束时,出价最高的几名会员竞拍成功,至多有"拍卖商品数量"个竞拍成功的会员。</p>
-			</view>
-		</view>
-		<!-- <u-collapse v-if="goodType == 2" :head-style="auctiontitle">
-			<u-collapse-item>
-				<view slot="title-all" class="auction-title" @click="isOpen = !isOpen">拍卖规则
-					<u-icon :name="isOpen?'arrow-up-fill':'arrow-down-fill'" color="#ffffff" style="margin-left:5px"></u-icon>
-				</view>
-				<view class="auction-main">
-					<view class="auction-explain">
-						<span>特别注意:</span>
-						<p>本商城拍卖采用竞拍即付款的拍卖方式,每名会员每次拍卖仅能购买一件拍卖商品,同时根据拍卖商品的数量也可能会有多个会员竞拍成功。</p>
-						<span>关于退款:</span>
-						<p>会员出价如果已经不具有竞拍成功资质(也就是出价已经不是最高出价的几名会员之一时),则会立刻退还费用。同一会员多次出价会立刻退还上次出价的费用。</p>
-						<span>关于竞拍结果:</span>
-						<p>拍卖结束时,出价最高的几名会员竞拍成功,至多有"拍卖商品数量"个竞拍成功的会员。</p>
-					</view>
-				</view>
-			</u-collapse-item>
-		</u-collapse> -->
 		<view class="search-box" v-if="goodsList.length">
 			<uni-search-bar ref="searchBar" radius="5" placeholder="搜索" :defaultText="goodName" clearButton="auto" cancelButton="none"
 			 bgColor="#ffffff" @confirm="search" class="search-bar" />
@@ -81,7 +51,6 @@
 				goodsList: [],
 				modalShow: false,
 				goodItem: {},
-				isOpen: false,
 				auctiontitle: {
 					height: '35px',
 					background:'#52A63A',

+ 6 - 6
pagesMain/orderDetail.vue

@@ -535,15 +535,15 @@
 							paySign: res.data.paySign,
 							success: (payRes) => {
 								console.log('success:' + JSON.stringify(payRes));
-								if (this.goodType == 3) {
-									uni.navigateTo({
-										url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
-									});
-								} else {
+								// if (this.goodType == 3) {
+								// 	uni.navigateTo({
+								// 		url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
+								// 	});
+								// } else {
 									uni.navigateTo({
 										url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
 									});
-								}
+								// }
 							},
 							fail: (error) => {
 								console.log('fail:' + JSON.stringify(error));

+ 6 - 6
pagesMain/orderItem.vue

@@ -287,15 +287,15 @@
 							paySign: res.data.paySign,
 							success: (payRes) => {
 								console.log('success:' + JSON.stringify(payRes));
-								if (this.goodType == 3) {
-									uni.navigateTo({
-										url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
-									});
-								} else {
+								// if (this.goodType == 3) {
+								// 	uni.navigateTo({
+								// 		url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
+								// 	});
+								// } else {
 									uni.navigateTo({
 										url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
 									});
-								}
+								// }
 							},
 							fail: (error) => {
 								console.log('fail:' + JSON.stringify(error));

BIN
static/images/noCart.png


+ 10 - 6
utils/request.js

@@ -7,11 +7,13 @@ const request = (url, data, method = 'GET') => {
 		if (uni.getStorageSync('token')) {
 			header.token = 'Bearer ' + uni.getStorageSync('token')
 		}
-		ajaxTimes++;
-		uni.showLoading({
-			title: "加载中",
-			mask: true,
-		});
+		if (url.indexOf('app/product/user/auctionProductDetail/biddingHall/') == -1) {
+			ajaxTimes++;
+			uni.showLoading({
+				title: "加载中",
+				mask: true,
+			});
+		}
 		uni.request({
 			url: url,
 			data: data,
@@ -41,7 +43,9 @@ const request = (url, data, method = 'GET') => {
 				reject(res)
 			},
 			complete: () => {
-				ajaxTimes--;
+				if (url.indexOf('app/product/user/auctionProductDetail/biddingHall/') == -1) {
+					ajaxTimes--;
+				}
 				if (ajaxTimes === 0) {
 					uni.hideLoading();
 				}