<!--components/comment-stars/index.wxml-->
<wxs src="../../pages/common.wxs" module="common"></wxs>

<view class='star-wrapper'>
  <view class='stars-content'>
    <block wx:if="{{common.numFixed(star, 1) > 4.5}}">
      <block wx:for="{{[1, 2, 3, 4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 4.0 && common.numFixed(star, 1) <= 4.5}}">
      <block wx:for="{{[1, 2, 3, 4]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_half.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 3.5 && common.numFixed(star, 1) <= 4.0}}">
      <block wx:for="{{[1, 2, 3, 4]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 3.0 && common.numFixed(star, 1) <= 3.5}}">
      <block wx:for="{{[1, 2, 3]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[4]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_half.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 2.5 && common.numFixed(star, 1) <= 3.0}}">
      <block wx:for="{{[1, 2, 3]}}" wx:for-item="value" wx:key="{{index}}">

        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 2.0 && common.numFixed(star, 1) <= 2.5}}">
      <block wx:for="{{[1, 2]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[3]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_half.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 1.5 && common.numFixed(star, 1) <= 2.0}}">
      <block wx:for="{{[1, 2]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[3, 4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 1.0 && common.numFixed(star, 1) <= 1.5}}">
      <block wx:for="{{[1]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[2]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_half.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[3, 4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 0.5 && common.numFixed(star, 1) <= 1.0}}">
      <block wx:for="{{[1]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_full.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[2, 3, 4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:elif="{{common.numFixed(star, 1) > 0 && common.numFixed(star, 1) <= 0.5}}">
      <block wx:for="{{[1]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_half.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
      <block wx:for="{{[2, 3, 4, 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
    <block wx:else>
      <block wx:for="{{[1, 2, 3, 4 , 5]}}" wx:for-item="value" wx:key="{{index}}">
        <image class="star-img {{large == true ? 'large' : ''}}" src='/images/star/icon_star_blank.png' mode='widthFix' data-v="{{value}}" catchtap='_tapStar'></image>
      </block>
    </block>
  </view>
</view>