<block wx:for="{{formArray}}" wx:key="index">
|
<block wx:if="{{!item.hide}}">
|
<block wx:if="{{item.inputType == 'text'}}">
|
<t-input
|
label="{{item.label}}"
|
placeholder="{{item.placeholder}}"
|
value="{{item.value}}"
|
data-index="{{index}}"
|
bind:change="onInputChange"
|
/>
|
</block>
|
<block wx:elif="{{item.inputType == 'switch'}}">
|
<t-cell title="{{item.label}}">
|
<t-switch
|
defaultValue="{{item.value}}"
|
label="{{['是', '否']}}"
|
slot="note"
|
data-index="{{index}}"
|
bind:change="onSwitchChange"
|
/>
|
</t-cell>
|
</block>
|
<block wx:elif="{{item.inputType == 'picker'}}">
|
<t-cell
|
title="{{item.label}}"
|
arrow
|
hover
|
note="{{item._label || item.placeholder}}"
|
data-index="{{index}}"
|
bind:click="showPicker"
|
></t-cell>
|
<t-picker
|
visible="{{item.visible}}"
|
value="{{item._value}}"
|
data-index="{{index}}"
|
title="{{'选择' + item.label}}"
|
cancelBtn="取消"
|
confirmBtn="确认"
|
bindchange="onPickerChange"
|
bindcancel="onPickerCancel"
|
>
|
<t-picker-item options="{{item.options}}"></t-picker-item>
|
</t-picker>
|
</block>
|
<block wx:elif="{{item.inputType == 'cascader'}}">
|
<t-cell
|
title="{{item.label}}"
|
arrow
|
hover
|
note="{{item.note || item.placeholder}}"
|
data-index="{{index}}"
|
bind:click="showCascader"
|
></t-cell>
|
<t-cascader
|
visible="{{item.visible}}"
|
value="{{item._value}}"
|
options="{{item.options}}"
|
sub-titles="{{item.cascaderTitles}}"
|
title="{{'选择' + item.label}}"
|
data-index="{{index}}"
|
bind:change="onCascaderChange"
|
/>
|
</block>
|
</block>
|
</block>
|
<slot></slot>
|
<view class="btn-group">
|
<t-button
|
block
|
theme="light"
|
content="{{cancelText}}"
|
size="small"
|
bind:tap="onCancel"
|
></t-button>
|
<t-button
|
block
|
theme="primary"
|
content="{{submitText}}"
|
size="small"
|
bind:tap="onSubmit"
|
></t-button>
|
</view>
|