createChannelIndex.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <a-card :bordered="false">
  3. <a-steps class="steps" :current="currentTab">
  4. <a-step title="基础信息" />
  5. <a-step title="渠道号" />
  6. </a-steps>
  7. <div class="content">
  8. <step1 v-if="currentTab === 0" @nextStep="nextStep" ref="step" />
  9. <step2 v-if="currentTab === 1" />
  10. <step3 v-if="currentTab === 2" />
  11. </div>
  12. </a-card>
  13. </template>
  14. <script>
  15. import Step1 from './components/checkCreat'
  16. import Step2 from '../createChannel'
  17. import Step3 from './components/uploadChannel'
  18. export default {
  19. name: 'StepForm',
  20. components: {
  21. Step1,
  22. Step2,
  23. Step3
  24. },
  25. data() {
  26. return {
  27. currentTab: 0,
  28. // form
  29. form: null,
  30. campaignId: null,
  31. formComponent: null
  32. }
  33. },
  34. methods: {
  35. // handler
  36. nextStep() {
  37. // if (this.currentTab < 2) {
  38. // this.currentTab += 1
  39. // }
  40. if (JSON.parse(localStorage.getItem('channelInfo')).createType == '1') {
  41. this.currentTab = 1
  42. } else {
  43. this.currentTab = 2
  44. }
  45. },
  46. prevStep() {
  47. if (this.currentTab > 0) {
  48. this.currentTab -= 1
  49. }
  50. },
  51. finish() {
  52. this.currentTab = 0
  53. },
  54. remove(key) {
  55. this.$emit('removeTab', key)
  56. }
  57. },
  58. watch: {},
  59. mounted() {
  60. if (localStorage.getItem('channelInfo')) {
  61. if (JSON.parse(localStorage.getItem('channelInfo')).createType == '1') {
  62. this.currentTab = 1
  63. } else {
  64. this.currentTab = 2
  65. }
  66. } else {
  67. this.currentTab = 0
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .steps {
  74. max-width: 750px;
  75. margin: 16px auto;
  76. }
  77. </style>