style: 优化表单组件的样式与布局细节
调整了标签字体大小、最大宽度限制,重构了表单项的内边距、边框样式和间距,统一了输入框、文本域等组件的尺寸与视觉表现,优化了整体排版一致性
This commit is contained in:
@@ -305,7 +305,7 @@ export default {
|
||||
},
|
||||
labelFontSize: {
|
||||
type: [String, Number],
|
||||
default: 30
|
||||
default: 26
|
||||
},
|
||||
labelColor: {
|
||||
type: String,
|
||||
@@ -398,8 +398,8 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
maxWidth = Math.max(maxWidth, 80);
|
||||
maxWidth = Math.min(maxWidth, 200);
|
||||
maxWidth = Math.max(maxWidth, 60);
|
||||
maxWidth = Math.min(maxWidth, 160);
|
||||
|
||||
this.maxLabelWidth = maxWidth;
|
||||
},
|
||||
@@ -762,18 +762,18 @@ export default {
|
||||
}
|
||||
|
||||
.order-wrap {
|
||||
padding: 12rpx 0;
|
||||
padding: 4rpx 14rpx;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
left: 14rpx;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
right: 14rpx;
|
||||
height: 1rpx;
|
||||
background: linear-gradient(90deg, transparent, #f0f0f0, transparent);
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
@@ -790,14 +790,15 @@ export default {
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
padding: 12rpx 0;
|
||||
padding: 0;
|
||||
min-height: 64rpx;
|
||||
|
||||
// 水平布局(默认):标签自动宽度(以最大为准),根据组件特性对齐
|
||||
&:not(.vertical-layout) {
|
||||
.name {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 0;
|
||||
margin-right: 20rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,7 +808,7 @@ export default {
|
||||
|
||||
.name {
|
||||
width: 100%;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@@ -818,13 +819,19 @@ export default {
|
||||
|
||||
&.textarea {
|
||||
align-items: flex-start;
|
||||
|
||||
.name {
|
||||
padding-top: 16rpx;
|
||||
height: auto;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&.clear-flex {
|
||||
display: block;
|
||||
|
||||
.box {
|
||||
margin-top: 16rpx;
|
||||
margin-top: 12rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
@@ -845,22 +852,26 @@ export default {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
|
||||
.tit {
|
||||
text-align: left;
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
color: #1f2937;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.3rpx;
|
||||
letter-spacing: 0.2rpx;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.required {
|
||||
color: #ef4444;
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
margin-left: 4rpx;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
@@ -886,13 +897,13 @@ export default {
|
||||
}
|
||||
|
||||
input {
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: left;
|
||||
height: 80rpx;
|
||||
height: 64rpx;
|
||||
border: 2rpx solid #f3f4f6;
|
||||
border-radius: 16rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 12rpx;
|
||||
line-height: 64rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #f9fafb;
|
||||
color: #1f2937;
|
||||
transition: all 0.3s ease;
|
||||
@@ -900,7 +911,7 @@ export default {
|
||||
&:focus {
|
||||
background: #fff;
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 0 6rpx rgba(59, 130, 246, 0.08);
|
||||
box-shadow: 0 0 0 4rpx rgba(59, 130, 246, 0.08);
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
@@ -911,15 +922,17 @@ export default {
|
||||
textarea {
|
||||
font-size: 28rpx;
|
||||
width: 100%;
|
||||
min-height: 160rpx;
|
||||
min-height: 200rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: left;
|
||||
border: 2rpx solid #f3f4f6;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background: #f9fafb;
|
||||
color: #1f2937;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
|
||||
&:focus {
|
||||
background: #fff;
|
||||
@@ -934,14 +947,14 @@ export default {
|
||||
|
||||
.uni-input, .select-address {
|
||||
display: inline-block;
|
||||
padding: 16rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #f9fafb;
|
||||
border: 2rpx solid #f3f4f6;
|
||||
color: #1f2937;
|
||||
font-size: 28rpx;
|
||||
font-size: 26rpx;
|
||||
transition: all 0.3s ease;
|
||||
min-height: 80rpx;
|
||||
min-height: 64rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
&.color-tip {
|
||||
@@ -974,9 +987,9 @@ export default {
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
padding: 12rpx 20rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
border: 2rpx solid #e5e7eb;
|
||||
border-radius: 40rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #fff;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
@@ -996,10 +1009,10 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border: 2rpx dashed #d1d5db;
|
||||
border-radius: 16rpx;
|
||||
border-radius: 12rpx;
|
||||
position: relative;
|
||||
background: #f9fafb;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
Reference in New Issue
Block a user