<template>
  <div class="mask" v-if="visibile">
    <div class="comfirm-container">
      <!-- <div class="tip_img"><img src="@/assets/image/close.png" alt="" /></div> -->

      <div class="form_title">{{ msg }}</div>
      <CommonInput width="315" v-model="val">
        <template #suffix>
          <span class="suffix">g</span>
        </template>
      </CommonInput>
      <div class="btns">
        <CommonButton
          size="default"
          type="info"
          height="52"
          paddingLeft="24"
          paddingRight="24"
          msg="取消"
          @click="emit('cancel')" />
        <CommonButton
          v-if="showbtn"
          size="default"
          type="danger"
          height="52"
          paddingLeft="24"
          paddingRight="24"
          msg="确定"
          @click="emit('confirm', val)" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
const props = defineProps({
  visibile: {
    type: Boolean,
    default: false
  },
  msg: {
    type: String,
    default: ''
  },
  showbtn: {
    type: Boolean,
    default: true
  },
  msg2: {
    type: String,
    default: ''
  }
});
const val = ref('');
const emit = defineEmits(['confirm', 'cancel']);
</script>
<style lang="less" scoped>
.mask {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  .comfirm-container {
    width: 240px;
    height: 175px;
    background: #f8f8f8;
    box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
    border-radius: 8px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 16px;
    justify-content: space-between;
    text-align: center;
    .tip_img {
      margin-top: 12px;
      width: 32px;
      height: 32px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .msg {
      // margin-top: 20px;
      font-size: 12px;
      color: #3a3a3a;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .btns {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-around;
    }
  }
}
</style>
