ASEMiniProgram/dist/rate/index.wxml

24 lines
714 B
Plaintext
Raw Normal View History

2021-03-20 17:48:56 +00:00
<view class="i-class i-rate"
bindtouchmove="handleTouchMove">
<input type="text" :name="name" wx:value="{{value}}" class="i-rate-hide-input" />
<view
wx:for="{{count}}"
wx:key="{{item}}"
class="i-rate-star {{ parse.getCurrent( value,index ) }}"
data-index="{{index}}"
bindtap="handleClick">
<i-icon type="collection_fill" size="{{size}}"></i-icon>
</view>
<view class="i-rate-text" wx:if="{{ value !== 0 }}"><slot></slot></view>
</view>
<wxs module="parse">
var prefixCls = 'i-rate';
module.exports = {
getCurrent : function( value,index ){
if( index < value ){
return prefixCls + '-current'
}
}
}
</wxs>