app-share-mask.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="app-share-mask">
  3. <div class="share-mask" v-if="show" :class="[show ? 'share-mask-show' : '']">
  4. <div class="share-content">
  5. <div class="share-img">
  6. <img :src="`${constant.imgUrl}/retail/interest/shou.png`" alt mode="widthFix" />
  7. </div>
  8. <div class="share-text">
  9. <div>点此右上角</div>
  10. <div>{{ text }}</div>
  11. </div>
  12. </div>
  13. <div class="share-btn">
  14. <button class="button-com default" @tap.stop="handleClick">知道了</button>
  15. </div>
  16. </div>
  17. <div class="tui-alert-mask" :class="[show ? 'tui-alert-mask-show' : '']"></div>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'app-share-mask',
  23. props: {
  24. show: {
  25. type: Boolean,
  26. default: false
  27. },
  28. text: {
  29. type: String,
  30. default: '分享即可邀请'
  31. }
  32. },
  33. data() {
  34. return {
  35. constant: this.$constant
  36. }
  37. },
  38. methods: {
  39. handleClick() {
  40. if (!this.show) return
  41. this.$emit('click')
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .app-share-mask {
  48. .share-mask {
  49. position: fixed;
  50. top: 0;
  51. left: 0;
  52. right: 0;
  53. z-index: 998;
  54. opacity: 0;
  55. color: #fff;
  56. .share-content {
  57. width: 100%;
  58. text-align: right;
  59. .share-img {
  60. width: 90px;
  61. margin: 26px 128px 36px auto;
  62. }
  63. .share-text {
  64. width: 210px;
  65. font-size: 34px;
  66. text-align: center;
  67. margin: 0 80px 36px auto;
  68. }
  69. }
  70. .share-btn {
  71. @include disFlex(center, center);
  72. margin-top: 200px;
  73. .button-com {
  74. width: 340px;
  75. padding-top: 32px;
  76. padding-bottom: 32px;
  77. margin: 0 auto;
  78. font-size: 32px;
  79. }
  80. }
  81. }
  82. .share-mask-show {
  83. // transform: translate(-50%, -50%) scale(1);
  84. opacity: 1;
  85. }
  86. .tui-alert-mask {
  87. position: fixed;
  88. top: 0;
  89. left: 0;
  90. right: 0;
  91. bottom: 0;
  92. background: rgba(0, 0, 0, 0.5);
  93. z-index: 996;
  94. transition: all 0.3s ease-in-out;
  95. opacity: 0;
  96. visibility: hidden;
  97. }
  98. .tui-alert-mask-show {
  99. visibility: visible;
  100. opacity: 1;
  101. }
  102. }
  103. </style>