model.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view>
  3. <view class="userModel u-flex u-row-center u-col-center">
  4. <view class="cont u-flex-col u-col-center" :style="{width: ad?'300px':'520rpx'}">
  5. <image src="../../static/icon/jinbi.png"></image>
  6. <view class="text u-text-center u-content-color u-p-l-60 u-p-r-60" v-html="title"></view>
  7. <view class="" v-if="ad">
  8. <view class="u-p-t-20" style="width: 300px;">
  9. <!-- #ifdef MP-QQ -->
  10. <ad unit-id="8aa061ea8e5bac1c717623a7be7badd8"></ad>
  11. <!-- #endif -->
  12. <!-- #ifdef MP-WEIXIN -->
  13. <ad unit-id="adunit-0d2cf81781c3cd01"></ad>
  14. <!-- #endif -->
  15. </view>
  16. <view class="btn u-text-center adClass" hover-class="hover-class" hover-stay-time="50" style="margin-left: 20%;margin-top: 30rpx;">
  17. {{btnText}}
  18. <button open-type="share" style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;"></button>
  19. </view>
  20. </view>
  21. <view class="btn u-text-center" hover-class="hover-class" hover-stay-time="50" v-else @click="save">
  22. {{btnText}}
  23. </view>
  24. <view v-if="closeText!=' '" class="no u-text-center u-p-t-30" @click="close">{{closeText}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'model',
  32. props:{
  33. title:{ //显示的内容
  34. type: String,
  35. default: '为了更好的浏览体验,快去授权登录吧'
  36. },
  37. authorize:{ //是否授权登录
  38. type: Boolean,
  39. default: true
  40. },
  41. ad:{ //广告
  42. type: Boolean,
  43. default: false
  44. },
  45. btnText:{ //按钮文字
  46. type: String,
  47. default: '授权登录'
  48. },
  49. closeText:{ //关闭文笔
  50. type: String,
  51. default: '暂时不用'
  52. }
  53. },
  54. data() {
  55. return {
  56. };
  57. },
  58. methods: {
  59. save(){
  60. this.$emit('save');
  61. },
  62. close(){
  63. this.$emit('close');
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .userModel{
  70. z-index: 9999999;
  71. position: fixed;
  72. top: 0;
  73. left: 0;
  74. width: 100vw;
  75. height: 100vh;
  76. background-color: rgba(0,0,0,0.6);
  77. // backdrop-filter: blur(4rpx);
  78. .cont{
  79. width: 520rpx;
  80. padding: 0px 0 50rpx 0;
  81. background-color: #FFFFFF;
  82. border-radius: 32rpx;
  83. image{
  84. width: 128rpx;
  85. height: 128rpx;
  86. margin-top: -60rpx;
  87. margin-bottom: 40rpx;
  88. }
  89. .text{
  90. line-height: 46rpx;
  91. }
  92. .btn{
  93. position: relative;
  94. margin-top: 50rpx;
  95. color: #FFFFFF;
  96. width: 60%;
  97. line-height: 80rpx;
  98. border-radius: 80rpx;
  99. background-image: linear-gradient(to bottom right, #fce03d , #f8c93c);
  100. }
  101. .no{
  102. color: #B8B8B8;
  103. }
  104. }
  105. }
  106. .num{
  107. font-size: 16px;
  108. font-weight: 700;
  109. color: #f8c93c;
  110. padding: 0 8rpx;
  111. }
  112. .adClass{
  113. animation: tiaobig 1.2s ease-in-out alternate infinite;
  114. // animation-iteration-count:1;
  115. }
  116. @keyframes tiaobig {
  117. 25% {
  118. transform: scale(0.98);
  119. }
  120. 50% {
  121. transform: scale(1.08);
  122. }
  123. 75% {
  124. transform: scale(0.98);
  125. }
  126. 100% {
  127. transform: scale(1.08);
  128. }
  129. }
  130. </style>