You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
907 B
33 lines
907 B
<wxs src="../wxs/utils.wxs" module="utils" />
|
|
|
|
<view
|
|
class="van-rate custom-class"
|
|
bind:touchmove="onTouchMove"
|
|
>
|
|
<view
|
|
class="van-rate__item"
|
|
wx:for="{{ count }}"
|
|
wx:key="index"
|
|
style="font-size: {{ size}}px;"
|
|
>
|
|
<van-icon
|
|
name="{{ index + 1 <= innerValue ? icon : voidIcon }}"
|
|
class="van-rate__icon"
|
|
custom-class="icon-class"
|
|
data-score="{{ index }}"
|
|
color="{{ disabled ? disabledColor : index + 1 <= innerValue ? color : voidColor }}"
|
|
bind:click="onSelect"
|
|
/>
|
|
|
|
<van-icon
|
|
wx:if="{{ allowHalf }}"
|
|
name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}"
|
|
class="{{ utils.bem('rate__icon', ['half']) }}"
|
|
custom-class="icon-class"
|
|
data-score="{{ index - 0.5 }}"
|
|
color="{{ disabled ? disabledColor : index + 0.5 <= innerValue ? color : voidColor }}"
|
|
bind:click="onSelect"
|
|
/>
|
|
</view>
|
|
</view>
|