index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="bg--w111-fff rd-16rpx pt-32 pl-24 pr-24 pb-32 flex-between-center">
  3. <view v-for="(item,index) in list" :key="index" class="item">
  4. <view class="h-32 flex-x-center item relative" >
  5. <view v-if="index <= indexActive" class="iconfont fs-32 text--w111-999 icon-a-ic_CompleteSelect"></view>
  6. <view v-else class="w-32 h-32 borderRadius15 bg--w111-f5f5f5 acea-row row-center-wrapper">
  7. <view class="iconfont icon-ic_complete fs-22 text--w111-999"></view>
  8. </view>
  9. <text class="line"
  10. :style="{'width': lineWidth + 'rpx','right': lineRight}"
  11. :class="index < indexActive ? 'bg-color' : ''"
  12. ></text>
  13. </view>
  14. <view class="fs-22 text--w111-999 lh-30rpx mt-16" :class="{active:index <= indexActive}">{{item}}</view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. type: {
  22. type: Number,
  23. default: 0
  24. },
  25. applyType: {
  26. type: Number,
  27. default: 0
  28. }
  29. },
  30. data() {
  31. return {}
  32. },
  33. computed: {
  34. list() {
  35. // 步骤条全部选中
  36. if(this.type == -1){
  37. return ['提交申请', '用户已撤销', '退款完成']
  38. }else if(this.type == 3){
  39. return ['提交申请', '商家已拒绝', '退款失败']
  40. } else if(this.type == 6 && this.applyType == 4){
  41. return ['提交申请', '平台强制退款', '退款完成']
  42. }else if([0,6].includes(this.type) && this.applyType == 1){
  43. return ['提交申请', '商家审核', '退款完成']
  44. }else if([0,4,5,6].includes(this.type) && this.applyType == 2){
  45. return ['提交申请', '商家审核','商品寄回', '退款完成']
  46. }else if([0,4,5,6].includes(this.type) && this.applyType == 3){
  47. return ['提交申请', '商家审核','商家收货', '退款完成']
  48. }else {
  49. return ['提交申请', '商家审核', '退款完成']
  50. }
  51. },
  52. indexActive(){
  53. if(this.type == -1){
  54. return 2
  55. }else if(this.type == 3){
  56. return 2
  57. } else if(this.type == 6 && this.applyType == 4){
  58. return 2
  59. }else if(this.applyType == 1){
  60. if([0,1].includes(this.type)){
  61. return 0
  62. }else{
  63. return 2
  64. }
  65. }else if([2,3].includes(this.applyType)){
  66. if(this.type == 0){
  67. return 0
  68. }else if(this.type == 6){
  69. return 3
  70. }else{
  71. return 1
  72. }
  73. }
  74. },
  75. lineWidth(){
  76. if(this.list.length == 4){
  77. return 132
  78. }else{
  79. return 230
  80. }
  81. },
  82. lineRight(){
  83. return '-' + (this.lineWidth - 14) + 'rpx'
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang="scss">
  89. .line{
  90. height:4rpx;
  91. background: #f5f5f5;
  92. position: absolute;
  93. top:16rpx;
  94. }
  95. .item:last-child .line{
  96. display: none;
  97. }
  98. .icon-a-ic_CompleteSelect{
  99. color: var(--view-theme);
  100. }
  101. .active{
  102. color: #333;
  103. }
  104. </style>