沙盘演示系统应用的微信小程序
zuoxiao
2024-08-28 eb3dbfdcb126beeb1d08f3306ac8f5bbc466e133
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<wxs module="this" src="./index.wxs" />
<wxs module="_" src="../common/utils.wxs" />
 
<view
  wx:if="{{wrapperVisible}}"
  class="{{classPrefix}} class {{prefix}}-class"
  style="{{_._style([this.getStyles(top, zIndex), style, customStyle])}}"
>
  <view
    class="{{ classPrefix }}__mask"
    hidden="{{!show}}"
    style="{{_._style(['height:' + maskHeight + 'px', style, customStyle])}}"
    bind:tap="handleMaskClick"
    catchtouchmove="closeDropdown"
  ></view>
  <t-popup
    visible="{{show}}"
    z-index="{{zIndex + 1}}"
    duration="{{duration}}"
    show-overlay="{{showOverlay}}"
    custom-style="position: absolute"
    overlay-props="{{ { style: 'position: absolute' } }}"
    bind:leaved="onLeaved"
    bind:visible-change="handleMaskClick"
    t-class="{{classPrefix}}__popup-host"
    t-class-content="{{classPrefix}}__content {{prefix}}-class-content"
  >
    <view class="{{classPrefix}}__body">
      <!-- 单选列表 -->
      <scroll-view wx:if="{{!multiple}}" class="{{classPrefix}}__scroll" scroll-y scroll-into-view="id_{{value}}">
        <t-radio-group
          class="{{classPrefix}}__radio {{prefix}}-class-column"
          t-class="{{classPrefix}}__radio-group"
          style="grid-template-columns: repeat({{optionsColumns}}, 1fr)"
          value="{{value}}"
          placement="right"
          bind:change="handleRadioChange"
        >
          <view wx:for="{{options}}" wx:key="index" id="id_{{item[valueAlias]}}">
            <t-radio
              tabindex="0"
              icon="line"
              class="{{classPrefix}}__radio-item {{prefix}}-class-column-item"
              t-class="radio"
              t-class-label="{{prefix}}-class-column-item-label"
              value="{{item[valueAlias]}}"
              label="{{item[labelAlias]}}"
              disabled="{{item.disabled}}"
            />
          </view>
        </t-radio-group>
      </scroll-view>
      <!-- 多选列表 -->
      <scroll-view wx:else class="{{classPrefix}}__scroll" scroll-y scroll-into-view="id_{{firstCheckedValue}}">
        <t-checkbox-group
          class="{{classPrefix}}__checkbox {{prefix}}-class-column"
          t-class="{{classPrefix}}__checkbox-group"
          style="grid-template-columns: repeat({{optionsColumns}}, 1fr)"
          value="{{value}}"
          bind:change="handleRadioChange"
        >
          <view wx:for="{{options}}" wx:key="index" id="id_{{item[valueAlias]}}">
            <t-checkbox
              tabindex="0"
              class="{{classPrefix}}__checkbox-item {{prefix}}-class-column-item"
              theme="tag"
              value="{{item[valueAlias]}}"
              label="{{item[labelAlias]}}"
              disabled="{{item.disabled}}"
            ></t-checkbox>
          </view>
        </t-checkbox-group>
      </scroll-view>
 
      <slot />
    </view>
    <view class="{{classPrefix}}__footer {{prefix}}-class-footer" wx:if="{{multiple}}">
      <t-button
        block
        class="{{classPrefix}}__footer-btn {{classPrefix}}__reset-btn"
        theme="light"
        disabled="{{value.length == 0}}"
        bindtap="handleReset"
        >重置</t-button
      >
      <t-button
        block
        class="{{classPrefix}}__footer-btn {{classPrefix}}__confirm-btn"
        theme="primary"
        disabled="{{value.length == 0}}"
        bindtap="handleConfirm"
        >确定</t-button
      >
    </view>
  </t-popup>
</view>