lilei 4 éve
szülő
commit
9d9fc83d40

+ 76 - 59
components/uni-coods/uni-coods.vue

@@ -1,17 +1,19 @@
 <template>
-	<view class="goods-item" @click="toDetail">
-		<view class="goods-imgs">
-			<view v-if="data.status == 1" class="goods-staus">已售罄</view>
-			<u-lazy-load img-mode="scaleToFill" :height="imgHeight" :image="data.src" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
-		</view>
-		<view class="name ellipsis-two">{{data.name}}</view>
-		<view class="price">
-			<view>
-				<text>{{data.price}}</text>
-				<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
+	<view class="goods-list">
+		<view class="goods-item" v-for="item in list" :key="item.id" @click="toDetail">
+			<view class="goods-imgs">
+				<view v-if="item.status == 1" class="goods-staus">已售罄</view>
+				<u-lazy-load img-mode="scaleToFill" :height="imgHeight" :image="item.src" :loading-img="loadingImg" :error-img="errorImg"></u-lazy-load>
 			</view>
-			<view @click.stop="addCart">
-				<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
+			<view class="name ellipsis-two">{{item.name}}</view>
+			<view class="price">
+				<view>
+					<text>{{item.price}}</text>
+					<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
+				</view>
+				<view @click.stop="addCart">
+					<u-image mode="scaleToFill" width="45rpx" height="45rpx" src="/static/addCart.png"></u-image>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -24,10 +26,10 @@
 				type: Number,
 				default: 250
 			},
-			data:{
-				type: Object,
+			list:{
+				type: Array,
 				default: function(){
-					return {}
+					return []
 				}
 			}
 		},
@@ -44,62 +46,77 @@
 				this.$store.state.vuex_cartNums = Number(this.$store.state.vuex_cartNums) + 1
 			},
 			// 商品详情
-			toDetail(){
+			toDetail(item){
 				uni.navigateTo({
-					url:"/pages/goods/goodsDetail?id="+this.data.id
+					url:"/pages/goods/goodsDetail?id="+item.id
 				})
 			}
 		},
 	}
 </script>
 
