<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2020-04-14 09:50:16
 * @LastEditors: 无尘
 * @LastEditTime: 2020-05-19 11:03:33
 -->
<!--
  <expired-dialog ></expired-dialog>
  import expiredDialog from '@/components/app/expired-dialog.vue';
 -->
<template>
  <el-dialog class="hide-close-dialog" style="top:130px;" :title="forbidFlag == 'forbid' ? '禁用提醒' : '到期提醒'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
    <div class="m-b-20 text-center">
      <div class="img-tip-wrap text-center">
        <img v-if="forbidFlag != 'forbid'" src="../../assets/expired.png" alt="" />
        <img v-else src="../../assets/forbid.png" alt="" />
      </div>
      <div v-if="forbidFlag != 'forbid'" class="font-18 color-303133 m-t-17 text-center">使用已到期</div>
      <div v-if="forbidFlag != 'forbid'" class="font-14 color-909399 m-t-10 line-h-20 text-center"><span class="font-14 color-909399">服务已到使用期限，请升级 </span><span class="color-1890ff cursor-pointer" @click="toDamo">达摩服务</span></div>
      <div v-if="forbidFlag == 'forbid'" class="font-14 color-909399 m-t-10 line-h-20 text-center"><span class="font-14 color-909399">已使用好办 3.0 ，禁止操作</span></div>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    syncData: {
      type: Object,
      default() {
        return {
          syncStatus: '0'
        };
      }
    },
    forbidFlag: {
      type: String,
      default: 'forbid'
    }
  },
  data() {
    return {
      dialogVisible: true
    };
  },
  methods: {
    handleClose(done) {
      const that = this;
      that.dialogVisible = true;
    },
    toDamo() {
      window.open('https://www.demogic.com/');
    }
  },
  mounted() {
    const that = this;
    that.$nextTick(() => {
      document.querySelector('.v-modal').style.top = '130px';
    });
  },
  beforeDestroy() {
    document.querySelector('.v-modal').style.top = '0px';
  }
};
</script>
<style lang="less" scoped>
.m-b-20 {
  margin-bottom: 20px;
}
.m-t-17 {
  margin-top: 17px;
}
.m-t-10 {
  margin-top: 10px;
}
.line-h-20 {
  line-height: 20px;
}
.font-18 {
  font-size: 18px;
}
.img-tip-wrap {
  img {
    width: 112px;
  }
}
</style>
