cm-active-popup.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="active-popup" v-if="visible">
  3. <view class="content">
  4. <image :src="image" @click="$emit('click')" mode="aspectFit"></image> <text class="close-btn" @click="handleClose"></text>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'cm-active-popup',
  11. props: {
  12. visible: {
  13. type: Boolean,
  14. default: false
  15. },
  16. image: {
  17. type: String,
  18. default: ''
  19. }
  20. },
  21. methods: {
  22. handleClose() {
  23. this.$emit('closed')
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .active-popup {
  30. position: fixed;
  31. bottom: 0;
  32. left: 0;
  33. z-index: 999999;
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. width: 100vw;
  38. height: 100vh;
  39. background: rgba(0, 0, 0, 0.5);
  40. .content {
  41. position: relative;
  42. image {
  43. width: 640rpx;
  44. }
  45. .close-btn {
  46. display: block;
  47. position: absolute;
  48. right: 0;
  49. top: -48rpx;
  50. width: 48rpx;
  51. height: 48rpx;
  52. background: url(../../../static/icon-close.png) no-repeat center;
  53. background-size: 48rpx 48rpx;
  54. }
  55. }
  56. }
  57. </style>