index.wxml 1.3 KB

1234567891011121314151617
  1. <view class="wux-class {{ classes.wrap }}" bindtouchmove="onTouchMove">
  2. <block wx:for="{{ stars }}" wx:key="index">
  3. <view class="{{ classes.star }}" bindtap="onTap" data-index="{{ index }}">
  4. <view class="{{ classes.box }} {{ inputValue > index ? prefixCls + '__box--active' : '' }}" style="color: {{ colors && colors[index] ? colors[index]: '#ccc' }}; margin-right: {{ margin + 'px' }}; font-size: {{ fontSize + 'px' }}; width: {{ fontSize + 'px' }}; height: {{ fontSize + 'px' }}; line-height: {{ fontSize + 'px' }}">
  5. <view class="{{ classes.inner }}">
  6. <wux-icon wx:if="{{ icon }}" wux-class="{{ classes.icon }}" type="{{ icon }}" size="{{ fontSize }}" color="{{ colors && colors[index] ? colors[index]: '#ccc' }}" />
  7. <block wx:else>{{ star }}</block>
  8. <view class="{{ classes.outer }}" style="color: {{ activeColor }}; width: {{ cutPercent + '%' }}" wx:if="{{ cutPercent > 0 && cutIndex === index }}">
  9. <wux-icon wx:if="{{ icon }}" wux-class="{{ classes.icon }}" type="{{ icon }}" size="{{ fontSize }}" color="{{ activeColor }}" />
  10. <block wx:else>{{ star }}</block>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </block>
  16. </view>