详情小程序
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.

118 lines
2.8 KiB

5 years ago
  1. <template>
  2. <view class="content">
  3. <view v-for="(item, index) in list" :key="index"
  4. class="list"
  5. :style="index == list.length - 1 ? 'padding-bottom: 60rpx' : ''">
  6. <view class="left">
  7. <view class="up-line" :class="{'remove-line': index == 0}"
  8. :style="{'border-color': themeColor, 'background-color': themeColor}"></view>
  9. <view class="icon" :style="{
  10. 'background-color': index == list.length - 1 && !item.isFinished ? themeColor : '#fff',
  11. 'border-color': themeColor,
  12. 'color': themeColor}">
  13. <u-icon name="arrow-down" color="#fff" v-if="index == list.length - 1 && !item.isFinished"></u-icon>
  14. <u-icon name="checkmark" v-else></u-icon>
  15. </view>
  16. <view class="down-line" :class="{
  17. 'dotted-line': index == list.length - 1 && !item.isFinished,
  18. 'remove-line': index == list.length - 1 && item.isFinished
  19. }" :style="{'border-color': themeColor, 'background-color': themeColor}">
  20. </view>
  21. </view>
  22. <view class="right">
  23. <view class="desc">
  24. <text class="lf-line-2">{{ item.action }}</text>
  25. <text class="date">{{ item.created_at }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. // TODO 该组件只能显示两行的文字,如果需要更多文字,只能重构(左,定,直;圆,居;右,字,居;其,定)
  33. export default {
  34. name: 'lf-step-bar',
  35. props: {
  36. themeColor: {
  37. type: String,
  38. default: '#1833F2'
  39. },
  40. list: {
  41. type: Array,
  42. default(){
  43. return []
  44. }
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped="scoped">
  50. .content{
  51. width: 100%;
  52. height: max-content;
  53. padding: 0 16px;
  54. }
  55. .list{
  56. display: flex;
  57. align-items: center;
  58. justify-content: space-between;
  59. min-height: 46px;
  60. .left{
  61. display: flex;
  62. flex-direction: column;
  63. justify-content: center;
  64. align-content: center;
  65. align-items: center;
  66. margin-right: 6px;
  67. .up-line,.down-line{
  68. height: 20px;
  69. width: 1px;
  70. border: 1px solid #1833F2;
  71. background-color: #1833F2;
  72. position: relative;
  73. }
  74. .remove-line{
  75. border: none !important;
  76. background-color: transparent !important;
  77. }
  78. .dotted-line::after{
  79. content: '';
  80. position: absolute;
  81. left: -1px;
  82. bottom: -20px;
  83. height: 20px;
  84. width: 0px;
  85. border: 1px dashed #999999;
  86. }
  87. .icon{
  88. width: 30px;
  89. height: 30px;
  90. box-sizing: border-box;
  91. border: 2px solid #1833F2;
  92. color: #1833F2;
  93. border-radius: 50%;
  94. background-color: #fff;
  95. display: flex;
  96. justify-content: center;
  97. align-content: center;
  98. }
  99. }
  100. .right{
  101. flex: auto;
  102. .desc{
  103. position: relative;
  104. font-size: 28rpx;
  105. color: #222222;
  106. .date{
  107. position: absolute;
  108. bottom: -18px;
  109. left: 0;
  110. font-size: 24rpx;
  111. color: #999999;
  112. }
  113. }
  114. }
  115. }
  116. </style>