Explorar el Código

首页初步完成,活动专区还没提需求

gcz hace 1 año
padre
commit
499241ef19
Se han modificado 2 ficheros con 35 adiciones y 2 borrados
  1. 15 2
      pages/index/index.vue
  2. 20 0
      uni.scss

+ 15 - 2
pages/index/index.vue

@@ -63,8 +63,12 @@
 						<u-icon name="arrow-right" color="#676767" size="24rpx"></u-icon>
 					</view>
 				</view>
-				<view class="">
-					
+				<view class="activity-list">
+					<view class="activity-item" v-for="item in centerImg" :key="item.id"  @click="activityClick(item)">
+						<u--image :showLoading="true" :src="item.sliderImg" mode="aspectFit" width="100%" height="240rpx"></u--image>
+						<view class="title ellipsis-1">{{item.name}}</view>
+						<view class="time">{{item.createTime}}</view>
+					</view>
 				</view>
 			</view>
 			
@@ -251,6 +255,12 @@
 					console.log('getHotGoods',err.data);
 				})
 			},
+			activityClick(item){
+				uni.$u.toast('开发中,请等待')
+				uni.$u.route('/activity/activitydetails', {
+					id: item.id
+				});
+			}
 
 		}
 	}
@@ -348,4 +358,7 @@ page{
 		margin-left: 12rpx;
 	}
 }
+.activity{
+	margin-bottom: 60rpx;
+}
 </style>

+ 20 - 0
uni.scss

@@ -351,4 +351,24 @@ page{
 	.img{
 		width: 100%;
 	}
+}
+
+.activity-list{
+	.activity-item{
+		margin-bottom: 24rpx;
+		.title{
+			font-size: 30rpx;
+			font-weight: 400;
+			color: #333333;
+			line-height: 42rpx;
+			margin-bottom: 7rpx;
+			margin-top: 20rpx;
+		}
+		.time{
+			font-size: 26rpx;
+			font-weight: 400;
+			color: #999999;
+			line-height: 37rpx;
+		}
+	}
 }