Popup.vue 1.34 KB
<template>
  <van-popup :value="value" @input="val=>this.$emit('input',val)" position="right" :style="{ height: '100%',width: '85%' }">
    <div class="filter_container">
      <div :style="{paddingTop: GStatusBarHeight+'px',height: '85vh',overflowY:'scroll'}">
        <slot />
      </div>
      <div class="button">
        <div class="btn reset" @click="handleReset">重置</div>
        <div class="btn sure" @click="handleSure">确定</div>
      </div>
    </div>
  </van-popup>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
  name: 'Popup',
  props: {
    value: Boolean,
  },
  computed: {
    ...mapGetters('common', ['GStatusBarHeight']),
  },
  methods: {
    handleReset() {
      this.$emit('reset')
    },
    handleSure() {
      this.$emit('sure')
    }
  }
}
</script>
<style lang="less" scoped>
.filter_container {
  display: flex;
  flex-direction: column;
  padding: 50px 15px;
  height: 100%;
}
.button {
  display: flex;
  align-items: flex-end;
  flex: 1;
  justify-content: space-between;
  .btn {
    width: 43%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
    font-size: 15px;
    border-radius: 5px;
  }
  .reset {
    background-color: #f6f6f6;
    color: #666;
  }
  .sure {
    background-image: linear-gradient(to right, #25a3df, #106abc);
    color: #fff;
  }
}
</style>