管灌系统农户端微信小程序(嘉峪关应用)
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
<wxs src="./badge.wxs" module="this" />
<wxs src="../common/utils.wxs" module="_" />
 
<!--
  1. labelID 用于描述当前元素的文本
  2. descriptionID 用于描述badge消息的文本
  3. role=option一般用于多个内容合并焦点连续朗读
-->
 
<view
  style="{{_._style([style, customStyle])}}"
  class="{{this.getBadgeOuterClass({shape})}} class {{prefix}}-class"
  aria-labelledby="{{labelID}}"
  aria-describedby="{{descriptionID}}"
  aria-role="{{ ariaRole || 'option'}}"
>
  <view id="{{labelID}}" class="{{classPrefix}}__content {{prefix}}-class-content" aria-hidden="true">
    <slot wx:if="{{!content}}" class="{{classPrefix}}__content-slot" />
    <text wx:else class="{{classPrefix}}__content-text">{{content}}</text>
  </view>
  <view
    aria-hidden="true"
    aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}"
    wx:if="{{this.isShowBadge({dot,count,showZero})}}"
    id="{{descriptionID}}"
    class="{{this.getBadgeInnerClass({dot, size, shape, count})}} {{prefix}}-has-count {{prefix}}-class-count"
    style="{{this.getBadgeStyles({color, offset})}}"
    aria-hidden="true"
    aria-label="{{ ariaLabel || _.getBadgeAriaLabel({dot, count, maxCount}) }}"
  >
    <view
      wx:if="{{shape == 'ribbon'}}"
      class="t-badge__ribbon--before"
      style="{{color ? 'border-color: ' + color : ''}}"
    />
    {{ this.getBadgeValue({dot, count, maxCount}) }}
    <view
      wx:if="{{shape == 'ribbon'}}"
      class="t-badge__ribbon--after"
      style="{{color ? 'border-color: ' + color : ''}}"
    />
  </view>
  <slot name="count" />
</view>