<van-cell-group>
    <block wx:for="{{form}}" wx:key="item.valueName" data-name="{{item.valueName}}">
        <van-transition show="{{ item.required || showAll }}" name="fade" custom-class="block">
            <!-- 日期选择器 -->
            <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">{{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}}" 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: #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=='time'}}">
                <view class="label">
                    <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                    <text class="text">{{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}}" fields='{{item.fields}}' start="{{item.start}}" end="{{item.end}}" data-item="{{item}}" bindchange="bindDateChange">
                        <view class="content">
                            <text wx:if="{{item.value}}" style="color: #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">{{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}}" data-item="{{item}}" bindchange="bindRegionChange">
                        <view class="content">
                            <text wx:if="{{item.value.length}}" style="color: #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">{{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=='option'}}">
                <view class="label">
                    <text class="need" style="color: {{item.required?'#EE0A24':'rgba(0,0,0,0)'}};">*</text>
                    <text class="text">{{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: #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>
            <!-- 输入框 -->
            <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}}' autosize border="{{ false }}" bind:input="inputChange" data-item="{{item}}">
                <slot wx:if="{{item.slot}}" name="{{item.slot}}" slot='button' />
            </van-field>
        </van-transition>
    </block>
</van-cell-group>