fix: 更新 API 请求参数格式及优化组件样式

- 将 addEvaluation API 的参数从 params 修改为 data,以符合标准请求格式
- 在多个组件中调整样式,提升响应式布局和用户体验
- 优化商品详情页的倒计时显示,增强视觉效果
- 更新购物车操作按钮样式,提升一致性和可用性
This commit is contained in:
田香琪
2026-06-23 14:13:25 +08:00
parent 8a60e23214
commit 1b2e980fb6
26 changed files with 481 additions and 401 deletions

View File

@@ -3,7 +3,12 @@
<div class="wrapper" v-if="type === 'goodsDetail'">
<div class="wr-l"><el-icon :size="23"><AlarmClock /></el-icon> 秒杀活动</div>
<div class="count-down" v-if="end === ''">
<p>倒计时</p><span>{{ hours }}</span><span>{{ minutes }}</span><span>{{ seconds }}</span>
<span class="count-down-label">倒计时</span>
<span class="count-down-num">{{ hours }}</span>
<span class="count-down-colon">:</span>
<span class="count-down-num">{{ minutes }}</span>
<span class="count-down-colon">:</span>
<span class="count-down-num">{{ seconds }}</span>
</div>
<div v-else>{{end}}</div>
</div>
@@ -89,36 +94,35 @@ export default {
font-size: 13px;
}
.count-down {
margin-right: -20px;
p{
float: left;
line-height: 20px;
display: flex;
align-items: center;
gap: 4px;
font-size: 13px;
line-height: 1;
.count-down-label {
flex-shrink: 0;
white-space: nowrap;
}
> span {
position: relative;
float: left;
width: 20px;
.count-down-num {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 20px;
height: 20px;
text-align: center;
padding: 0 2px;
background-color: #2f3430;
margin-right: 20px;
color: white;
color: #fff;
font-size: 14px;
line-height: 20px;
&::after {
content: ":";
display: block;
position: absolute;
right: -20px;
font-weight: bolder;
font-size: 14px;
width: 20px;
height: 100%;
top: 0;
}
line-height: 1;
border-radius: 2px;
}
> span:last-child::after {
content: "";
.count-down-colon {
font-weight: bold;
font-size: 14px;
line-height: 1;
}
}

View File

@@ -69,7 +69,12 @@
<p class="remarks-content">{{ item.reply }}</p>
<div>
<div class="comment-img" v-if="item.replyImage">
<div v-for="(img, imgIndex) in item.replyImage.split(',')" @click="$previewImage(img)" :key="imgIndex">
<div
v-for="(img, imgIndex) in item.replyImage.split(',')"
:key="imgIndex"
:class="{ borderColor: img === item.previewImg }"
@click="previewImg(img, item)"
>
<img :src="img" alt="">
</div>
</div>

View File

@@ -226,7 +226,7 @@ export default {
height: 100%;
}
.nav ul {
.nav > ul {
list-style: none;
margin: 0;
padding: 0;
@@ -234,10 +234,11 @@ export default {
align-items: center;
}
.nav li {
.nav > ul > li,
.location > ul.flex > li {
cursor: pointer;
float: none;
line-height: 1;
line-height: 36px;
margin-right: 15px;
display: flex;
align-items: center;
@@ -331,6 +332,7 @@ export default {
.username-p {
position: relative;
z-index: 100;
div {
cursor: pointer;
@@ -345,59 +347,71 @@ export default {
.drop-items {
position: absolute;
display: none;
top: 45px;
left: 0;
right: 0;
margin: 0 auto;
padding: 5px 10px;
z-index: 20;
height: 150px;
flex-direction: column;
top: calc(100% + 10px);
left: 50%;
transform: translateX(-50%);
margin: 0;
padding: 4px 0;
z-index: 1000;
min-width: 100px;
width: max-content;
background-color: #fff;
width: 80px;
border: 1px solid #eee;
box-shadow: 2px 2px 7px #999;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
list-style: none;
li {
color: rgb(107, 106, 106);
display: block;
float: none;
width: 100%;
border-bottom: 1px solid rgb(207, 206, 206);
margin: 0;
padding: 8px 16px;
line-height: 1.4;
color: #666;
font-size: 13px;
font-weight: normal;
text-align: center;
white-space: nowrap;
border-bottom: 1px solid #f0f0f0;
box-sizing: border-box;
&:last-child {
border: none;
border-bottom: none;
}
&:hover {
cursor: pointer;
color: $theme_color;
background-color: #fff7f7;
}
}
&::before {
position: absolute;
top: -20px;
left: 30px;
top: -6px;
left: 50%;
transform: translateX(-50%);
content: '';
width: 0;
height: 0;
border: 10px solid #999;
border-color: transparent transparent #fff transparent;
border: 6px solid transparent;
border-bottom-color: #fff;
}
&::after {
content: '';
position: absolute;
width: 80px;
height: 20px;
top: -20px;
width: 100%;
height: 10px;
top: -10px;
left: 0;
}
}
&:hover {
.drop-items {
display: block;
display: flex;
}
}
}

View File

@@ -38,6 +38,7 @@ export default {
<style lang="scss" scoped>
.model-form {
position: relative;
z-index: 0;
width: 100%;
}
.model-content {

View File

@@ -193,8 +193,10 @@ export default {
}
.carousel-wrap {
width: 100%;
max-width: 1200px;
margin: 0 auto;
box-sizing: border-box;
overflow: visible;
overflow: hidden;
}
.bannerAd{
width: 100%;

View File

@@ -4,15 +4,15 @@
<!-- 侧边导航占位 CateNav 分类栏同宽勿与 CateNav .nav-side 混用类名 -->
<div class="carousel-side-spacer"></div>
<div class="nav-content">
<!-- 轮播图数据时不挂载 el-carousel避免 Element Plus 卸载子项时报错 -->
<!-- 轮播图有效图片时不挂载 el-carousel勿对 el-carousel 使用随图片变化的 key否则 Vue3 patch 会报 emitsOptions 错误 -->
<el-carousel
v-if="carouselList.length"
:key="carouselRenderKey"
v-if="displaySlides.length"
height="334px"
:interval="5000"
:loop="displaySlides.length > 1"
>
<el-carousel-item
v-for="(item, index) in carouselList"
v-for="(item, index) in displaySlides"
:key="carouselItemKey(item, index)"
>
<div class="swiper-img">
@@ -96,10 +96,8 @@ export default {
carouselList() {
return this.data?.options?.list || [];
},
carouselRenderKey() {
const moduleKey = this.data?.key || "carousel";
const imgs = this.carouselList.map((item) => item?.img || "").join("|");
return `${moduleKey}-${this.carouselList.length}-${imgs}`;
displaySlides() {
return this.carouselList.filter((item) => item && item.img);
},
},
data() {
@@ -291,12 +289,14 @@ export default {
}
.model-carousel {
width: 1200px;
max-width: 100%;
width: 100%;
max-width: 1200px;
height: 340px;
margin: 0 auto;
overflow: visible;
overflow: hidden;
box-sizing: border-box;
position: relative;
z-index: 0;
}
.hover-pointer {
@@ -358,14 +358,14 @@ export default {
}
/* 导航主体:固定列宽与 CateNav 完全一致(263.2 + 10 + 637 + 10 + 263.2 = 1183.4px */
/* 导航主体263.2 + 10 + 1fr + 10 + 263.2 = 1200px与下方楼层右缘对齐 */
.nav-body {
width: 1200px;
max-width: 100%;
width: 100%;
max-width: 1200px;
height: 340px;
margin: 0 auto;
display: grid;
grid-template-columns: 263.2px 637px 263.2px;
grid-template-columns: 263.2px minmax(0, 1fr) 263.2px;
column-gap: 10px;
align-items: start;
box-sizing: border-box;
@@ -385,9 +385,8 @@ export default {
/*导航内容*/
.nav-content {
grid-column: 2;
width: 637px;
min-width: 637px;
max-width: 637px;
width: 100%;
min-width: 0;
margin-top: 10px;
height: 333.9px;
position: relative;

View File

@@ -260,7 +260,7 @@ export default {
}
.cate-nav {
position: relative;
z-index: 3;
z-index: 5;
width: 100%;
margin: 14px 0 0;
box-sizing: border-box;
@@ -286,6 +286,7 @@ export default {
font-weight: normal;
color: #333333;
letter-spacing: 0px;
box-sizing: border-box;
}
.nav-item {
flex: 1;
@@ -317,7 +318,7 @@ export default {
position: absolute;
left: 0;
top: 46px;
z-index: 10;
z-index: 1000;
}
.nav-side {
@@ -356,11 +357,14 @@ export default {
.nav-side ul {
width: 100%;
list-style: none;
margin: 0;
padding: 0;
}
.nav-side li {
padding: 0 0 16.2px 37.4px;
font-size: 13px;
line-height: 18px;
box-sizing: border-box;
}
.nav-side-item:hover {
cursor: pointer;