riku
2024-08-12 65124213af664a68ad88ce7f6dcb133116d7702f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<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>