热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_53051713
油麦菜你好
3 年前
trueweixin_53051713

小程序P136 12.商品详情-渲染并美化商品信息区域
1、渲染商品信息区域
①定义商品信息区域的 UI 结构如下:
<!-- 信息区域 -->
<view class="goods-info-box">
<!-- 价格 -->
<view class="price">¥{{goods_info.goods_price}}</view>
<!-- 主体区域 -->
<view class="goods-info-body">
<!-- 名称 -->
<view class="goods-name">{{goods_info.goods_name}}</view>
<!-- 收藏 -->
<view class="favi">
<uni-icons type="star" size="18" color="gray"></uni-icons>
<text>收藏</text>
</view>
</view>
<!-- 运费 -->
<view class="yf">快递:免运费</view>
</view>

②美化商品信息区域的样式
// 商品信息区域的样式
.goods-info-box {
padding: 10px;
padding-right: 0;
.price {
color: #c00000;
font-size: 18px;
margin: 10px 0;
}
.goods-info-body {
display: flex;
justify-content: space-between;
.goods-name {
font-size: 13px;
padding-right: 10px;
}
// 收藏
.favi {
width: 120px;
font-size: 12px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-left: 1px solid #efefef;
color: gray;
}
}
// 运费
.yf {
margin: 10px 0;
font-size: 12px;
color: gray;
}}

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
大佬们,可以帮我看看哪里错了吗
立即登录