adDialog.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="cu-modal" :class="{ show: visible }">
  3. <view class="mask" @click="close"></view>
  4. <view class="wrapper cu-dialog" >
  5. <image class="adImg" :src="adInfo.cover" mode="widthFix" @click="gotoRoute(adInfo)"/>
  6. </view>
  7. <view class="closeBtn" @click="visible = false">
  8. <view class="cuIcon-close"></view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import { throttle } from '@/utils/utils.js'
  14. import ossurl from '@/utils/ossurl'
  15. import { objectToString } from '@vue/shared'
  16. export default {
  17. props:{
  18. adInfo:Object
  19. },
  20. data() {
  21. return {
  22. visible: true,
  23. ossurl
  24. }
  25. },
  26. computed: {
  27. },
  28. mounted(){
  29. },
  30. methods: {
  31. gotoRoute(item) {
  32. this.visible = false
  33. this.$common.showNext(item)
  34. },
  35. show() {
  36. this.visible = true
  37. },
  38. close() {
  39. this.visible = false
  40. this.$emit('close', false)
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .mask {
  47. position: absolute;
  48. left: 0;
  49. right: 0;
  50. top: 0;
  51. bottom: 0;
  52. }
  53. .wrapper {
  54. z-index: 1001;
  55. background-color: transparent;
  56. width: 100vw;
  57. padding-top: 120rpx;
  58. padding-bottom: 160rpx;
  59. position: relative;
  60. .adImg{
  61. width: 100vw;
  62. }
  63. }
  64. .closeBtn {
  65. background: #d8d8d8;
  66. position: fixed;
  67. bottom: 150rpx;
  68. right: calc(50% - 32rpx);
  69. width: 64rpx;
  70. height: 64rpx;
  71. border-radius: 50%;
  72. line-height: 64rpx;
  73. text-align: center;
  74. z-index: 1100;
  75. .cuIcon-close {
  76. color: #000;
  77. font-size: 32rpx;
  78. }
  79. }
  80. </style>