Skip to content

Commit df2f961

Browse files
author
zhusha
committed
style:多模块样式调整
1 parent 0e32f3b commit df2f961

10 files changed

Lines changed: 61 additions & 58 deletions

File tree

src/assets/css/common/face-body/pc/_variables.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// ==================== 设计稿 Token (PVX4.0 Figma) ====================
3737

3838
// 边框
39-
@pvx-border-color: #e2e8f0;
39+
@pvx-border-color: #EEF1F6;
4040

4141
// 阴影
4242
@pvx-shadow-light: 0 2px 2px rgba(0, 0, 0, 0.05);

src/assets/css/common/face-body/pc/list-card.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
border: 1px solid @pvx-border-color;
3333
border-radius: @pvx-radius-pill;
3434
box-shadow: @pvx-shadow-light;
35-
padding: 10px 30px;
35+
padding: 20px 30px;
3636
height: 60px;
3737
box-sizing: border-box;
38+
font-size: 14px;
3839

3940
&.input-wrap {
4041
.el-input__wrapper {
@@ -81,11 +82,16 @@
8182
.flex;
8283
flex-wrap: wrap;
8384
gap: 40px;
85+
margin-top: 24px;
8486

8587
.m-pvx-type__container {
8688
flex: 1 1 calc(50% - 20px);
8789
min-width: calc(50% - 20px);
8890
}
91+
92+
.m-pvx-type__box {
93+
margin-top: 0;
94+
}
8995
}
9096

9197
.u-pvx-type {
@@ -440,6 +446,7 @@
440446
transition: all 0.3s ease;
441447
width: var(--pvx-module-card-width, 190px);
442448
height: var(--pvx-module-card-height, 280px);
449+
min-width: 80px;
443450
color: #9ba3bc;
444451
.fz(16px);
445452

@@ -460,7 +467,6 @@
460467
// JS动态计算: repeat(per, 190px) 1fr,覆盖组件内联style
461468
grid-template-columns: var(--pvx-face-grid, repeat(3, 190px) 1fr) !important;
462469
gap: 20px !important;
463-
overflow-x: hidden !important;
464470
padding: 0 !important;
465471
}
466472

src/assets/css/common/face-body/pc/single.less

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@
109109
align-items: flex-start;
110110
margin-top: 16px;
111111
gap: 20px;
112-
.w(100%);
112+
width: fit-content;
113113

114114
// 设计稿 Frame 269: 白色圆角卡片
115115
.r(@pvx-radius-xl-large);
116-
padding: 30px;
116+
padding: 30px 180px 30px 30px;
117117
box-sizing: border-box;
118118
background: #fff;
119119
box-shadow: @pvx-shadow-light;
@@ -360,7 +360,6 @@
360360
box-shadow: @pvx-shadow-light;
361361
.flex;
362362
flex-direction: column;
363-
gap: 15px;
364363
}
365364

366365
// 设计稿 Frame 281: 紫色竖条 + 标题
@@ -692,7 +691,7 @@
692691
height: calc(100% - 40px);
693692
overflow: hidden;
694693
background-color: #fff;
695-
.r(10px);
694+
.r(48px);
696695
}
697696

698697
.u-pvx-bg {
@@ -732,13 +731,6 @@
732731
}
733732
}
734733

735-
.u-pvx-about-author {
736-
.fz(28px);
737-
.bold;
738-
margin-top: 24px;
739-
color: @pvx-text-primary;
740-
}
741-
742734
.m-pvx-author__header {
743735
margin-top: 16px;
744736
.r(@pvx-radius-pill);
@@ -1258,10 +1250,7 @@
12581250
}
12591251

12601252
.m-pvx-single__content-box {
1261-
.r(@pvx-radius-pill);
1253+
.r(48px);
12621254
background: #fff;
1263-
border: 1px solid @pvx-border-color;
1264-
box-shadow: @pvx-shadow-light;
1265-
padding: 20px;
12661255
box-sizing: border-box;
12671256
}

src/assets/css/common/search.less

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@
4949