-<style lang="scss">
-.goods-item{
-	background: #FFFFFF;
-	width: 48%;
-	margin-bottom: 5upx;
-	.goods-imgs{
-		position: relative;
-		border-radius: 28upx 28upx 0 0;
-		overflow: hidden;
-		.goods-staus{
-			width: 100%;
-			height: 100%;
-			position: absolute;
-			z-index: 10000;
-			border-radius: 15rpx 15rpx 0 0;
-			background: rgba($color: #000000, $alpha: 0.4);
-			text-align: center;
-			line-height: 250rpx;
-			left: 0;
-			top: 0;
-			color: #eee;
-			font-size: 30upx;
-			font-weight: bold;
+<style lang="scss" scoped>
+.goods-list{
+	display: flex;
+	flex-wrap: wrap;
+	justify-content: space-between;
+	padding-top: 20upx;
+	.goods-item{
+		background: #FFFFFF;
+		width: 48%;
+		margin-bottom: 5upx;
+		&:active{
+			opacity: 0.5;
 		}
-	}
-	.name{
-		padding: 10upx 20upx 0;
-		font-weight: bold;
-	}
-	.price{
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		padding: 15upx 20upx;
-		text{
-			color: #d42a26;
-			font-size: 36upx;
-			margin-right: 6upx;
+		.goods-imgs{
+			position: relative;
+			border-radius: 28upx 28upx 0 0;
+			overflow: hidden;
+			.goods-staus{
+				width: 100%;
+				height: 100%;
+				position: absolute;
+				z-index: 10000;
+				border-radius: 15rpx 15rpx 0 0;
+				background: rgba($color: #000000, $alpha: 0.4);
+				text-align: center;
+				line-height: 250rpx;
+				left: 0;
+				top: 0;
+				color: #eee;
+				font-size: 30upx;
+				font-weight: bold;
+			}
+		}
+		.name{
+			padding: 10upx 20upx 0;
 			font-weight: bold;
 		}
-		>view{
-			&:first-child{
-				font-size: 22upx;
-				display: flex;
-				align-items: center;
+		.price{
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 15upx 20upx;
+			text{
+				color: #d42a26;
+				font-size: 36upx;
+				margin-right: 6upx;
+				font-weight: bold;
+			}
+			>view{
+				&:first-child{
+					font-size: 22upx;
+					display: flex;
+					align-items: center;
+				}
+				&:last-child{
+					&:active{
+						opacity: 0.5;
+					}
+				}
 			}
 		}
 	}
 }
+
 </style>

+ 3 - 1
pages.json

@@ -19,7 +19,9 @@
 		{
 			"path": "pages/userCenter/index",
 			"style": {
-				"navigationBarTitleText": "个人中心"
+				"navigationBarTitleText": "个人中心",
+				"navigationBarBackgroundColor": "#01c9b2",
+				"navigationBarTextStyle": "white"
 			}
 		}, 
 		{

+ 2 - 2
pages/goods/goods.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="content">
 		<view class="info">该类商品需购满300乐豆才能下单哦!</view>
-		<view class="goods-list" v-if="goodsList.length">
-			<uni-coods v-for="item in goodsList" :key="item.id" :data="item"></uni-coods>
+		<view v-if="goodsList.length">
+			<uni-coods :list="goodsList"></uni-coods>
 		</view>
 		<!-- 购物车 -->
 		<uni-cart-fix></uni-cart-fix>

+ 2 - 8
pages/index/index.vue

@@ -9,13 +9,13 @@
 			<view v-if="goodsList.length">
 				<u-section title="人气零食" v-if="goodsList.length" line-color="#01c9b2" sub-title="更多" @click="toGoods(1)"></u-section>
 				<view class="goods-list">
-					<uni-coods v-for="item in goodsList" :key="item.id" :data="item"></uni-coods>
+					<uni-coods :list="goodsList"></uni-coods>
 				</view>
 			</view>
 			<view v-if="goodsList.length">
 				<u-section title="居家生活" v-if="goodsList.length" line-color="#01c9b2" sub-title="更多" @click="toGoods(2)"></u-section>
 				<view class="goods-list">
-					<uni-coods v-for="item in goodsList" :key="item.id" :data="item"></uni-coods>
+					<uni-coods :list="goodsList"></uni-coods>
 				</view>
 			</view>
 		</view>
@@ -94,12 +94,6 @@
 				margin-bottom: 20upx;
 			}
 		}
-		.goods-list{
-			display: flex;
-			flex-wrap: wrap;
-			justify-content: space-between;
-			padding-top: 20upx;
-		}
 		.t1{
 			padding: 20upx 0;
 		}

+ 8 - 5
pages/order/order.vue

@@ -8,7 +8,10 @@
 			<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
 				<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
 					<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
-						<view class="check-order-list" v-if="index==current" v-for="(item,sindex) in list" :key="item.id+'-'+sindex"
+						<view class="check-order-list" 
+						v-if="index==current" 
+						v-for="(item,sindex) in list" 
+						:key="item.id+'-'+sindex"
 						 @click="viewRow(item)">
 							<view class="check-row">
 								<view class="createDate">{{item.createDate}}</view>
@@ -21,7 +24,7 @@
 								<view >
 									<view class="ellipsis-two">{{row.name}}</view>
 									<view class="bundle-num">
-										<view ><b class="price-num">{{row.price}}</b> <text class="price-text">乐豆</text></view>
+										<view ><text class="price-num">{{row.price}}</text> <text class="price-text">乐豆</text></view>
 										<view >X {{row.number}}</view>
 									</view>
 								</view>
@@ -31,8 +34,8 @@
 									<text class="total-text">
 										共{{item.totalNum}}件商品
 									</text>
-									<text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><b class="price-num">{{item.amount}}</b> <text class="price-text">乐豆</text></text>
-									<text v-else><text class="money-total">实付</text><b class="price-num">{{item.payedAmount}}</b> <text class="price-text">乐豆</text></text>
+									<text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><text class="price-num">{{item.amount}}</text> <text class="price-text">乐豆</text></text>
+									<text v-else><text class="money-total">实付</text><text class="price-num">{{item.payedAmount}}</text> <text class="price-text">乐豆</text></text>
 								</view>
 							</view>
 							<view class="check-row">
@@ -338,7 +341,7 @@
 				// }
 				// 已完成的
 				uni.navigateTo({
-					url: "/pages/order/orderDetail?id=" + item.id
+					url: "/pages/order/orderDetail?id="
 				})
 			},
 		}

+ 2 - 2
pages/order/orderDetail.vue

@@ -31,7 +31,7 @@
 				<view >
 					<view class="ellipsis-two">{{item.name}}</view>
 					<view class="bundle-num">
-						<view ><b class="price-num">{{item.price}}</b> <text class="price-text">乐豆</text></view>
+						<view ><text class="price-num">{{item.price}}</text> <text class="price-text">乐豆</text></view>
 						<view >X {{item.number}}</view>
 					</view>
 				</view>
@@ -56,7 +56,7 @@
 					免运费
 				</u-cell-item>
 				<u-cell-item :title="(orderInfo.orderFlag=='待支付'||orderInfo.orderFlag=='已取消') ? '待支付':'实际支付'" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false">
-					<b class="price-num">{{orderInfo.amount}}</b> <text class="price-text">乐豆</text>
+					<text class="price-num">{{orderInfo.amount}}</text> <text class="price-text">乐豆</text>
 				</u-cell-item>
 			</u-cell-group>
 		</view>

+ 2 - 3
pages/toOrder/index.vue

@@ -9,7 +9,7 @@
 				 <view>王明 1456465455</view>
 			</view>
 			<view>
-				<u-image height="40rpx" width="40rpx" src="/static/edit.png"></u-image>
+				<u-image height="50rpx" width="50rpx" src="/static/edit.png"></u-image>
 			</view>
 		</view>
 		<view class="goods-list">
@@ -88,8 +88,7 @@ page{
 	flex-direction: column;
 	.cart-bar{
 		background: #FFFFFF;
-		box-shadow: 1px 1px 3px #eee;
-		border-bottom: 1px solid #eee;
+		border-bottom: 1px solid #F8F8F8;
 		border-top: 10upx solid #F8F8F8;
 		display: flex;
 		align-items: center;

+ 23 - 3
pages/userCenter/index.vue

@@ -8,14 +8,18 @@
 			<view class="user-info">
 				<open-data type="userNickName"></open-data>
 			</view>
+			<view class="user-jifen">
+				<view>乐豆:<text>345</text></view>
+				<u-image mode="scaleToFill" width="35rpx" height="35rpx" src="/static/ledou.png"></u-image>
+			</view>
 		</view>
 		<!-- 列表 -->
 		<view class="user-list">
 			<u-cell-group>
-				<u-cell-item icon="order" icon-size="38" :icon-style="{color:'#ff0000'}" index="1" @click="toPage" title="我的订单"></u-cell-item>
+				<u-cell-item icon="order" icon-size="38" :icon-style="{color:'#ff5500'}" index="1" @click="toPage" title="我的订单"></u-cell-item>
 				<u-cell-item icon="gift" icon-size="40" :icon-style="{color:'#00aaff'}" index="0" @click="toPage" title="投递记录"></u-cell-item>
 				<u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="2" @click="toPage" title="服务协议"></u-cell-item>
-				<u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#00aa00'}" index="3" @click="toPage" title="关于我们"></u-cell-item>
+				<u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#55aa00'}" index="3" @click="toPage" title="关于我们"></u-cell-item>
 			</u-cell-group>
 		</view>
 		<!-- 退出 -->
@@ -93,13 +97,29 @@
 			.user-info{
 				flex-grow: 1;
 				padding: 0 20rpx;
+				color: #FFFFFF;
 			}
 			.user-photo{
 				width: 100rpx;
 				height: 100rpx;
 				border-radius: 50%;
 				overflow: hidden;
-				margin-right: 30rpx;
+				margin-right: 5rpx;
+			}
+			.user-jifen{
+				color: #FFFFFF;
+				display: flex;
+				align-items: center;
+				text{
+					font-size: 40upx;
+					font-weight: bold;
+				}
+				>view{
+					&:first-child{
+						display: flex;
+						align-items: center;
+					}
+				}
 			}
 		}
 		

BIN
static/tabbar/home-active.png


BIN
static/tabbar/home.png