<block wx:for="{{formArr}}" wx:key="index">
|
<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
|
label="{{['是', '否']}}"
|
slot="note"
|
data-index="{{index}}"
|
bind:change="onSwitchChange"
|
/>
|
</t-cell>
|
</block>
|
<block wx:elif="{{item.inputType == 'picker'}}">
|
<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
|
bordered="{{false}}"
|
title="{{item.label}}"
|
arrow
|
hover
|
note="{{item.note}}"
|
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>
|
|
<view class="btn-group">
|
<t-button block theme="light" content="取消" size="small" bind:tap="onCancel"></t-button>
|
<t-button block theme="primary" content="保存" size="small" bind:tap="onSubmit"></t-button>
|
</view>
|