orderButtom.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view>
  3. <view class="bottomBtn" v-if="buttonFlagNum == '3' || buttonFlagNum == ''">
  4. <u-row>
  5. <u-col :span="activeNum != 1 ? 4 : 6" v-if="activeNum != 1">
  6. <u-button type="warning" class="btn" @click="lastStep">
  7. 上一步
  8. </u-button>
  9. </u-col>
  10. <u-col :span="activeNum == 1 ? 6 : 4">
  11. <u-button type="success" @click="onSubmit(1)" class="btn green-back-color" style="margin-bottom: 15rpx;" v-if="type != 'detail'">
  12. 暂存
  13. </u-button>
  14. </u-col>
  15. <u-col :span="4" v-if="activeNum == 3">
  16. <u-button type="success" class="btn btn-back-color" @click="onSubmit(2)" v-if="type != 'detail'">提交
  17. </u-button>
  18. </u-col>
  19. <u-col :span="activeNum == 1 ? 6 : 4" v-if="activeNum != 3">
  20. <u-button type="warning" @click="nextStep" class="btn btn-green-color"> 下一步 </u-button>
  21. </u-col>
  22. </u-row>
  23. </view>
  24. <view class="bottomBtn" v-else-if="buttonFlagNum == '1'">
  25. <u-row>
  26. <u-col :span="activeNum == 1 ? 12 : 6" v-if="activeNum != 1">
  27. <u-button type="warning" @click="lastStep" class="btn">
  28. 上一步
  29. </u-button>
  30. </u-col>
  31. <u-col :span="activeNum == 3 ? 6 :12" v-if="activeNum == 3">
  32. <u-button type="error" @click="onSubmit(3)">提交
  33. </u-button>
  34. </u-col>
  35. <u-col :span="activeNum == 1 ?12 : 6" v-if="activeNum != 3">
  36. <u-button type="warning" @click="nextStep" class="btn btn-green-color">下一步
  37. </u-button>
  38. </u-col>
  39. </u-row>
  40. </view>
  41. <view class="bottomBtn" v-else-if="buttonFlagNum == '0'">
  42. <u-row>
  43. <u-col :span="activeNum == 2 ? 6 : 12" v-if="activeNum != 1">
  44. <u-button type="warning" @click="lastStep" class="btn">
  45. 上一步
  46. </u-button>
  47. </u-col>
  48. <u-col :span="activeNum == 2 ? 6 : 12" v-if="activeNum != 3">
  49. <u-button type="warning" @click="nextStep" class="btn btn-green-color">下一步
  50. </u-button>
  51. </u-col>
  52. </u-row>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. props: {
  59. buttonFlagNum: {
  60. type: String,
  61. default: ''
  62. },
  63. activeNum: {
  64. type: Number,
  65. default: 1
  66. },
  67. type: {
  68. type: String,
  69. default: 'add'
  70. },
  71. },
  72. methods: {
  73. lastStep() {
  74. this.$emit('lastStep')
  75. },
  76. nextStep() {
  77. this.$emit('nextStep')
  78. },
  79. onSubmit(index) {
  80. this.$emit('onSubmit', index)
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .bottomBtn {
  87. position: fixed;
  88. left: 0;
  89. right: 0;
  90. bottom: 0;
  91. background-color: #FFFFFF;
  92. z-index: 999;
  93. padding: 15rpx 0;
  94. }
  95. </style>