stepbar.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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="txt">{{idx+1}}</view>
  9. <view class="tit">{{ite.tit}}</view>
  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. }
  46. },
  47. onLoad: function() {
  48. },
  49. methods:{
  50. getDetail(e){
  51. this.$emit('getDetail')
  52. }
  53. },
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .sfixed{position: fixed;left: 0;right: 0;top: 0;z-index: 10;}
  58. .stepbar{background: #ffffff;display: flex;align-items: center;padding: 26rpx 0rpx;flex: 0 0 auto;
  59. .steps{display: flex;flex-direction: column;flex: 1;align-items: center;position: relative;
  60. .img{width: 46rpx;height: 46rpx;margin-bottom: 14rpx;}
  61. .txt{font-weight: bold;font-size: 20rpx;color: #999999;width: 30rpx;height: 30rpx;background: #F0F1F6;border-radius: 50%;display: flex;align-items: center;justify-content: center;margin-bottom: 20rpx;}
  62. .tit{font-size: 24rpx;font-weight: bold;color: #CDCDCD;
  63. }
  64. .line{position: absolute;width: 60%;border-bottom: 2rpx dashed #CCCACA;top: 14rpx;right: 0;transform: translateX(50%);}
  65. &:last-of-type{.line{display: none;}}
  66. &.act{
  67. .txt{background: #4775EA;color: #ffffff;}
  68. .line{border-color: #4775EA;}
  69. .tit{color: #4775EA;}
  70. }
  71. }
  72. }
  73. </style>