管灌系统农户端微信小程序(嘉峪关应用)
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
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
<import src="../common/template/image.wxml" />
<import src="../common/template/icon.wxml" />
<wxs module="util">
  module.exports.getImageSize = function(column) { if (column >= 5) return 'small'; if (column == 4) return 'middle';
  return 'large'; }
</wxs>
<wxs module="_" src="../common/utils.wxs" />
 
<view
  class="{{_.cls(classPrefix, [['auto-size', column == 0]])}} class {{prefix}}-class"
  style="{{_._style([gridItemStyle, style, customStyle])}}"
  hover-class="{{hover ? classPrefix + '--hover':''}}"
  hover-stay-time="{{200}}"
  bindtap="onClick"
  aria-role="{{ariaRole || 'button'}}"
  aria-label="{{ariaLabel}}"
  aria-describedby="{{describedbyID}}"
>
  <view class="{{_.cls(classPrefix + '__wrapper', [layout])}}" style="{{gridItemWrapperStyle}}">
    <view
      class="{{_.cls(classPrefix + '__content', [align, layout])}} {{prefix}}-class-content"
      style="{{gridItemContentStyle}}"
    >
      <slot />
      <t-badge
        wx:if="{{image || icon}}"
        color="{{badgeProps.color || ''}}"
        content="{{badgeProps.content || ''}}"
        count="{{badgeProps.count || 0}}"
        dot="{{badgeProps.dot || false}}"
        max-count="{{badgeProps.maxCount || 99}}"
        offset="{{badgeProps.offset || []}}"
        shape="{{badgeProps.shape || 'circle'}}"
        show-zero="{{badgeProps.showZero || false}}"
        size="{{badgeProps.size || 'medium'}}"
        t-class="{{badgeProps.tClass}}"
        t-class-content="{{badgeProps.tClassContent}}"
        t-class-count="{{badgeProps.tClassCount}}"
      >
        <view
          class="{{_.cls(classPrefix + '__image', [util.getImageSize(column), ['icon', icon]])}} {{prefix}}-class-image"
        >
          <block wx:if="{{image && image != 'slot'}}">
            <template
              is="image"
              data="{{ src: image, shape: 'round', mode: 'widthFix', tClass: _.cls(classPrefix + '__image', [util.getImageSize(column)]) + ' ' + prefix + '-class-image', ...imageProps }}"
            />
          </block>
          <slot name="image" />
          <template
            wx:if="{{iconName || _.isNoEmptyObj(iconData)}}"
            is="icon"
            data="{{class: classPrefix + '__icon', name: iconName, ...iconData}}"
          />
        </view>
      </t-badge>
      <view
        class="{{_.cls(classPrefix + '__words', [layout])}}"
        id="{{describedbyID}}"
        aria-label="{{ ariaLabel || (badgeProps.dot || badgeProps.count ? text + ',' +  description + ',' + _.getBadgeAriaLabel({ ...badgeProps }) : '') }}"
      >
        <view
          wx:if="{{text}}"
          class="{{_.cls(classPrefix + '__text', [util.getImageSize(column), layout])}} {{prefix}}-class-text"
        >
          {{text}}
        </view>
        <slot name="text" />
        <view
          wx:if="{{description}}"
          class="{{_.cls(classPrefix + '__description', [util.getImageSize(column), layout])}} {{prefix}}-class-description"
        >
          {{description}}
        </view>
        <slot name="description" />
      </view>
    </view>
  </view>
</view>