en-popup.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view >
  3. <uni-popup ref="popup" @change="setTabBar" type="bottom" :mask-background-color="maskBackgroundColor">
  4. <view class="popup-box" v-show="showTop">
  5. <view class="popup-title" @click="close">
  6. <view class="popup-close">
  7. <image class="popup-close-img" src="/static/img/common/close.png" mode="widthFix" ></image>
  8. </view>
  9. </view>
  10. <slot name="popupInfo"></slot>
  11. </view>
  12. </uni-popup>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: "en-popup",
  18. components: {},
  19. props: {
  20. showTop:{
  21. type:Boolean,
  22. default:true
  23. },
  24. maskBackgroundColor:{
  25. default: 'rgba(0,0,0,0.4)'
  26. }
  27. },
  28. data() {
  29. return {}
  30. },
  31. watch: {},
  32. mounted() {
  33. },
  34. methods: {
  35. open(){
  36. this.$refs.popup.open('bottom')
  37. },
  38. setTabBar(e){
  39. if(e.show){
  40. uni.hideTabBar()
  41. }else {
  42. uni.showTabBar()
  43. }
  44. },
  45. close(){
  46. this.$refs.popup.close()
  47. }
  48. }
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .popup-box{
  53. background: #FFFFFF;
  54. border-radius: 30rpx 30rpx 0 0;
  55. box-shadow: 0px -8px 20px 0px rgba(0,0,0,0.04);
  56. padding: 42rpx 32rpx calc(16rxp + env(safe-area-inset-bottom));
  57. z-index: 999999;
  58. .popup-title{
  59. padding: 20rpx 0;
  60. width: 100%;
  61. .popup-close{
  62. width: 72rpx;
  63. margin: auto;
  64. border-radius: 30rpx;
  65. .popup-close-img{
  66. width: 72rpx;
  67. }
  68. }
  69. }
  70. }
  71. </style>