<view wx:for="{{form}}" wx:key="valueName" data-name="{{item.valueName}}">
    <view hidden="{{ !item.required && !showAll }}">
        <!-- 日期选择器 -->
        <view class="picker" wx:if="{{item.type=='date'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="picker-slot" wx:if="{{item.slot}}">
                    <slot name="{{item.slot}}" />
                </view>
                <picker mode='date' value="{{item.value}}" disabled="{{item.disabled}}" fields='{{item.fields||"day"}}' start="{{item.start}}" end="{{item.end}}" data-item="{{item}}" bindchange="bindDateChange">
                    <view class="content">
                        <text wx:if="{{item.value}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value}}</text>
                        <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder}}</text>
                    </view>
                </picker>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 日期范围选择器 -->
        <view class="picker" wx:elif="{{item.type=='dateRange'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="picker-slot" wx:if="{{item.slot}}">
                    <slot name="{{item.slot}}" />
                </view>
                <view class="content" style="display: flex;">
                    <picker mode='date' value="{{item.value[0]}}" disabled="{{item.disabled}}" fields='{{item.fields||"day"}}' start="{{item.start}}" end="{{item.end}}" data-item="{{item}}" data-index="0" bindchange="rangeDateChange">
                        <text wx:if="{{item.value[0]}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value[0]}}</text>
                        <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder[0]}}</text>
                    </picker>
                    <view style="margin: 0 20rpx;color: #000;">至</view>
                    <picker mode='date' value="{{item.value[1]}}" disabled="{{item.disabled}}" fields='{{item.fields||"day"}}' start="{{item.value[0]}}" end="{{item.end}}" data-item="{{item}}" data-index="1" bindchange="rangeDateChange">
                        <text wx:if="{{item.value[1]}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value[1]}}</text>
                        <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder[1]}}</text>
                    </picker>
                </view>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 时间选择器 -->
        <view class="picker" wx:elif="{{item.type=='time'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="picker-slot" wx:if="{{item.slot}}">
                    <slot name="{{item.slot}}" />
                </view>
                <picker mode='time' value="{{item.value}}" disabled="{{item.disabled}}" fields='{{item.fields}}' start="{{item.start}}" end="{{item.end}}" data-item="{{item}}" bindchange="bindDateChange">
                    <view class="content">
                        <text wx:if="{{item.value}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value}}</text>
                        <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder}}</text>
                    </view>
                </picker>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 省市县选择器 -->
        <view class="picker" wx:elif="{{item.type=='region'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="picker-slot" wx:if="{{item.slot}}">
                    <slot name="{{item.slot}}" />
                </view>
                <picker mode='region' value="{{item.value}}" disabled="{{item.disabled}}" data-item="{{item}}" bindchange="bindRegionChange">
                    <view class="content">
                        <text wx:if="{{item.value.length}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value}}</text>
                        <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder}}</text>
                    </view>
                </picker>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 性别 -->
        <view class="picker" wx:elif="{{item.type=='sex'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="content">
                    <van-radio-group value="{{ item.value }}" data-item="{{item}}" bind:change="sexChange">
                        <view style="display: flex;">
                            <van-radio icon-size='16' custom-class='radio' name="男">男</van-radio>
                            <van-radio icon-size='16' name="女">女</van-radio>
                        </view>
                    </van-radio-group>
                </view>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 单选 选择器 -->
        <view class="picker" wx:elif="{{item.type=='radio'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="content">
                    <van-radio-group value="{{ item.value }}" data-item="{{item}}" bind:change="radioChange">
                        <van-radio wx:for="{{item.radioList}}" wx:for-item="it" wx:for-index="i" wx:key="it.name" icon-size="16" custom-class="radio {{i != 0 ? 'radio_margin_top' : '' }}" name="{{it.id}}">{{it.name}}</van-radio>
                    </van-radio-group>
                </view>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 类型选择 -->
        <view class="picker" wx:elif="{{item.type=='option'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="content" style="justify-content: space-between; display: flex; align-items: flex-start;" data-item="{{item}}" bindtap="toOptions">
                    <text wx:if="{{item.value.length}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value}}</text>
                    <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder}}</text>
                    <van-icon name="arrow" style="flex-shrink: 0; margin-top: 12rpx;" />
                </view>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 跳转路由选择 值使用数组，0保存显示名称，1保存ID -->
        <view class="picker" wx:elif="{{item.type=='route'}}">
            <view class="label">
                <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                <text class="text" style="color:{{item.disabled?'#C8C9CC':''}};">{{item.label}}</text>
            </view>
            <view style="position: relative;">
                <view class="content" style="justify-content: space-between; display: flex; align-items: flex-start;" data-item="{{item}}" bindtap="route">
                    <text wx:if="{{item.value.length}}" style="color:{{item.disabled?'#C8C9CC':'#000'}};">{{item.value[0]}}</text>
                    <text wx:else style="color: {{item.error?'#EE4C4E':''}};">{{item.placeholder}}</text>
                    <van-icon name="arrow" style="flex-shrink: 0; margin-top: 12rpx;" />
                </view>
                <view wx:if="{{item.errMsg}}" class="error-tips">{{item.errMsg}}</view>
            </view>
        </view>
        <!-- 输入框 -->
        <van-field wx:else label="{{item.label}}" required="{{item.required}}" value="{{ item.value }}" placeholder="{{item.placeholder||'请填写'}}" label-class='label-class' type="{{item.type}}" error="{{item.error}}" error-message='{{item.errMsg}}' disabled="{{item.disabled}}" autosize border="{{ false }}" bind:input="inputChange" data-item="{{item}}">
            <slot wx:if="{{item.slot}}" name="{{item.slot}}" slot='button' />
        </van-field>
    </view>
</view>