consumer模块完成度95%,优化安卓端界面和小程序测试
This commit is contained in:
@@ -45,9 +45,17 @@
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view class="product-section">
|
||||
<view class="section-title">全部商品</view>
|
||||
<view class="product-grid">
|
||||
<view v-for="product in products" :key="product.id" class="product-item" @click="goToProduct(product.id)">
|
||||
<view class="results-header">
|
||||
<text class="results-title">全部商品</text>
|
||||
<view class="filter-tabs">
|
||||
<text class="filter-tab active">综合</text>
|
||||
<text class="filter-tab">销量</text>
|
||||
<text class="filter-tab">价格</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="results-list">
|
||||
<view v-for="product in products" :key="product.id" class="result-item" @click="goToProduct(product.id)">
|
||||
<image :src="product.images[0]" class="product-image" mode="aspectFill" />
|
||||
<text class="product-name" :lines="2">{{ product.name }}</text>
|
||||
<view class="product-bottom">
|
||||
@@ -529,63 +537,63 @@ const goToProduct = (id: string) => {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center; /* 使 PC 端内容居中 */
|
||||
}
|
||||
|
||||
.shop-banner {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
height: 200px; /* PC 端稍微加高一点 */
|
||||
height: 150px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.shop-info-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
padding: 0 15px;
|
||||
margin-top: -30px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
width: 80px; /* PC 端稍微加大 */
|
||||
height: 80px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #fff;
|
||||
background-color: #fff;
|
||||
margin-right: 15px;
|
||||
margin-right: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.shop-basic-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-top: 30px;
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 22px; /* PC 端字体加大 */
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
margin-bottom: 6px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.shop-stats {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
font-size: 14px;
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
margin-right: 15px;
|
||||
background-color: #f0f0f0;
|
||||
padding: 4px 10px;
|
||||
margin-right: 8px;
|
||||
background-color: #f5f5f5;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@@ -593,22 +601,23 @@ const goToProduct = (id: string) => {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-top: 30px;
|
||||
padding-top: 40px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
border-radius: 20px;
|
||||
margin-left: 15px;
|
||||
border-radius: 17px;
|
||||
margin-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 24px; /* PC 端按钮加大 */
|
||||
padding: 4px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.action-text {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.chat-btn {
|
||||
@@ -623,6 +632,7 @@ const goToProduct = (id: string) => {
|
||||
.follow-btn {
|
||||
background-color: #ff5000;
|
||||
border: 1px solid #ff5000;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.follow-btn .action-text {
|
||||
@@ -634,12 +644,70 @@ const goToProduct = (id: string) => {
|
||||
}
|
||||
|
||||
.shop-desc {
|
||||
color: #666;
|
||||
padding: 15px 15px 0;
|
||||
line-height: 1.6;
|
||||
color: #999;
|
||||
padding: 10px 15px 0;
|
||||
line-height: 1.5;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
box-sizing: border-box;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* PC 端响应式覆盖 */
|
||||
@media screen and (min-width: 1025px) {
|
||||
.shop-header {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shop-banner {
|
||||
height: 300px;
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
.shop-info-card {
|
||||
max-width: 1200px;
|
||||
margin-top: -40px;
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.shop-basic-info {
|
||||
padding-top: 45px;
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
font-size: 24px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.shop-stats .stat-item {
|
||||
font-size: 14px;
|
||||
padding: 6px 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.shop-actions {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
padding: 8px 24px;
|
||||
margin-left: 15px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.action-text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.shop-desc {
|
||||
max-width: 1200px;
|
||||
font-size: 14px;
|
||||
padding: 15px 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Coupon Styles */
|
||||
@@ -708,67 +776,121 @@ const goToProduct = (id: string) => {
|
||||
}
|
||||
|
||||
.product-section {
|
||||
padding: 20px;
|
||||
padding: 20px 0;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 20px;
|
||||
padding-left: 10px;
|
||||
border-left: 5px solid #ff5000;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.product-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
width: calc(50% - 10px); /* 默认两列 */
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.product-item:nth-child(2n) {
|
||||
margin-right: 0;
|
||||
.results-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 12px;
|
||||
background-color: #fff;
|
||||
margin-bottom: 2px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.product-item:hover {
|
||||
.results-title {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
padding-left: 10px;
|
||||
border-left: 5px solid #ff5000;
|
||||
}
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.filter-tab {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
padding: 8px 12px;
|
||||
border-radius: 20px;
|
||||
border: 1px solid #e0e0e0;
|
||||
transition: all 0.2s ease;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
background: #ff5000;
|
||||
color: white;
|
||||
border-color: #ff5000;
|
||||
}
|
||||
|
||||
.results-list {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-top: 5px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.result-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
width: 48% !important;
|
||||
margin-bottom: 12px;
|
||||
margin-right: 0 !important;
|
||||
border: 1px solid #f0f0f0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.result-item:nth-child(2n-1) {
|
||||
margin-right: 4% !important;
|
||||
}
|
||||
|
||||
.result-item:nth-child(2n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.result-item:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.product-image {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background: #f5f5f5;
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
height: 170px;
|
||||
object-fit: cover;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
margin: 10px 0;
|
||||
line-height: 1.4;
|
||||
height: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 0 10px;
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
margin-bottom: 5px;
|
||||
line-height: 1.4;
|
||||
height: 36px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.product-bottom {
|
||||
@@ -776,20 +898,20 @@ const goToProduct = (id: string) => {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 10px 12px;
|
||||
padding: 0 8px 8px;
|
||||
}
|
||||
|
||||
.product-price {
|
||||
font-size: 18px;
|
||||
font-size: 15px;
|
||||
color: #ff5000;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.product-add-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-color: #ff5000;
|
||||
border-radius: 14px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -797,50 +919,50 @@ const goToProduct = (id: string) => {
|
||||
|
||||
.add-icon {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* PC/Tablet Responsive */
|
||||
@media (min-width: 768px) {
|
||||
.product-item {
|
||||
width: calc(33.33% - 14px) !important;
|
||||
}
|
||||
.product-item:nth-child(2n) {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
.product-item:nth-child(3n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
/* 电脑端响应式覆盖 */
|
||||
@media screen and (min-width: 1025px) {
|
||||
.product-section {
|
||||
max-width: 95%;
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.result-item {
|
||||
width: 23%;
|
||||
margin-right: 2% !important;
|
||||
}
|
||||
|
||||
.result-item:nth-child(2n) {
|
||||
margin-right: 2% !important;
|
||||
}
|
||||
|
||||
.result-item:nth-child(4n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.product-item {
|
||||
width: calc(20% - 16px) !important; /* 五列 */
|
||||
}
|
||||
.product-item:nth-child(3n) {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
.product-item:nth-child(5n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
/* 大桌面端 (1400px以上) */
|
||||
@media screen and (min-width: 1400px) {
|
||||
.result-item {
|
||||
width: 23.5%;
|
||||
}
|
||||
}
|
||||
|
||||
.shop-banner {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1025px) {
|
||||
.shop-banner {
|
||||
height: 300px; /* 大屏加宽 Banner */
|
||||
border-radius: 0 0 20px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1440px) {
|
||||
.product-item {
|
||||
width: calc(16.66% - 17px) !important; /* 六列 */
|
||||
}
|
||||
.product-item:nth-child(5n) {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
.product-item:nth-child(6n) {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user