25. uniapp 完成推荐商品结构

template部分

<!-- 推荐商品 -->
		<view class="hot_goods">
			<view class="tit">推荐商品</view>
			<!-- 一 -->
			<view class="goods_list">
				<view class="goods_item">
					<image src="../../static/logo.png" mode=""></image>
					<view class="price">
						<text>¥2199</text>
						<text>¥2499</text>
					</view>
					<view class="name">
						华为(HUAWEI)荣耀Plus 16G双4G版
					</view>
				</view>
				<!-- 二 -->
				<view class="goods_item">
					<image src="../../static/logo.png" mode=""></image>
					<view class="price">
						<text>¥2199</text>
						<text>¥2499</text>
					</view>
					<view class="name">
						华为(HUAWEI)荣耀Plus 16G双4G版
					</view>
				</view>
				<!-- 三 -->
				<view class="goods_item">
					<image src="../../static/logo.png" mode=""></image>
					<view class="price">
						<text>¥2199</text>
						<text>¥2499</text>
					</view>
					<view class="name">
						华为(HUAWEI)荣耀Plus 16G双4G版
					</view>
				</view>
				<!-- 四 -->
				<view class="goods_item">
					<image src="../../static/logo.png" mode=""></image>
					<view class="price">
						<text>¥2199</text>
						<text>¥2499</text>
					</view>
					<view class="name">
						华为(HUAWEI)荣耀Plus 16G双4G版
					</view>
				</view>
			</view>
		</view>

css部分 scss语法写的

.hot_goods{
			background-color: #eee;
			overflow: hidden;
			margin-top: 10rpx;
			.tit{
				height: 50rpx;
				line-height: 50rpx;
				color: $shop-color;
				text-align: center;
				letter-spacing: 20rpx;			// 	这个属性不错		增加字体间距
				background-color: #fff;
				margin: 7rpx 0;
			}
			.goods_list{
				padding: 0 15rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				.goods_item{
					background-color: #fff;
					width: 355rpx;
					margin: 10rpx 0;	// 上下为10rpx 左右为0
					
					padding: 15rpx;					//		内边距
					box-sizing: border-box;			//		防止变形		w3e盒模型
					image{
						width: 80%;
						height: 150rpx;
						display: block;			// 变成块同时使用
						margin: 0 auto;
					}
					.price{
						color: $shop-color;
						font-size: 36rpx;
						text:nth-child(2){
							color: #ccc;
							font-size: 28rpx;
							margin-left: 27rpx;
							text-decoration: line-through;		// 字体中间划线
						}
					}
					
					.name{
						font-size: 28rpx;
						line-height: 50rpx;
						padding:{
							bottom: 15rpx;
							top: 10rpx;
						}
					}
				}
			}
		}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值