en-popup.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view @touchmove.stop.prevent="moveHandle">
  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. <image class="popup-close" src="@/static/img/pay/gb-p.png"></image>
  7. </view>
  8. <slot name="popupInfo"></slot>
  9. </view>
  10. </uni-popup>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "en-popup",
  16. components: {},
  17. props: {
  18. showTop:{
  19. type:Boolean,
  20. default:true
  21. },
  22. maskBackgroundColor:{
  23. default: 'rgba(0,0,0,0.4)'
  24. }
  25. },
  26. data() {
  27. return {
  28. popupShow:false
  29. }
  30. },
  31. watch: {},
  32. mounted() {
  33. },
  34. methods: {
  35. moveHandle() {
  36. return false
  37. },
  38. open(){
  39. this.$refs.popup.open('bottom')
  40. },
  41. setTabBar(e){
  42. if(e.show){
  43. this.popupShow = true;
  44. uni.hideTabBar()
  45. }else {
  46. this.popupShow = false;
  47. uni.showTabBar()
  48. }
  49. },
  50. close(){
  51. this.$refs.popup.close()
  52. }
  53. }
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .popupShow {
  58. overflow: hidden;
  59. position: fixed;
  60. }
  61. .popup-box{
  62. background: #FFFFFF;
  63. border-radius: 20rpx 20rpx 0 0;
  64. box-shadow: 0px -8px 20px 0px rgba(0,0,0,0.04);
  65. padding: 28rpx 32rpx 50rpx 32rpx;
  66. z-index: 100;
  67. .popup-title{
  68. padding: 20rpx;
  69. .popup-close{
  70. margin: 0 auto;
  71. width: 82rpx;
  72. height: 10rpx;
  73. }
  74. }
  75. }
  76. </style>