index.axml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <view
  2. class="ant-rate {{ className || '' }}"
  3. style="{{ style }}">
  4. <view
  5. id="ant-rate-container{{ $id ? '-' + $id : '' }}"
  6. class="ant-rate-container"
  7. onTouchMove="handleStarMove"
  8. onTouchEnd="handleStarMoveEnd">
  9. <block
  10. a:for="{{ count }}"
  11. a:for-index="index"
  12. a:for-item="item">
  13. <view
  14. class="ant-rate-star"
  15. onTap="handleStarTap"
  16. data-rate="{{ index }}"
  17. style="margin-right: {{ index === count - 1 ? 0 : gutter + 'px' }}">
  18. <view
  19. a:if="{{ allowHalf && (displayValue !== null ? displayValue : mixin.value) === index + 0.5 }}"
  20. class="ant-rate-star-icon-active {{ characterClassName || '' }} {{ characterActiveClassName || '' }} ant-rate-star-icon-half-active">
  21. <slot
  22. name="character"
  23. index="{{ index }}"
  24. isActive="{{ true }}">
  25. <ant-icon type="StarFill" />
  26. </slot>
  27. </view>
  28. <view
  29. class="ant-rate-star-icon {{ (displayValue !== null ? displayValue : mixin.value) >= index + 1 ? 'ant-rate-star-icon-active' + ' ' + (characterClassName || '') + ' ' + (characterActiveClassName || '') : characterClassName }}">
  30. <slot
  31. name="character"
  32. index="{{ index }}">
  33. <ant-icon type="StarFill" />
  34. </slot>
  35. </view>
  36. </view>
  37. </block>
  38. </view>
  39. </view>