stepbar.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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="ite.show">
  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. },
  31. components:{
  32. },
  33. data(){
  34. return{
  35. fillin:require("@/work/static/order/fillin.png"),//填写
  36. fillf:require("@/work/static/order/fillf.png"), //完成
  37. filln:require("@/work/static/order/filln.png"),//未填
  38. }
  39. },
  40. onLoad: function() {
  41. },
  42. methods:{
  43. getDetail(e){
  44. this.$emit('getDetail')
  45. }
  46. },
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .sfixed{position: fixed;left: 0;right: 0;top: 0;z-index: 10;}
  51. .stepbar{background: #ffffff;display: flex;align-items: center;padding: 30rpx 0rpx;flex: 0 0 auto;
  52. .steps{display: flex;flex-direction: column;flex: 1;align-items: center;position: relative;
  53. .img{width: 46rpx;height: 46rpx;margin-bottom: 14rpx;}
  54. .tit{font-size: 24rpx;font-weight: bold;color: #CDCDCD;
  55. }
  56. .line{position: absolute;width: 60%;border-bottom: 2rpx dashed #CDCDCD;top: 22rpx;right: 0;transform: translateX(50%);}
  57. &:last-of-type{.line{display: none;}}
  58. &.act{
  59. .line{border-color: #9AB4F6;}
  60. .tit{color: #4775EA;}
  61. }
  62. }
  63. }
  64. </style>