wike-model.vue 3.2 KB

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