<template>
  <div class="contract-card-container" :class="setClass">
    <div class="contract-card-title">
      <span class="title">联系客服，立享1V1管家式服务</span>
    </div>
    <div class="contract-card-content">
      <CallPhone :show-phone-label="false" class="call-phone" @handle="handle" />
      <QrCode :wxer="wxer" :type="type" @handle="handle" />
    </div>
    <LeaveCommon class="static-footer" />
  </div>
</template>

<script>
import CallPhone from './CallPhone.vue'
import QrCode from './QrCode.vue'
import LeaveCommon from './footer.vue'

export default {
  name: 'ContractCard',
  components: {
    CallPhone,
    QrCode,
    LeaveCommon
  },
  props: {
    type: {
      type: String,
      default: '1'
    },
    wxer: {
      type: String,
      default: ''
    },
    setClass: {
      type: String,
      default: ''
    }
  },
  methods: {
    handle() {
      this.$emit('handle')
    }
  }
}
</script>

<style lang="scss" scoped>
.contract-card-container {
  background: #FFFFFF;

  .contract-card-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px 0;
    .title {
      font-size: 18px;
      line-height: 28px;
      color: #1D1D1D;
    }
    .subtitle {
      margin-top: 4px;
      font-size: 16px;
      line-height: 24px;
      color: #686868;
    }
  }
  .contract-card-content {
    display: flex;
    justify-content: center;
    margin: 8px 0 16px;
    height: 154px;
    ::v-deep {
      .qr-code-container::after {
        display: none;
      }
    }
  }
  .static-footer {
    height: 136px;
    background: linear-gradient(to bottom, rgba(237, 253, 255, 1), rgba(237, 253, 255, 0));
    ::v-deep {
      .leave-common-footer-content {
        padding: 10px 0 3px 20px;
      }
      .leave-common-footer-list {
        margin-top: 8px;
      }
      .leave-common-footer-item {
        margin-bottom: 10px;
      }
    }
  }
  &.gzzm-card {
    margin-bottom: 16px;
    .contract-card-content {
      padding: 0 20px;
      height: 100px;
      margin-bottom: 16px;
    }
    ::v-deep {

      .qr-code-title, .call-phone-title {
        font-size: 14px;
        line-height: 22px;
      }
      .qr-code-container::before {
        height: 100px;
      }
      .qr-code-container .qr-code {
        margin-top: 2px;
      }
      .qr-code-container .qr-code img {
        width: 76px;
        height: 76px;
      }
      .leave-common-footer {
        padding-top: 10px;
      }
      .leave-common-footer-content {
        padding: 0 20px;
      }
      .leave-common-footer .leave-common-footer-list  .leave-common-footer-item-title {
        margin-left: 6px;
        font-size: 12px;
        line-height: 18px;
      }
      .leave-common-title {
        width: 100%;
        text-align: left;
        line-height: 24px;
      }
      .leave-common-footer-list {
        width: auto;
      }
    }
  }
}
</style>
