<template>
  <Modal v-model="displayUseModal" @on-cancel="cancel" width="1000">
    <Steps style="padding: 40px;" :current="currentStep">
      <Step title="基本信息" content=""></Step>
      <Step title="选择零售公司" content=""></Step>
      <Step title="选择店铺" content=""></Step>
      <Step title="确认信息" content=""></Step>
    </Steps>
    <useActivityStepOne :displayUseModal="displayUseModal" v-if="currentStep==0"></useActivityStepOne>
    <useActivityStepTwo v-if="currentStep==1"></useActivityStepTwo>
    <useActivityStepThree v-if="currentStep==2"></useActivityStepThree>
    <useActivityStepFoure v-if="currentStep==3"></useActivityStepFoure>
    <div slot="footer">
      <Button v-if="currentStep!==0" type="primary" shape="circle" :loading="modal_loading" @click="back">上一步</Button>
      <Button v-if="currentStep!==3" type="primary" shape="circle" :loading="modal_loading" @click="next">下一步</Button>
      <Button v-if="currentStep==3" type="primary" shape="circle" :loading="modal_loading" @click="finish">完成</Button>
    </div>
    </Modal>
</template>
<script>
import useActivityStepOne from './useActivityStepOne'
import useActivityStepTwo from './useActivityStepTwo'
import useActivityStepThree from './useActivityStepThree'
import useActivityStepFoure from './useActivityStepFoure'
export default {
  name: "useTable",
  components: {
    useActivityStepOne,
    useActivityStepTwo,
    useActivityStepThree,
    useActivityStepFoure
	},
  data() {
		return {
      currentStep: 0,
      modal_loading: false,
      displayUseModal: false
		}
  },
  props: {
    useModal: Boolean
  },
  watch: {
    useModal(val) {
      this.displayUseModal = val
    }
  },
	mounted() {
    console.log(this.useModal)
  },
  methods: {
    cancel() {
      this.$emit("dispalyuseModal", false, false)
      this.currentStep = 0
    },
    next() {
      this.currentStep = this.currentStep + 1
    },
    back() {
      this.currentStep = this.currentStep - 1
    },
    finish() {
      this.currentStep = 0
    }
  }
}
</script>

<style  scoped>
</style>