5050
.type-item {
5151
margin-right: 20px;
52-
width: 100px;
53-
height: 40px;
54-
line-height: 40px;
52+
padding: 8px 20px;
53+
line-height: 24px;
5554
border-radius: 30px;
5655
color: #949494;
5756
background-color: #fff;
@@ -62,6 +61,7 @@
6261

6362
&.is-active {
6463
background-color: @active-color;
64+
box-shadow: 0 4px 12px 0 rgba(120, 108, 187, 0.20);
6565

6666
.el-radio-button__inner {
6767
background-color: @active-color;
@@ -71,6 +71,7 @@
7171

7272
&:hover {
7373
background-color: @active-color;
74+
box-shadow: 0 4px 12px 0 rgba(120, 108, 187, 0.20);
7475

7576
.el-radio-button__inner {
7677
background-color: @active-color;
@@ -94,12 +95,16 @@
9495

9596
.filter-img {
9697
cursor: pointer;
97-
height: 40px;
98+
.flex;
99+
align-items: center;
100+
justify-content: center;
101+
.size(30px, 30px);
98102

99103
svg {
100104
fill: #949494;
101105
background-color: #fff;
102106
border-radius: 50%;
107+
.size(24px, 24px);
103108
}
104109

105110
&.active {

src/components/common/card_banner_list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ export default {
104104
flex: 1;
105105
.grid;
106106
gap: 10px;
107-
overflow-x: auto;
107+
108108
padding:10px 0;
109109
110110
.m-cardlist-item {
111111
box-sizing: border-box;
112112
background: #fff;
113-
border: 2px solid #fff;
113+
border: none;
114114
transition: 0.3s ease-out;
115115
// box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
116116

src/components/common/face-body/SingleRandomList.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class="m-pvx-random__list">
3-
<div class="u-pvx-list m-pvx-single__content-box m-pvx-author__faces" v-if="list && list.length">
2+
<div class="m-pvx-random__list" v-if="list && list.length">
3+
<div class="u-pvx-list m-pvx-single__content-box m-pvx-author__faces">
44
<ListItem
55
class="u-pvx-item"
66
:type="type"
@@ -19,7 +19,7 @@ import ListItem from "@/components/common/face-body/ListItem.vue";
1919
/**
2020
* SingleRandomList - 详情页随机推荐列表组件
2121
* 用于脸型/体型详情页展示作者其他作品推荐
22-
*
22+
*
2323
* 样式说明:
2424
* - 组件使用原有类名 m-random-list、u-list 等
2525
* - 样式由页面引入的 less 文件控制(body/single.less 或 face/single.less)

src/components/common/face-body/Tabs.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
<!--
1+
<!--
22
* tabs - 列表页标签筛选组件
3-
*
3+
*
44
* @description 用于脸型/体型列表页的搜索和筛选功能,包含搜索框、筛选器、发布入口
55
* @author Face & Body 模块优化团队
66
* @version 1.0.0
7-
*
7+
*
88
* @features
99
* - 支持face和body两种类型
1010
* - 集成PvxSearch搜索组件
1111
* - 支持多条件筛选
1212
* - 支持数据解析入口
1313
* - 支持发布作品入口
14-
*
14+
*
1515
* @props
1616
* - type: 'face' | 'body' - 模块类型
1717
* - active: Number - 当前激活标签
1818
* - searchItems: Array - 搜索项配置
1919
* - initSearchValue: Object - 初始搜索值
2020
* - filterOpen: Boolean - 筛选面板是否打开
21-
*
21+
*
2222
* @events
2323
* - change: 筛选条件变化事件
24-
*
24+
*
2525
* @styles
2626
* - 样式文件: assets/css/face/list.less 或 assets/css/body/list.less
2727
-->
@@ -273,6 +273,7 @@ export default {
273273
&.is-active {
274274
// !important: 覆写 ElementPlus el-radio-button 内部样式
275275
background-color: @pvx-color-face !important;
276+
box-shadow: 0 4px 12px 0 rgba(120, 108, 187, 0.20);
276277
277278
.el-radio-button__inner {
278279
// !important: 覆写 ElementPlus el-radio-button__inner 内联样式
@@ -300,7 +301,7 @@ export default {
300301
.r(10px);
301302
padding: 10px 10px 10px 15px;
302303
background-color: #fff;
303-
border: 1px solid #e2e8f0;
304+
border: 1px solid #EEF1F6;
304305
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05);
305306
box-sizing: border-box;
306307
}

src/views/body/Single.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
* Single - 体型模块详情页
3-
*
3+
*
44
* @description 展示体型详情信息,包括图片预览、数据分析、购买下载、作者信息等
55
* @author Face & Body 模块优化团队
66
* @version 2.0.0
7-
*
7+
*
88
* @features
99
* - 图片轮播预览
1010
* - 体型数据分析展示
@@ -43,7 +43,6 @@
4343
</div>
4444
</div>
4545

46-
<div class="u-pvx-about-author">关于作者</div>
4746
<authorItem :uid="post.user_id" />
4847
<SingleRandomList :list="randomList" type="body" />
4948

src/views/face/List.vue

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<!--
1+
<!--
22
* List - 脸型模块列表页
3-
*
3+
*
44
* @description 展示脸型列表,支持推荐列表和全部列表两种模式
55
* @author Face & Body 模块优化团队
66
* @version 2.0.0
7-
*
7+
*
88
* @features
99
* - 支持按脸型类型分类展示(写实、写意)
1010
* - 支持推荐列表和全部列表切换
1111
* - 支持分页加载
1212
* - 支持搜索筛选
1313
* - 响应式布局适配
1414
* - 支持公告展示
15-
*
15+
*
1616
* @components
1717
* - faceTabs: 标签页组件
1818
* - PublicNotice: 公告组件
1919
* - CardBannerList: 卡片轮播列表组件
2020
* - ListItem: 列表项组件
21-
*
21+
*
2222
* @styles
2323
* - 样式文件: assets/css/face/list.less
2424
* - 样式文件: assets/css/face/item.less
@@ -27,7 +27,7 @@
2727
<div class="p-pvx-face-list" v-loading="loading" ref="listRef">
2828
<faceTabs :body_types="list" :active="active" :link="link" @change="handleFaceTabChange" />
2929
<PublicNotice bckey="face_ac" />
30-
<div class="m-pvx-recommend__grid" :style="{ '--pvx-face-grid': `repeat(${per}, 190px) 1fr` }" v-if="active === -1">
30+
<div class="m-pvx-recommend__grid" :style="{ '--pvx-face-grid': per > 0 ? `repeat(${per}, 190px) 1fr` : '1fr' }" v-if="active === -1">
3131
<div v-for="(item, index) in recommendList" :key="'l' + index" class="m-pvx-type__box m-pvx-type__container"
3232
:class="{ none: !item.list.length }">
3333
<CardBannerList :class="{ search: tabsData.title }" :count="count" :minw="190"
@@ -158,23 +158,27 @@ export default {
158158
}
159159
160160
if (this.active === -1) {
161-
// 全部模式:每个类别最多6个数据 + 1个查看全部
162-
// .m-pvx-recommend__grid 是 flex 布局,两个分类并排(gap:40px)
163-
// 每个容器宽度 ≈ (整体宽度 - 40) / 2,再减去容器 padding(30*2=60)
164161
const totalWidth = this.$refs.listRef?.clientWidth || 1200;
165162
const containerWidth = (totalWidth - 40) / 2 - 60;
166-
const cardWidth = 190; // 固定卡片宽度
167-
const gridGap = 20; // gap = 20px
163+
const cardWidth = 190;
164+
const viewAllMinWidth = 80;
165+
const gridGap = 20;
168166
169-
// 计算能完整放下多少个190px卡片(含gap),查看全部占用剩余宽度(1fr)
170-
// 不为查看全部预留完整卡片位置,剩余零碎宽度给查看全部即可
171167
const maxSlots = Math.floor((containerWidth + gridGap) / (cardWidth + gridGap));
172168
173-
// 每个类别最多6个数据,最少1个,查看全部吸收剩余宽度
174-
this.per = Math.min(Math.max(maxSlots, 1), 6);
175-
176-
// grid列数 = 数据卡片数 + 查看全部(1fr吸收剩余空间)
177-
this.count = this.per + 1;
169+
const remainingAfterCards = containerWidth - maxSlots * cardWidth - (maxSlots - 1) * gridGap;
170+
171+
if (remainingAfterCards >= viewAllMinWidth) {
172+
this.per = Math.min(Math.max(maxSlots, 1), 6);
173+
this.count = this.per + 1;
174+
} else {
175+
this.per = Math.min(Math.max(maxSlots - 1, 0), 6);
176+
if (this.per === 0) {
177+
this.count = 1;
178+
} else {
179+
this.count = this.per + 1;
180+
}
181+
}
178182
} else {
179183
// 非全部模式:按容器宽度动态计算
180184
const containerPadding = 60;

src/views/face/Single.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
* Single - 脸型模块详情页
3-
*
3+
*
44
* @description 展示脸型详情信息,包括图片预览、数据分析、购买下载、作者信息等
55
* @author Face & Body 模块优化团队
66
* @version 2.0.0
7-
*
7+
*
88
* @features
99
* - 图片轮播预览
1010
* - 脸型数据分析展示(写实/写意)
@@ -59,7 +59,6 @@
5959
</div>
6060
</div>
6161

62-
<div class="u-pvx-about-author">关于作者</div>
6362
<authorItem :uid="post.user_id" />
6463
<SingleRandomList :list="randomList" type="face" />
6564

0 commit comments

Comments
 (0)