Commit fc572a67 by Lin

feat(AddFiles, DetailFiles):增强占位符处理与显示逻辑

- 更新了 AddFiles 和 DetailFiles 组件中的占位符文本,为用户输入提供更清晰的上下文。
- 优化了选择字段的显示逻辑,更有效地利用占位符,确保用户体验的一致性。
1 parent c392edee
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i)" @click="showPopup(i)"
> >
<view class="value text-hide">{{ getFieldDisplayValue(i) || '请选择' }}</view> <view class="value text-hide">{{ getFieldDisplayValue(i) || i.placeholder || `请选择${i.label}` }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view> </view>
</template> </template>
...@@ -235,7 +235,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -235,7 +235,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'sellerName', valueKey: 'sellerName',
key: 'sellerUserId', key: 'sellerUserId',
type: 'select', type: 'select',
popKey: 'residentSaleVisible' popKey: 'residentSaleVisible',
placeholder: '请选择驻店零售'
}] }]
export default { export default {
name: 'AddFiles', name: 'AddFiles',
......
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
<view class="required" v-if="i.required">*</view>{{ i.label }} <view class="required" v-if="i.required">*</view>{{ i.label }}
</view> </view>
<template v-if="i.type == 'readonly'"> <template v-if="i.type == 'readonly'">
<view class="input input--readonly text-hide">{{ getFieldDisplayValue(i) || '-' }}</view> <view :class="['input input--readonly text-hide', { placeholderStyle: !getFieldDisplayValue(i) && i.placeholder }]">
{{ getFieldDisplayValue(i) || (i.placeholder || '-') }}
</view>
</template> </template>
<template v-else-if="i.type == 'input'"> <template v-else-if="i.type == 'input'">
<input <input
...@@ -50,7 +52,7 @@ ...@@ -50,7 +52,7 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]" :class="['input', { error: i.error }]"
placeholder="请选择" :placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
@blur="inputBlur($event, i)" @blur="inputBlur($event, i)"
...@@ -99,7 +101,7 @@ ...@@ -99,7 +101,7 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]" :class="['input', { error: i.error }]"
placeholder="请选择" :placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
@blur="inputBlur($event, i)" @blur="inputBlur($event, i)"
...@@ -157,7 +159,7 @@ ...@@ -157,7 +159,7 @@
:maxlength="i.maxlength" :maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]" v-model="customerInfo[i.valueKey]"
class="input input--count" class="input input--count"
placeholder="请输入" :placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);" placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done" confirm-type="done"
/> />
...@@ -169,7 +171,7 @@ ...@@ -169,7 +171,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]" :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)" @click="showPopup(i.popKey)"
> >
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view> <view class="value text-hide">{{ customerInfo[i.valueKey] || i.placeholder || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons> <uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view> </view>
</template> </template>
...@@ -245,7 +247,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -245,7 +247,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'customerPhone', valueKey: 'customerPhone',
key: 'customerPhone', key: 'customerPhone',
type: 'readonly', type: 'readonly',
required: true required: true,
placeholder: '请输入车主手机号'
}, },
{ {
label: '车型', label: '车型',
...@@ -317,7 +320,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/, ...@@ -317,7 +320,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'contact_name', valueKey: 'contact_name',
key: 'contact_id', key: 'contact_id',
type: 'select', type: 'select',
popKey: 'groupMemberVisible' popKey: 'groupMemberVisible',
placeholder: '请选择群成员'
}, },
{ {
label: '备注', label: '备注',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!