xzs-mysql/source/wx/xzs-student/component/iView/rate/index.wxml
2020-09-02 08:44:41 +08:00

24 lines
714 B
Plaintext

<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>