Explorar o código

Merge branch 'master' of http://git.liuniu946.com/xuhaolan/huilai

xuhaolan %!s(int64=3) %!d(string=hai) anos
pai
achega
50feacff47
Modificáronse 2 ficheiros con 16 adicións e 141 borrados
  1. 3 3
      pages/cart/cart.vue
  2. 13 138
      pages/shop/shop.vue

+ 3 - 3
pages/cart/cart.vue

@@ -45,7 +45,7 @@
 							<view class="item-right">
 								<text class="clamp title">{{ item.productInfo.store_name }}</text>
 								<text class="attr">{{ item.productInfo.attrInfo.suk }}</text>
-								<text class="price">¥{{ item.productInfo.price }}</text>
+								<text class="price">¥{{ item.productInfo.attrInfo? item.productInfo.attrInfo.price : item.productInfo.price }}</text>
 								<view class="munbox flex">
 									<image src="../../static/img/reduce.png" mode="" @click="reduce(item, index)"></image>
 									<input type="number" :value="item.cart_num" disabled />
@@ -106,7 +106,7 @@
 							<view class="item-right">
 								<text class="clamp title">{{ item.productInfo.store_name }}</text>
 								<text class="attr">{{ item.productInfo.attrInfo.suk }}</text>
-								<text class="price">¥{{ item.productInfo.price }}</text>
+								<text class="price">¥{{ item.productInfo.attrInfo? item.productInfo.attrInfo.price : item.productInfo.price }}</text>
 								<view class="munbox flex">
 									<image src="../../static/img/reduce.png" mode="" @click="reduce(item, index)"></image>
 									<input type="number" :value="item.cart_num" disabled />
@@ -398,7 +398,7 @@ export default {
 				let checked = true;
 				list.forEach(item => {
 					if (item.checked === true) {
-						total += item.productInfo.price * item.cart_num;
+						total += item.productInfo.attrInfo.price * item.cart_num;
 					} else if (checked === true) {
 						checked = false;
 					}

+ 13 - 138
pages/shop/shop.vue

@@ -16,7 +16,7 @@
 				@click="navTo('/pages/product/product?id=' + item.id)">
 				<view class="img">
 					<image class="hlbg" src="../../static/index/index04.png" mode=""></image>
-					<image :src="item.image" mode=""></image>
+					<image class="image" :src="item.image" mode=""></image>
 				</view>
 				<view class="jifen-list">
 					<view class="box-title">
@@ -34,9 +34,9 @@
 						<view class="price-left">
 							{{(item.price*1).toFixed(0)}}
 						</view>
-						<view class="price-right">
+						<!-- <view class="price-right">
 							¥{{item.ot_price}}
-						</view>
+						</view> -->
 					</view>
 				</view>
 			</view>
@@ -58,6 +58,9 @@
 				price: '', //复购价格
 			};
 		},
+		onLoad() {
+			this.loadData()
+		},
 		methods:{
 			// 请求载入数据
 			async loadData() {
@@ -97,10 +100,7 @@
 <style lang="scss">
 	.searchbackground {
 		position: relative;
-	
 		.backgroundimg {
-			// border-bottom-left-radius:30rpx ;
-			// border-bottom--radius:30rpx ;
 			position: absolute;
 			width: 750rpx;
 			height:350rpx;
@@ -112,7 +112,8 @@
 		}
 	}
 	.jifen-content {
-		
+		margin: 0 auto;
+		padding-top: 350rpx;
 		width: 700rpx;
 		padding-bottom: 20rpx;
 		display: flex;
@@ -132,13 +133,13 @@
 			// box-shadow: 0px 7px 10px 1px #8BAFAB;
 	
 			.img {
-				
+				position: relative;
 				.hlbg{
 					border-radius: 10rpx;
 					z-index: 9;
 					position: absolute;
-					width:335rpx ;
-					height: 335rpx;
+					width:312rpx ;
+					height: 312rpx;
 					top: 0;
 					left: 0;
 				}
@@ -148,7 +149,7 @@
 				width: 312rpx;
 				background-color: #eee;
 	
-				image {
+				.image {
 					height: 100%;
 					width: 100%;
 				}
@@ -198,8 +199,7 @@
 						}
 					}
 					.huiyuan{
-						width: 70rpx;
-						height: 33rpx;
+						padding: 4rpx 8rpx;
 						background: linear-gradient(90deg, #C79A4C, #F9DF7F);
 						border-radius: 5rpx;
 						font-size: 19rpx;
@@ -405,130 +405,5 @@
 				}
 			}
 		}
-
-		.jifen-content {
-			width: 700rpx;
-			padding-bottom: 20rpx;
-			display: flex;
-			flex-wrap: wrap;
-			justify-content: space-between;
-
-			.jifen-box {
-				position: relative;
-				margin: 20rpx 0;
-				display: flex;
-				flex-direction: column;
-				align-items: center;
-				width: 342rpx;
-				height: 512rpx;
-				padding-top: 20rpx;
-				background: #FFFFFF;
-				// box-shadow: 0px 7px 10px 1px #8BAFAB;
-
-				.img {
-					
-					.hlbg{
-						border-radius: 10rpx;
-						z-index: 9;
-						position: absolute;
-						width:335rpx ;
-						height: 335rpx;
-						top: 0;
-						left: 0;
-					}
-					flex-shrink: 0;
-					// margin-top: 20rpx;
-					height: 312rpx;
-					width: 312rpx;
-					background-color: #eee;
-
-					image {
-						height: 100%;
-						width: 100%;
-					}
-				}
-
-				.jifen-list {
-					// margin-left: -80rpx;
-					width: 312rpx;
-					height: 100%;
-					position: relative;
-
-					.box-title {
-						.top {
-							margin: 20rpx 0 10rpx 0;
-							// padding: 20rpx 0 10rpx 0;
-							font-size: 30rpx;
-							font-family: PingFang SC;
-							font-weight: bold;
-							color: #3F7C1F;
-							line-height: 35rpx;
-						}
-
-						.button {
-							padding-bottom: 20rpx;
-							font-size: 26rpx;
-							font-family: PingFang SC;
-							font-weight: 500;
-							color: #3F7C1F;
-							line-height: 35rpx;
-							opacity: 0.8;
-						}
-					}
-
-					.box-price {
-						display: flex;
-						align-items: center;
-						position: absolute;
-						bottom: 20rpx;
-							
-						.pricebox {
-							height: 25rpx;
-							width: 25rpx;
-
-							image {
-								height: 100%;
-								width: 100%;
-							}
-						}
-						.huiyuan{
-							width: 70rpx;
-							height: 33rpx;
-							background: linear-gradient(90deg, #C79A4C, #F9DF7F);
-							border-radius: 5rpx;
-							font-size: 19rpx;
-							font-family: Source Han Sans CN;
-							font-weight: 400;
-							color: #FFFFFF;
-							font-weight: 33rpx;
-							text-align: center;
-						}
-						.price-left {
-							font-size: 36rpx;
-							font-family: PingFang SC;
-							font-weight: bold;
-							color: #FF0000;
-							line-height: 35rpx;
-						}
-						.price{
-							margin: 0 5rpx;
-							font-size: 19rpx;
-							font-weight: bold;
-							color: #FF4C4C;
-						}
-
-						.price-right {
-							margin-left: 10rpx;
-							font-size: 21rpx;
-							font-family: PingFang SC;
-							font-weight: 500;
-							text-decoration: line-through;
-							color: #999999;
-							line-height: 35rpx;
-						}
-					}
-				}
-			}
-		}
 	}
 </style>