index.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <view class="custom-class {{ utils.bem('steps', [direction]) }}">
  3. <view class="van-step__wrapper">
  4. <view
  5. wx:for="{{ steps }}"
  6. wx:key="index"
  7. class="{{ utils.bem('step', [direction, status(index, active)]) }} van-hairline"
  8. style="{{ status(index, active) === 'inactive' ? 'color: ' + inactiveColor: '' }}"
  9. >
  10. <view class="van-step__title" style="{{ index === active ? 'color: ' + activeColor : '' }}">
  11. <view>{{ item.text }}</view>
  12. <view class="desc-class">{{ item.desc }}</view>
  13. </view>
  14. <view class="van-step__circle-container">
  15. <block wx:if="{{ index !== active }}">
  16. <van-icon
  17. wx:if="{{ inactiveIcon }}"
  18. color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}"
  19. name="{{ inactiveIcon }}"
  20. custom-class="van-step__icon"
  21. />
  22. <view
  23. wx:else
  24. class="van-step__circle"
  25. style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
  26. />
  27. </block>
  28. <van-icon wx:else name="{{ activeIcon }}" color="{{ activeColor }}" custom-class="van-step__icon" />
  29. </view>
  30. <view
  31. wx:if="{{ index !== steps.length - 1 }}"
  32. class="van-step__line" style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
  33. />
  34. </view>
  35. </view>
  36. </view>
  37. <wxs module="status">
  38. function get(index, active) {
  39. if (index < active) {
  40. return 'finish';
  41. } else if (index === active) {
  42. return 'process';
  43. }
  44. return 'inactive';
  45. }
  46. module.exports = get;
  47. </wxs>