index.axml 1.8 KB

1234567891011121314151617181920212223242526272829303132
  1. <view class='steps-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from="./index.axmlstatus.sjs" name='status'>
  3. </import-sjs>
  4. <import-sjs from='../wxs/utils.sjs' name='utils'>
  5. </import-sjs>
  6. <view class="{{customClass}} {{ utils.bem('steps', [direction]) }}">
  7. <view class='van-step__wrapper'>
  8. <view a:for='{{ steps }}' a:key='{{index}}' data-index='{{ index }}' class="{{ utils.bem('step', [direction, status(index, active)]) }} van-hairline" style="{{ status(index, active) === 'inactive' ? 'color: ' + inactiveColor: '' }}" ref-numbers='{{ steps }}' onTap='antmoveAction' data-antmove-tap='onClick'>
  9. <view class='van-step__title' style="{{ index === active ? 'color: ' + activeColor : '' }}">
  10. <view>
  11. {{ item.text }}
  12. </view>
  13. <view class='{{descClass}}'>
  14. {{ item.desc }}
  15. </view>
  16. </view>
  17. <view class='van-step__circle-container'>
  18. <block a:if='{{ index !== active }}'>
  19. <van-icon a:if='{{ item.inactiveIcon || inactiveIcon }}' color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}" name='{{ item.inactiveIcon || inactiveIcon }}' custom-class='van-step__icon' ref='saveChildRef1'>
  20. </van-icon>
  21. <view a:else class='van-step__circle' style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}">
  22. </view>
  23. </block>
  24. <van-icon a:else name='{{ item.activeIcon || activeIcon }}' color='{{ activeColor }}' custom-class='van-step__icon' ref='saveChildRef2'>
  25. </van-icon>
  26. </view>
  27. <view a:if='{{ index !== steps.length - 1 }}' class='van-step__line' style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}">
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>