自主项目,食堂系统,前端uniapp
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.

129 lines
2.9 KiB

  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. export default {
  33. name: 'lf-step-bar',
  34. props: {
  35. themeColor: {
  36. type: String,
  37. default: '#1833F2'
  38. },
  39. list: {
  40. type: Array,
  41. default(){
  42. return [{
  43. desc: '订单创建',
  44. date: '2021-07-23 13:23:52',
  45. isFinished: false
  46. },{
  47. desc: '订单发货',
  48. date: '2021-07-23 13:23:52',
  49. isFinished: false
  50. },{
  51. desc: '订单发货',
  52. date: '2021-07-23 13:23:52',
  53. isFinished: false
  54. }]
  55. }
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped="scoped">
  61. .content{
  62. width: 100%;
  63. height: max-content;
  64. padding: 0 32rpx;
  65. }
  66. .list{
  67. display: flex;
  68. align-items: center;
  69. justify-content: space-between;
  70. min-height: 110rpx;
  71. .left{
  72. display: flex;
  73. flex-direction: column;
  74. justify-content: center;
  75. align-content: center;
  76. align-items: center;
  77. margin-right: 15rpx;
  78. .up-line,.down-line{
  79. height: 40rpx;
  80. width: 2rpx;
  81. border: 1rpx solid #1833F2;
  82. background-color: #1833F2;
  83. position: relative;
  84. }
  85. .remove-line{
  86. border: none !important;
  87. background-color: transparent !important;
  88. }
  89. .dotted-line::after{
  90. content: '';
  91. position: absolute;
  92. left: -1rpx;
  93. bottom: -40rpx;
  94. height: 40rpx;
  95. width: 0rpx;
  96. border: 1rpx dashed #999999;
  97. }
  98. .icon{
  99. width: 60rpx;
  100. height: 60rpx;
  101. box-sizing: border-box;
  102. border: 2rpx solid #1833F2;
  103. color: #1833F2;
  104. border-radius: 50%;
  105. background-color: #fff;
  106. display: flex;
  107. justify-content: center;
  108. align-content: center;
  109. }
  110. }
  111. .right{
  112. flex: auto;
  113. .desc{
  114. position: relative;
  115. font-size: 28rpx;
  116. color: #222222;
  117. .date{
  118. position: absolute;
  119. bottom: -36rpx;
  120. left: 0;
  121. font-size: 24rpx;
  122. color: #999999;
  123. }
  124. }
  125. }
  126. }
  127. </style>