stepbar.vue 1.8 KB

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