管灌系统农户端微信小程序(嘉峪关应用)
zuoxiao
2024-02-26 3f7ec892d68f71e996489d14d9918dc332281b1e
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
<template name="grid">
  <block wx:if="{{gridThemeItems.length === 1}}">
    <t-grid align="center" t-class="{{classPrefix}}__grid" column="{{count / 2}}" class="{{classPrefix}}__single-wrap">
      <t-grid-item
        t-class="{{classPrefix}}__grid-item"
        class="{{classPrefix}}__square"
        wx:for="{{gridThemeItems[0]}}"
        wx:key="index"
        bind:tap="onSelect"
        data-index="{{index}}"
        icon="{{ { name: item.icon, color: item.color } }}"
        text="{{item.label}}"
        image="{{item.image}}"
        style="--td-grid-item-text-color: {{item.color}}"
      >
      </t-grid-item>
    </t-grid>
  </block>
  <block wx:elif="{{gridThemeItems.length > 1}}">
    <view class="{{classPrefix}}__swiper-wrap">
      <swiper style="height: 456rpx" autoplay="{{false}}" current="{{currentSwiperIndex}}" bindchange="onSwiperChange">
        <swiper-item wx:for="{{gridThemeItems}}" wx:key="index">
          <t-grid align="center" t-class="{{classPrefix}}__grid {{classPrefix}}__grid--swiper" column="{{count / 2}}">
            <t-grid-item
              t-class="{{classPrefix}}__grid-item"
              class="{{classPrefix}}__square"
              wx:for="{{item}}"
              wx:key="index"
              data-index="{{index}}"
              bind:tap="onSelect"
              icon="{{ { name: item.icon, color: item.color } }}"
              text="{{item.label}}"
              image="{{item.image}}"
              style="--td-grid-item-text-color: {{item.color}}"
            >
            </t-grid-item>
          </t-grid>
        </swiper-item>
      </swiper>
      <view class="{{classPrefix}}__nav">
        <view class="{{classPrefix}}__dots">
          <view
            wx:for="{{gridThemeItems.length}}"
            wx:key="index"
            class="{{classPrefix}}__dots-item {{index === currentSwiperIndex ? prefix + '-is-active' : ''}}"
          />
        </view>
      </view>
    </view>
  </block>
</template>