stepbar.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="stepbar" :class="fixeda?'sfixed':''">
  3. <block v-for="(ite,idx) in steps" :key="idx">
  4. <view class="steps" :class="ite.status>0?'act':''" v-if="reservatType!=2&&ite.val==2||ite.val!=2">
  5. <image :src="filln" class="img" v-if="ite.status==0"></image>
  6. <image :src="fillin" class="img" v-if="ite.status==1"></image>
  7. <image :src="fillf" class="img" v-if="ite.status==2"></image>
  8. <view class="tit">{{ite.tit}}</view>
  9. <image :src="line" class="line"></image>
  10. <!-- <view class="line"></view> -->
  11. </view>
  12. </block>
  13. </view>
  14. </template>
  15. <script>
  16. //fixeda 固定
  17. export default {
  18. props:{
  19. steps: {
  20. type: Array,
  21. default () {
  22. return []
  23. }
  24. },
  25. fixeda:{
  26. type: Boolean,
  27. default () {
  28. return false
  29. }
  30. },
  31. reservatType:{
  32. type: [Number,String],
  33. default () {
  34. return 1
  35. }
  36. }
  37. },
  38. components:{
  39. },
  40. data(){
  41. return{
  42. fillin:require("@/static/images/order/come/fillin.png"),//填写
  43. fillf:require("@/static/images/order/come/fillf.png"), //完成
  44. filln:require("@/static/images/order/come/filln.png"),//未填
  45. line:require("@/static/images/order/come/line.png"),//完成
  46. }
  47. },
  48. onLoad: function() {
  49. },
  50. methods:{
  51. getDetail(e){
  52. this.$emit('getDetail')
  53. }
  54. },
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. // .sfixed{position: absolute;left: 0;right: 0;top: 0;z-index: 10;}
  59. .stepbar{background: transparent;display: flex;align-items: center;padding: 30rpx 0rpx;flex: 0 0 auto;
  60. .steps{display: flex;flex-direction: column;flex: 1;align-items: center;position: relative;
  61. .img{width: 30rpx;height: 30rpx;margin-bottom: 20rpx;}
  62. .tit{font-size: 24rpx;font-weight: bold;color: #ffffff;opacity: 0.7;
  63. }
  64. .line{position: absolute;width: 102rpx;height:18rpx;top: 6rpx;right: 0;transform: translateX(50%);opacity: 0.7;}
  65. &:last-of-type{.line{display: none;}}
  66. &.act{
  67. .line{opacity: 1;}
  68. .tit{opacity: 1;}
  69. }
  70. }
  71. }
  72. </style>