<template>
  <div class="page">
    <div class="page-top flex flex-col justify-center items-center">
      <!-- <img class="logo" :src="supplierInfo.logo" /> -->
      <div class="name mt-2" v-text="supplierInfo.shopName + '意见反馈'"></div>
    </div>
    <div class="page-content p-4 md:my-4">
      <textarea
        class="control p-2"
        placeholder="请在此处输入您的宝贵意见（限200字）"
        v-model="content"
      ></textarea>
      <div class="submit mt-6" @click="onSubmit">提交</div>
    </div>

    <van-dialog v-model="showModal" class="dialog" @confirm="onConfirm">
      <div class="dialog-content">
        <div class="image-icon"></div>
        <div class="title">提交成功</div>
        <div class="tip">您的反馈信息已提交，感谢您的宝贵意见。</div>
        <div class="line" />
      </div>
    </van-dialog>
  </div>
</template>

<script>
import feedbackMixin from '@/mixins/feedback'
export default {
  layout: 'app-ph',
  mixins: [feedbackMixin],
}
</script>

<style scoped lang="scss">
// pc 端
@media screen and (min-width: 768px) {
  .page {
    @include useTheme() {
      .page-top {
        height: 360px;
        background: fetch('pc-banner-feedback');
        background-size: auto 360px;
        .logo {
          display: block;
          width: 120px;
          height: 120px;
          border-radius: 50%;
          background: #fff;
        }
        .name {
          font-size: 30px;
          color: #fff;
        }
      }
      .page-content {
        width: 1200px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
        background-color: #fff;
        .control {
          display: block;
          width: 100%;
          height: 280px;
          border: 1px solid #d8d8d8;
          outline: none;
          box-sizing: border-box;
          font-size: 16px;
          color: #101010;
        }

        .submit {
          text-align: center;
          line-height: 46px;
          width: 326px;
          height: 46px;
          margin-left: auto;
          margin-right: auto;
          border-radius: 4px;
          font-size: 16px;
          background-color: fetch('color');
          color: #fff;
          transition: all 0.2s;
          cursor: pointer;

          &:hover {
            background-color: fetch('hover-color');
          }

          &.disabled {
            background-color: #d8d8d8 !important;
          }
        }
      }

      .dialog {
        width: 380px;
        padding-top: 40px;
        border-radius: 0;

        .dialog-content {
          width: 100%;
          height: 100%;

          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;

          .title {
            font-size: 24px;
            color: #101010;
            margin: 28px 0 12px;
          }

          .tip {
            color: #404040;
            font-size: 16px;
          }

          .line {
            width: 340px;
            height: 1px;
            margin: 0 auto;
            margin-top: 28px;
            background: #d8d8d8;
          }

          .image-icon {
            width: 140px;
            height: 100px;
            background: fetch('pc-icon-feedback-submit') no-repeat center;
            background-size: 140px 100px;
          }
        }
      }
    }
  }
}

// 移动 端
@media screen and (max-width: 768px) {
  .page {
    @include useTheme() {
      .page-top {
        height: 46vw;
        background: fetch('h5-banner-feedback');
        background-size: auto 46vw;
        .logo {
          display: block;
          width: 14.8vw;
          height: 14.8vw;
          border-radius: 50%;
          background: #fff;
        }
        .name {
          font-size: 4vw;
          color: #fff;
        }
      }
      .page-content {
        .control {
          display: block;
          width: 100%;
          height: 56vw;
          border: 0.1vw solid #d8d8d8;
          outline: none;
          box-sizing: border-box;
          font-size: 3.2vw;
          color: #101010;
        }

        .submit {
          text-align: center;
          line-height: 11.6vw;
          width: 100%;
          height: 11.6vw;
          border-radius: 0.2vw;
          font-size: 4vw;
          background-color: fetch('color');
          color: #fff;

          &.disabled {
            background-color: #d8d8d8;
          }
        }
      }

      .dialog {
        width: 76vw;
        border-radius: 0;

        .dialog-content {
          padding-top: 3.2vw;
          width: 100%;
          height: 100%;

          display: flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;

          .title {
            font-size: 4.6vw;
            color: #101010;
            margin: 3.2vw 0;
          }

          .tip {
            color: #404040;
            font-size: 3.2vw;
          }

          .image-icon {
            width: 30vw;
            height: 20vw;
            background: fetch('pc-icon-feedback-submit') no-repeat center;
            background-size: 30vw 20vw;
          }
        }
      }
    }
  }
}
</style>
