stepbar.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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==1?'act':''">
  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>
  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. },
  31. components:{
  32. },
  33. data(){
  34. return{
  35. fillin:require("@/work/static/images/busin/stepb.png"),//填写
  36. fillf:require("@/work/static/images/busin/stepa.png"), //完成
  37. filln:require("@/work/static/images/busin/stepc.png"),//未填
  38. // stepa:require('@/work/static/images/busin/stepa.png'),
  39. // stepb:require('@/work/static/images/busin/stepb.png'),
  40. // stepc:require('@/work/static/images/busin/stepc.png'),
  41. line:require('@/work/static/images/busin/line.png'),
  42. }
  43. },
  44. onLoad: function() {
  45. },
  46. methods:{
  47. getDetail(e){
  48. this.$emit('getDetail')
  49. }
  50. },
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .sfixed{position: fixed;left: 0;right: 0;top: 0;z-index: 4;}
  55. .stepbar{background: #ffffff;display: flex;align-items: center;padding: 30rpx 0rpx 26rpx;flex: 0 0 auto;
  56. .steps{display: flex;flex-direction: column;flex: 1;align-items: center;position: relative;
  57. .img{width: 32rpx;height: 32rpx;margin-bottom: 20rpx;}
  58. .tit{font-size: 24rpx;font-weight: 500;color: #666666;}
  59. .line{position: absolute;width:70rpx;top: 4rpx;height:20rpx;right:0;margin-right: -34rpx;}
  60. &:last-of-type{.line{display: none;}}
  61. &.act{
  62. .tit{color: #00A9F0;}
  63. }
  64. }
  65. }
  66. </style>