1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

小程序端:商品详情页美化调整

This commit is contained in:
程序员小墨 2023-03-18 23:40:16 +08:00
parent 7eab148104
commit e29618e5d4
3 changed files with 101 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<!--pages/shop/goodDetail.wxml-->
<view>
<view class="good-wapper">
<image class="good-image" src="{{goodinfo.picUrl}}" />
<view class="good-detail">
<view class="good-price good-price-counter">
@ -13,8 +13,32 @@
<view class="good-price-symbol">¥</view>
<view class="good-price-number">{{ goodinfo.retailPrice }}</view>
</view>
<view>
<text class="good-title line-wrap">{{ goodinfo.goodsName }}</text>
<!-- 商品标题 -->
<view class="good-title line-wrap">
{{ goodinfo.brief || goodinfo.goodsName }}
</view>
<!-- 商品详情 -->
<view class="good-breif line-wrap">
<view>
商品名称:{{ goodinfo.goodsName }}
</view>
<view>
商品描述:{{ goodinfo.brief || "暂无" }}
</view>
<view>
商品介绍:{{ goodinfo.detail || "暂无" }}
</view>
</view>
<view class="no-more">没有更多啦</view>
</view>
</view>
<view class="bottom-controlbox">
<!-- 屏幕底部 -->
<view class="bottom-buttons">
<view class="btn" id="btn-addcart">加入购物车</view>
<view class="btn" id="btn-buy">立即下单</view>
</view>
</view>

View File

@ -1,11 +1,18 @@
/* pages/shop/goodDetail.wxss */
.good-wapper {
height: 100%;
max-height: calc(100vh - 63px);
/* 6px + 44px + 12px */
overflow-y: scroll;
}
.good-image {
width: 100%;
height: 100vw;
}
.good-detail {
padding: 5px 18px;
padding: 5px 20px 24px 20px;
}
/* 商品价格 */
@ -56,13 +63,75 @@
/* 商品标题 */
.good-title {
width: 600rpx;
font-weight: 500;
margin: 8px 3px;
width: 100%;
font-weight: 700;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 32rpx;
font-size: 36rpx;
word-break: break-all;
color: #333333;
}
/* 商品描述 */
.good-breif {
margin: 8px 3px;
font-weight: 500;
font-size: 32rpx;
line-height: 2em;
}
/* 没有更多 */
.no-more {
text-align: center;
color: grey;
margin: 20px;
font-size: small;
}
/* 屏幕底部 下单按钮 */
.bottom-controlbox {
background-color: white;
position: fixed;
z-index: 999;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding-top: 6px;
padding-bottom: 12px;
border-top: 1px solid grey;
text-align: center;
}
.bottom-buttons {
height: 100%;
/* background-color: bisque; */
display: inline-block;
}
.btn {
width: 254rpx;
height: 80rpx;
display: inline-grid;
align-items: center;
justify-content: center;
color: white;
}
#btn-buy {
background-color: #fa4126;
color: #fff;
border-radius: 0rpx 40rpx 40rpx 0rpx;
}
#btn-addcart {
background: #ffece9;
color: #fa4126;
border-radius: 40rpx 0 0 40rpx;
}

View File

@ -80,6 +80,7 @@
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, .2);
}
/* 没有更多 */
.no-more {
text-align: center;
color: grey;