<template>
  <div id="create-success">
    <div v-show="step === 2" class="box one">
      <van-cell-group class="input-cell">
        <van-field v-model="newTemplateName" placeholder="请输入新的模板名称！" />
      </van-cell-group>
    </div>
    <div v-show="step === 1" class="box two">
      <div class="success-icon">
        <img class="fg" src="../../../public/img/success.png" alt="success-fg">
        <p>创建活动成功！</p>
      </div>
    </div>
    <div class="box three">
      <div class="btn-group">
        <van-button v-if="step === 2" type="info">取消</van-button>
        <van-button v-if="step === 1" type="info" @click="saveNewTemplate">保存为新的模板</van-button>
        <van-button type="info">完成</van-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "createSuccess",
  components: {},
  data() {
    return {
      newTemplateName: '',
      step: 1
    };
  },
  methods: {
    saveNewTemplate() {
      this.step = 2;
    }
  }
};
</script>

<style lang="scss">
#create-success {
  display: flex;
  flex-direction: column;
  height: 100%;
  .box {
    margin-bottom: 20px;
  }
  
  .one { 
    flex: 1;
    .input-cell {
      width: 90%;
      margin: 20px auto;
      border: 1px solid #d4cfcf;
    }
  }

  .two {
    flex: 3;
    .success-icon {
      margin-top: 100px;
      text-align: center;
      img {
        margin: 0 auto;
      }
      p {
        font-size: 14px;
      }
    }
  }

  .three { 
    display: flex;
    justify-content: center;
    padding: 0 20px;
    .btn-group {

      .van-button {
        width: 150px;
        &:first-child{
          margin-right: 10px;
        }
      }
    }
  }
}
</style>
