<template>
  <div class="safe-set">
    <div class="status-info">
      <div class="icon-box g-flex-center">
        <i class="iconfont" :class="Infos.icon"></i>
      </div>
      <h2>{{ Infos.title }}</h2>
      <p>{{ Infos.msg }}</p>
      <div
        class="set-status g-flex-center"
        :class="{ alSet: Infos.status === true }"
      >
        {{ status }}
      </div>
    </div>
    <div class="btn-box">
      <div
        v-if="!(Infos.status === true && Infos.afterText === null)"
        class="set-btn g-flex-center"
        @click="$emit('to', Infos.destination)"
      >
        {{ Infos.status === false ? Infos.btntext : Infos.afterText }}
      </div>
      <!-- <syButton
        size="large"
        mode="elementBtn"
        type="default"
        @click="$emit('to', Infos.destination)"
        v-if="!(Infos.status === true && Infos.afterText === null)"
        >{{
          Infos.status === false ? Infos.btntext : Infos.afterText
        }}</syButton
      > -->
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { syButton } from "cqk-sy-ui";
export default defineComponent({
  props: ["Infos"],
  components: {
    syButton,
  },
  computed: {
    status(): any {
      switch (this.Infos.title) {
        case "实名认证":
          return this.Infos.status === false ? "未实名" : "已实名";
        case "登录密码":
          return this.Infos.status === false ? "未设置" : "已设置";
        case "绑定手机":
          return this.Infos.status === false ? "未绑定" : "已绑定";
        default:
          break;
      }
    },
  },
});
</script>
<style scoped>
* {
  margin: 0;
}
.g-flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.safe-set {
  display: inline-block;
  width: 32.5%;
  /* box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.07); */
}
.status-info {
  box-sizing: content-box;
  position: relative;
  height: 143px;
  padding: 45px 0 0 39px;
  background: #fff;
  border-radius: 4px;
}
.btn-box {
  box-sizing: content-box;
  margin-top: 1px;
  padding: 23px 0 0 46px;
  height: 55px;
  background: #fff;
  border-radius: 4px;
}
.set-btn {
  font-size: 14px;
  width: 117px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--sy-blue);
  color: var(--sy-blue);
  cursor: pointer;
  transition: 0.3s;
}
.set-btn:hover {
  transform: scale(1.1);
}
.icon-box {
  margin-right: 16px;
  float: left;
  width: 76px;
  height: 77px;
  border-radius: 50px;
  background: #f2f4f6ff;
}
.icon-box i {
  font-size: 35px;
  color: #696cffff;
}
h2 {
  display: inline-block;
  font-size: 20px;
  font-family: PingFangSC-Semibold;
  font-weight: 600;
  color: rgba(37, 38, 49, 1);
  line-height: 28px;
}
p {
  margin-top: 18px;
  font-size: 14px;
  font-family: PingFangSC-Regular;
  font-weight: 400;
  color: #b0b0b0;
  line-height: 21px;
}
.set-status {
  font-size: 14px;
  position: absolute;
  right: 38px;
  top: 45px;
  width: 104px;
  height: 32px;
  background: rgba(244, 252, 239, 1);
  border-radius: 4px;
  font-weight: 400;
  color: rgba(113, 211, 54, 1);
}
.alSet {
  background: #f9f3e8ff;
  color: #ffab2bff;
}
</style>
