Popup.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="container flex-center">
  3. <view class="popup flex-center">
  4. <image :src="`${assetsUrl}popup-close.png`" mode="aspectFill" class="close" @click="close"></image>
  5. <image :src="`${assetsUrl}popup-auth.png`" mode="aspectFit" class="popop-img"></image>
  6. <view class="content font28 fw400" v-if="content1">
  7. {{content1}}
  8. </view>
  9. <view class="content font28 fw400" v-if="content2">
  10. {{content2}}
  11. </view>
  12. <view class="tip" v-if="tip1">
  13. {{tip1}}
  14. </view>
  15. <view class="tip" v-if="tip2">
  16. {{tip2}}
  17. </view>
  18. <view class="btn font28 fw600" @click="emitEvent">
  19. {{btntext}}
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. name:"Popup",
  27. props:{
  28. content1:{
  29. type:String,
  30. default:''
  31. },
  32. content2:{
  33. type:String,
  34. default:''
  35. },
  36. tip1:{
  37. type:String,
  38. default:''
  39. },
  40. tip2:{
  41. type:String,
  42. default:''
  43. },
  44. btntext:{
  45. type:String,
  46. default:''
  47. },
  48. btnEvent:{
  49. type:String,
  50. default:''
  51. }
  52. },
  53. data() {
  54. return {
  55. assetsUrl: this.$util.assetsUrl,
  56. };
  57. },
  58. methods:{
  59. close(){
  60. this.$emit('closePopup');
  61. },
  62. emitEvent(){
  63. this.$emit(this.btnEvent);
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .container{
  70. flex-direction: column;
  71. .popup{
  72. width: 590rpx;
  73. height: 668rpx;
  74. background-color: #171325;
  75. position: relative;
  76. flex-direction: column;
  77. border-radius: 40rpx;
  78. .close{
  79. position: absolute;
  80. right: 20rpx;
  81. top: 20rpx;
  82. width: 32rpx;
  83. height: 32rpx;
  84. }
  85. .popop-img{
  86. width: 436rpx;
  87. height: 312rpx;
  88. }
  89. .content{
  90. margin-bottom: 16rpx;
  91. color: #ffffff;
  92. }
  93. .btn{
  94. width: 470rpx;
  95. height: 84rpx;
  96. background: #6C52F4;
  97. border-radius: 42rpx;
  98. line-height: 84rpx;
  99. text-align: center;
  100. color: #ffffff;
  101. margin-top: 68rpx;
  102. }
  103. }
  104. }
  105. </style>