custom-popup.vue 1.8 KB
<template>
  <view class="mask-wrap" v-if="isShowPopup">
    <view class="center-content">
      <slot>
        <view class="top-wrap">
          <template v-if="isShowClose">
            <image @click="closePopup" class="close-icon" src="/static/images/error.png"></image>
          </template>
          <view class="info-wrap">
            <image src="/static/images/menu.png" mode=""></image>
            <view class="right-info">
              <view class="">春风吹三月</view>
            </view>
          </view>
        </view>
      </slot>
    </view>
  </view>
</template>

<script setup>
  import { onMounted, ref } from 'vue'
  const emits = defineEmits(['closePopup'])
  const props = defineProps({
    isShowPopup: {
      type: Boolean,
      default: false
    },
    isShowClose: {
      type: Boolean,
      default: false
    }
  })

  function closePopup() {
    emits('closePopup')
  }
</script>

<style lang="scss">
  .mask-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: #00000066;
  }

  .center-content {
    @include flexColumn();
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 686rpx;
    padding: 48rpx 32rpx 24rpx 32rpx;
    box-sizing: border-box;
    background-color: #fff;
    border-radius: 32rpx;
    height: 720rpx;
    border-radius: 0 0 12rpx 12rpx;
    background: #151419ff;

    .close-icon {
      position: absolute;
      right: 60rpx;
      top: 70rpx;
      width: 40rpx;
      height: 40rpx;
    }

    .top-wrap {
      width: 612rpx;
      height: 180rpx;
      border-radius: 16rpx;
      background-color: #fcd09b;
    }

    .function-btns {
      margin-top: 22rpx;
      @include flexCj();
    }
  }
</style>