oak-general-business/lib/miniprogram_npm/tdesign/rate/rate.wxml

24 lines
929 B
Plaintext

<wxs src="./rate.wxs" module="utils" />
<view class="{{ classPrefix }}">
<view
class="{{ classPrefix }}__wrapper t-class"
style="font-size:{{ size }}rpx;"
catch:touchmove="{{ !disabled ? 'onTouch' : '' }}"
catch:touchstart="{{ !disabled ? 'onTouch' : '' }}"
>
<t-icon
wx:for="{{ count }}"
wx:key="*this"
t-class="{{ classPrefix }}__star t-class-icon"
name="{{utils.getIconName(defaultValue, value, index, allowHalf, icon, halfIcon, variant)}}"
color="{{utils.getIconColor(defaultValue, value, index, allowHalf, disabled, color, disabledColor)}}"
size="{{ size }}"
style="margin-right:{{ count - index > 1 ? gap : 0 }}rpx;"
custom-style="{{utils.getBackgroundColor(disabled, color, disabledColor)}}"
/>
</view>
<text wx:if="{{showText}}" class="{{ classPrefix }}__desc t-class-desc"
>{{utils.getText(texts,value,defaultTexts)}}</text
>
</view>