Commit 9443e949 by 李伟康

style(FinishStep): 优化表单组件样式和必填标识显示

- 将必填星号从伪元素改为独立视图组件
- 修复表单项之间的间距布局问题
- 调整选择器占位符样式的优先级
- 优化表单项错误提示的判断逻辑
- 调整选择框的对齐方式为两端对齐
- 移除不必要的flex换行和间隙设置
- 添加errorTip变化的监控日志用于调试
1 parent be029d48
......@@ -33,7 +33,8 @@
<view
class="form-item"
>
<view :class="['label', { required: i.required == true}]">
<view class="label flex">
<view v-if="i.required == true" class="required">*</view>
{{ i.label }}
</view>
<view :class="['value', { error: showError(i.key) && i.required == true }, { disabled: customerType == 0 || i.disabled == true }]">
......@@ -51,7 +52,7 @@
</template>
<template v-else>
<view
:class="['select', `${(formData as UTSJSONObject)[i.key] != '' ? '' : 'placeholder'}`]"
:class="['select', {'placeholder': (formData as UTSJSONObject)[i.key] == ''}]"
@click="showPopup(i)"
:key="selectKey"
>
......@@ -290,7 +291,9 @@
(formRef.value as ComponentPublicInstance).$callMethod('close')
}
}, { immediate: true })
watch(errorTip, () => {
console.log('errorTip', errorTip.value)
})
function showError(key: string): boolean {
const value = formData.value
let flag = (value as UTSJSONObject)[key] == ''
......@@ -419,7 +422,7 @@
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
const value = customerInfo[key] as string | null
if (value == null || value === '') {
if (value == null || value == '') {
stepValue = 1
break
}
......@@ -505,10 +508,8 @@
.form {
display: flex;
flex-wrap: wrap;
gap: 24rpx 0;
padding-top: 30rpx;
flex-direction: column;
&-item {
width: 100%;
display: flex;
......@@ -516,7 +517,7 @@
color: #6c6c70;
font-size: 30rpx;
box-sizing: border-box;
margin: 0 auto;
margin: 0 auto 24rpx;
flex-direction: row;
.label {
position: relative;
......@@ -524,18 +525,8 @@
flex-shrink: 0;
width: 144rpx;
font-size: 30rpx;
&.required {
padding-left: 20rpx;
&::before {
content: '*';
color: #ff0000;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
.required{
color: #ff0000;
}
}
......@@ -572,7 +563,7 @@
.select {
display: flex;
align-items: center;
justify-content: space-between;
.arrow {
margin-left: auto;
}
......@@ -580,7 +571,7 @@
.placeholder {
font-size: 30rpx;
color: #c9c9c9;
color: #c9c9c9 !important;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!