stepbar.vue 1.9 KB

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