index.wxml 710 B

1234567891011121314151617181920212223
  1. <view class="i-class i-rate"
  2. bindtouchmove="handleTouchMove">
  3. <input type="text" :name="name" wx:value="{{value}}" class="i-rate-hide-input" />
  4. <view
  5. wx:for="{{count}}"
  6. wx:key="item"
  7. class="i-rate-star {{ parse.getCurrent( value,index ) }}"
  8. data-index="{{index}}"
  9. bindtap="handleClick">
  10. <i-icon type="collection_fill" size="{{size}}"></i-icon>
  11. </view>
  12. <view class="i-rate-text" wx:if="{{ value !== 0 }}"><slot></slot></view>
  13. </view>
  14. <wxs module="parse">
  15. var prefixCls = 'i-rate';
  16. module.exports = {
  17. getCurrent : function( value,index ){
  18. if( index < value ){
  19. return prefixCls + '-current'
  20. }
  21. }
  22. }
  23. </wxs>