<template>
  <a-modal
    centered
    class="promotionDesc-modal"
    :footer="null"
    :maskClosable="false"
    :title="modalTit"
    v-model="isShow"
    @cancel="isShow=false"
    :width="500">
    <div class="promotionDesc-con">
      {{ con }}
    </div>
    <div class="btn-cont">
      <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
    </div>
  </a-modal>
</template>

<script>
import { commonMixin } from '@/utils/mixin'
export default {
  name: 'PromotionDescModal',
  mixins: [commonMixin],
  props: {
    openModal: { //  弹框显示状态
      type: Boolean,
      default: false
    },
    con: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      modalTit: '促销描述',
      isShow: this.openModal //  是否打开弹框
    }
  },
  methods: {

  },
  watch: {
    //  父页面传过来的弹框状态
    openModal (newValue, oldValue) {
      this.isShow = newValue
    },
    //  重定义的弹框状态
    isShow (newValue, oldValue) {
      if (!newValue) {
        this.$emit('close')
      }
    }
  }
}
</script>

<style lang="less">
  .promotionDesc-modal{
    .promotionDesc-con{
       text-align: center;
    }
    .btn-cont {
      text-align: center;
      margin: 50px 0 0px;
    }
  }
</style>
