adMask.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view v-show="show">
  3. <view class="ad-mask">
  4. <slot>
  5. <view class="adbox">
  6. <view class="adbox-close">
  7. <image src="@/static/images/ad/close_icon.png" @click="close"></image>
  8. </view>
  9. <image class="adbox-bg" v-show="imgType==0" src="@/static/images/ad/tc_kcc_bg.png" mode="aspectFill"></image>
  10. <image class="adbox-bg" v-show="imgType==1" src="@/static/images/ad/tc_kzb_bg.png" mode="aspectFill"></image>
  11. <image class="adbtn" src="@/static/images/ad/adbtn.gif"></image>
  12. <image class="pointer" src="@/static/images/ad/pointer.gif"></image>
  13. </view>
  14. </slot>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. show: {
  22. type: Boolean,
  23. default: false
  24. },
  25. imgType: {
  26. type: [String,Number],
  27. default: 0
  28. },
  29. },
  30. data() {
  31. return {
  32. }
  33. },
  34. methods: {
  35. close() {
  36. this.$emit("close");
  37. this.show=false;
  38. }
  39. }
  40. }
  41. </script>
  42. <style scoped lang="scss">
  43. @mixin u-flex($flexD, $alignI, $justifyC) {
  44. display: flex;
  45. flex-direction: $flexD;
  46. align-items: $alignI;
  47. justify-content: $justifyC;
  48. }
  49. .ad-mask {
  50. width: 100vw;
  51. height: 100vh;
  52. background-color: rgba(0,0,0,0.6);
  53. position: fixed;
  54. top: 0;
  55. left: 0;
  56. z-index: 999;
  57. @include u-flex(column, center, center);
  58. .adbox {
  59. width: 620rpx;
  60. position: relative;
  61. @include u-flex(column, center, center);
  62. &-close{
  63. width: 100%;
  64. margin-bottom: 74rpx;
  65. @include u-flex(row, center, flex-end);
  66. image {
  67. width: 64rpx;
  68. height: 64rpx;
  69. }
  70. }
  71. &-bg {
  72. width: 580rpx;
  73. height: 620rpx;
  74. }
  75. }
  76. .adbtn{
  77. width: 412rpx;
  78. height: 104rpx;
  79. position: absolute;
  80. bottom: 80rpx;
  81. left: 50%;
  82. transform: translate(-50%,0);
  83. }
  84. .pointer {
  85. width: 180rpx;
  86. height: 194rpx;
  87. position: absolute;
  88. bottom: -52rpx;
  89. right: -42rpx;
  90. }
  91. }
  92. </style>