<template>
    <div class="panel-container">
      <el-button class="panel-button" @click="showPanel = !showPanel" type="primary" circle>
        <i :class="showPanel ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
      </el-button>
      <el-card class="panel" :class="{ 'panel-open': showPanel }">
        <div slot="header" class="header-title">
        <p>Get in touch with a TrustyPay expert</p>
        <p>We're eager to help you succeed with our range of solutions.</p>
        
      </div>
        <el-form :model="form" :rules="rules" label-width="120px" label-position="top">
          <el-form-item label="Name" prop="name">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
          <el-form-item label="Business Name"  prop="businessName">
            <el-input v-model="form.businessName"></el-input>
          </el-form-item>
          <el-form-item label="Mobile" prop="mobile">
            <el-input v-model="form.mobile"></el-input>
          </el-form-item>
          <el-form-item label="Email" prop="email">
            <el-input v-model="form.email"></el-input>
          </el-form-item>
          <el-form-item label="Language Preference">
            <el-select v-model="form.language" placeholder="Select Language">
              <el-option label="Chinese" value="zh"></el-option>
              <el-option label="English" value="en"></el-option>
              <el-option label="Ελληνικά" value="Ελληνικά"></el-option>
              <el-option label="हिंदी" value="हिंदी"></el-option>
              <el-option label="한국" value="한국"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="Your message" prop="message">
            <el-input type="textarea" v-model="form.message"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="submitForm" class="sbuBtn">Submit</el-button>
          </el-form-item>
        </el-form>
      </el-card>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        showPanel: true,
        form: {
          name: '',
          businessName: '',
          mobile: '',
          email: '',
          language: '',
          message: ''
        },
        rules: {
        name: [{ required: true, message: 'Please enter your name', trigger: 'blur' }],
        businessName: [{ required: true, message: 'Please enter your business name', trigger: 'blur' }],
        mobile: [{ required: true, message: 'Please enter your mobile number', trigger: 'blur' }],
        email: [{ required: true, message: 'Please enter your email', trigger: 'blur' },
          { type: 'email', message: 'Please enter a valid email address', trigger: 'blur' } ],
        message:[{ required: true, message: 'Please enter'}],
      },
      }
    },
    methods: {
      submitForm() {
        // 提交表单的逻辑
        console.log(this.form)
      }
    }
  }
  </script>
  
  <style  scoped>

  .panel-container {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 1000;
  }
  
  .panel-button {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 999;
  }
  
  .panel {
    width: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .panel-open {
    
    max-height: 660px;
  }
  .header-title{
    p{
      margin: 0;
      font-size: 12px;
      text-align: center;
    }
  }
  /* 去掉显示的底部 */
  .el-card{
    border: none;
    /* padding: 0px 0px 50px 0px; */
  }
  /* 设置按钮的大小 */
  .el-button.is-circle{
    width: 70px;
    height: 70px;
    margin-bottom: -25px;
  }
  .el-form-item {
    margin-bottom: 0;
  }
  /deep/.el-form--label-top .el-form-item__label{
    padding-bottom: 0px;
  }
  .el-form-item__label{
    line-height: normal;
  }
  .el-select{
    display: initial;
  }
  .sbuBtn{
    margin: 15px 120px;
  }
  </style>