小程序产品页面优化,及添加忽略文件

This commit is contained in:
Dev
2026-09-21 16:27:14 +08:00
parent 8591e5e99f
commit bd24456aa3
24 changed files with 513 additions and 768 deletions
+246 -190
View File
@@ -2,278 +2,248 @@
page {
width: 100vw;
background-color: var(--bg-page);
}
.goods-detail-page .goods-info {
margin: 0 auto;
padding: 26rpx 0 28rpx 30rpx;
background-color: #fff;
.goods-detail-page {
min-height: 100vh;
padding-bottom: 160rpx;
background-color: var(--bg-page);
}
.goods-detail-page .swipe-img {
width: 100%;
height: 750rpx;
.goods-head {
--td-swiper-radius: 0;
}
.goods-detail-page .goods-info .goods-price {
.goods-gallery {
position: relative;
background-color: var(--bg-card);
}
/* 商品信息卡片:轻微上浮覆盖轮播,形成层次 */
.goods-info {
position: relative;
z-index: 2;
margin-top: -24rpx;
padding: 28rpx 30rpx 32rpx;
background-color: var(--bg-card);
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.goods-info .goods-number {
display: flex;
align-items: center;
justify-content: space-between;
}
.goods-info .goods-price {
display: flex;
align-items: baseline;
}
.goods-detail-page .goods-info .goods-price-up {
color: var(--brand);
font-size: 28rpx;
position: relative;
bottom: 4rpx;
left: 8rpx;
}
.goods-detail-page .goods-info .goods-price .class-goods-price {
.goods-info .goods-price .class-goods-price {
font-size: 64rpx;
font-weight: 700;
color: var(--brand);
font-weight: bold;
font-family: DIN Alternate;
font-family: 'DIN Alternate', -apple-system, sans-serif;
}
.goods-detail-page .goods-info .goods-price .class-goods-symbol {
.goods-info .goods-price .class-goods-symbol {
font-size: 36rpx;
color: var(--brand);
}
.goods-detail-page .goods-info .goods-price .class-goods-del {
.goods-info .goods-price .class-goods-del {
position: relative;
font-weight: normal;
left: 16rpx;
bottom: 2rpx;
font-size: 28rpx;
font-weight: normal;
color: var(--text-tertiary);
font-size: 32rpx;
}
.goods-detail-page .goods-info .goods-number {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info .goods-price-up {
position: relative;
left: 8rpx;
bottom: 4rpx;
font-size: 26rpx;
color: var(--brand);
}
.goods-detail-page .goods-info .goods-number .sold-num {
font-size: 24rpx;
color: var(--text-tertiary);
.goods-info .goods-number .sold-num {
display: flex;
flex-shrink: 0;
align-items: flex-end;
margin-right: 32rpx;
padding: 4rpx 16rpx;
font-size: 22rpx;
color: var(--text-tertiary);
background: var(--bg-grey);
border-radius: var(--radius-round);
}
.goods-detail-page .goods-info .goods-activity {
.goods-info .goods-activity {
display: flex;
margin-top: 16rpx;
justify-content: space-between;
}
.goods-detail-page .goods-info .goods-activity .tags-container {
display: flex;
}
.goods-detail-page .goods-info .goods-activity .tags-container .goods-activity-tag {
background: var(--brand-light);
color: var(--brand);
font-size: 24rpx;
margin-right: 16rpx;
padding: 4rpx 8rpx;
border-radius: 4rpx;
}
.goods-detail-page .goods-info .goods-activity .activity-show {
display: flex;
justify-content: center;
align-items: center;
color: var(--brand);
font-size: 24rpx;
padding-right: 32rpx;
justify-content: space-between;
margin-top: 20rpx;
padding: 12rpx 20rpx;
background: var(--brand-light);
border-radius: var(--radius-sm);
}
.goods-detail-page .goods-info .goods-activity .activity-show-text {
.goods-info .goods-activity .tags-container {
display: flex;
flex: 1;
overflow: hidden;
}
.goods-info .goods-activity .tags-container .goods-activity-tag {
margin-right: 16rpx;
padding: 4rpx 12rpx;
font-size: 22rpx;
color: var(--brand);
background: var(--bg-card);
border-radius: var(--radius-sm);
}
.goods-info .goods-activity .activity-show {
display: flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: var(--brand);
}
.goods-info .goods-activity .activity-show-text {
line-height: 42rpx;
}
.goods-detail-page .goods-info .goods-title {
.goods-info .goods-title {
display: flex;
align-items: flex-start;
justify-content: space-between;
align-items: center;
margin-top: 20rpx;
margin-top: 24rpx;
}
.goods-detail-page .goods-info .goods-title .goods-name {
width: 600rpx;
font-weight: 500;
.goods-info .goods-title .goods-name {
flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 32rpx;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
font-size: 34rpx;
font-weight: 600;
line-height: 48rpx;
color: var(--text-primary);
word-break: break-all;
}
.goods-detail-page .goods-info .goods-title .goods-tag {
.goods-info .goods-title .goods-tag {
flex-shrink: 0;
width: 104rpx;
margin-left: 26rpx;
margin-left: 16rpx;
}
.goods-detail-page .goods-info .goods-title .goods-tag .shareBtn {
border-radius: 200rpx 0px 0px 200rpx;
.goods-info .goods-title .goods-tag .shareBtn {
width: 100rpx;
height: 96rpx;
border: none;
padding-right: 36rpx !important;
border: none;
border-radius: 200rpx 0 0 200rpx;
}
.goods-detail-page .goods-info .goods-title .goods-tag .shareBtn::after {
.goods-info .goods-title .goods-tag .shareBtn::after {
border: none;
}
.goods-detail-page .goods-info .goods-title .goods-tag .btn-icon {
font-size: 20rpx;
.goods-info .goods-title .goods-tag .btn-icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 96rpx;
font-size: 20rpx;
color: var(--text-tertiary);
}
.goods-detail-page .goods-info .goods-title .goods-tag .btn-icon .share-text {
.goods-info .goods-title .goods-tag .btn-icon .share-text {
padding-top: 8rpx;
font-size: 20rpx;
line-height: 24rpx;
}
.goods-detail-page .goods-info .goods-intro {
font-size: 26rpx;
color: var(--text-tertiary);
line-height: 36rpx;
word-break: break-all;
padding-right: 30rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
white-space: normal;
overflow: hidden;
}
.spu-select {
height: 80rpx;
background-color: #fff;
margin-top: 20rpx;
.goods-service {
display: flex;
align-items: center;
padding: 30rpx;
margin-top: 18rpx;
}
.goods-service__text {
margin-left: 8rpx;
font-size: 24rpx;
color: var(--text-tertiary);
}
.goods-info .goods-intro {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
margin-top: 12rpx;
font-size: 26rpx;
line-height: 38rpx;
color: var(--text-tertiary);
word-break: break-all;
white-space: normal;
}
/* 已选规格 */
.spu-select {
display: flex;
align-items: center;
margin: 20rpx 24rpx 0;
padding: 28rpx 30rpx;
font-size: 28rpx;
background-color: var(--bg-card);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-card);
}
.spu-select .label {
margin-right: 30rpx;
text-align: center;
flex-shrink: 0;
color: var(--text-tertiary);
margin-right: 24rpx;
font-weight: normal;
color: var(--text-tertiary);
}
.spu-select .content {
display: flex;
flex: 1;
justify-content: space-between;
align-items: center;
justify-content: space-between;
min-width: 0;
}
.spu-select .content .content-text {
flex: 1;
overflow: hidden;
color: var(--text-primary);
white-space: nowrap;
text-overflow: ellipsis;
}
.spu-select .content .tintColor {
color: var(--text-placeholder);
}
.goods-detail-page .desc-content {
margin-top: 20rpx;
background-color: #fff;
padding-bottom: 120rpx;
}
.goods-detail-page .desc-content__title {
font-size: 28rpx;
line-height: 36rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx 20rpx;
}
.goods-detail-page .desc-content__title .img {
width: 206rpx;
height: 10rpx;
}
.goods-detail-page .desc-content__title--text {
font-size: 26rpx;
margin: 0 32rpx;
font-weight: 600;
}
.goods-detail-page .desc-content__img {
width: 100%;
height: auto;
}
.goods-bottom-operation {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #fff;
padding-bottom: env(safe-area-inset-bottom);
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price {
display: flex;
align-items: baseline;
color: var(--brand);
margin-top: 48rpx;
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-num {
font-size: 64rpx;
color: var(--brand);
font-weight: bold;
font-family: DIN Alternate;
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-del {
position: relative;
font-weight: normal;
left: 12rpx;
bottom: 2rpx;
color: var(--text-tertiary);
font-size: 32rpx;
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-symbol {
font-size: 36rpx;
color: var(--brand);
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-max-num {
font-size: 48rpx;
}
.goods-detail-page .goods-head {
--td-swiper-radius: 0;
}
.t-toast__content {
z-index: 12000 !important;
}
/* 评价 */
.comments-wrap {
margin-top: 20rpx;
margin: 20rpx 24rpx 0;
padding: 32rpx;
background-color: #fff;
background-color: var(--bg-card);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-card);
}
.comments-wrap .comments-head {
@@ -289,25 +259,25 @@ page {
.comments-title-label,
.comments-title-count {
color: var(--text-primary);
font-size: 32rpx;
font-weight: 500;
font-weight: 600;
line-height: 48rpx;
color: var(--text-primary);
}
.comments-rate-wrap {
display: flex;
justify-content: center;
align-items: center;
justify-content: center;
font-size: 24rpx;
}
.comments-rate-wrap .comments-good-rate {
color: var(--text-tertiary);
font-size: 26rpx;
font-weight: 400;
font-style: normal;
line-height: 36rpx;
color: var(--text-tertiary);
}
.comment-item-wrap .comment-item-head {
@@ -329,17 +299,53 @@ page {
.comment-head-right .comment-username {
font-size: 26rpx;
color: var(--text-primary);
line-height: 36rpx;
font-weight: 400;
line-height: 36rpx;
color: var(--text-primary);
}
.comment-item-wrap .comment-item-content {
margin-top: 20rpx;
color: var(--text-primary);
line-height: 40rpx;
font-size: 28rpx;
font-weight: 400;
line-height: 40rpx;
color: var(--text-primary);
}
/* 详情 */
.desc-content {
margin: 20rpx 24rpx 0;
padding-bottom: 40rpx;
overflow: hidden;
background-color: var(--bg-card);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-card);
}
.desc-content__title {
display: flex;
align-items: center;
justify-content: center;
padding: 32rpx 20rpx 16rpx;
font-size: 28rpx;
line-height: 36rpx;
text-align: center;
}
.desc-content__title .img {
width: 206rpx;
height: 10rpx;
}
.desc-content__title--text {
margin: 0 32rpx;
font-size: 26rpx;
font-weight: 600;
}
.desc-content__img {
width: 100%;
height: auto;
}
.rich-text-content {
@@ -347,9 +353,9 @@ page {
}
.rich-text-content [src] {
display: block;
max-width: 100% !important;
height: auto !important;
display: block;
}
.video-container {
@@ -363,4 +369,54 @@ page {
.video-player {
width: 100%;
height: 400rpx;
}
border-radius: var(--radius-md);
}
/* 底部购买栏 */
.goods-bottom-operation {
position: fixed;
left: 0;
bottom: 0;
z-index: 100;
width: 100%;
padding-bottom: env(safe-area-inset-bottom);
background-color: var(--bg-card);
box-shadow: 0 -4rpx 20rpx rgba(29, 33, 41, 0.06);
}
/* 规格弹窗价格 */
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price {
display: flex;
align-items: baseline;
margin-top: 12rpx;
color: var(--brand);
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-num {
font-size: 56rpx;
font-weight: 700;
color: var(--brand);
font-family: 'DIN Alternate', -apple-system, sans-serif;
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-del {
position: relative;
left: 12rpx;
bottom: 2rpx;
font-size: 28rpx;
font-weight: normal;
color: var(--text-tertiary);
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-symbol {
font-size: 32rpx;
color: var(--brand);
}
.popup-sku-header .popup-sku-header__goods-info .popup-sku__price .popup-sku__price-max-num {
font-size: 48rpx;
}
.t-toast__content {
z-index: 12000 !important;
}