activity-model.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view>
  3. <view class="tui-alert-class tui-alert-box" :class="[show?'tui-alert-show':'tui-alert-hide']" @touchmove.stop.prevent="discard">
  4. <view class="tui-alert-content clearfix">
  5. <view class="tui-alert-content-text">恭喜您!</view>
  6. <view class="tui-alert-content-bean">成功激活紫亚兰大会门票!</view>
  7. <view class="tui-alert-content-bean">到采美专区签到打卡,可领取超值礼包,更多惊喜和福利等你来解琐。</view>
  8. <view class="tui-alert-content-tips">
  9. <view class="tips" @click.stop="handleClickCancel">知道了</view>
  10. </view>
  11. </view>
  12. <text class="iconfont icon-2guanbi" @click.stop="handleClickCancel"></text>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name:'tuiAlert',
  19. props: {
  20. //控制显示
  21. show: {
  22. type: Boolean,
  23. default: false
  24. },
  25. //提示信息字体大小
  26. size: {
  27. type: Number,
  28. default: 30
  29. },
  30. //提示信息字体颜色
  31. color: {
  32. type: String,
  33. default: '#333'
  34. },
  35. //按钮字体颜色
  36. btnColor: {
  37. type: String,
  38. default: '#EB0909'
  39. },
  40. btnText:{
  41. type: String,
  42. default: ''
  43. },
  44. beansType:{//根据类型设置背景图片:1注册机构,2升级资质机构,3个人机构修改资料,4资质机构修改资料,5下单成功,6线上支付成功,7确认收货成功
  45. type: Number,
  46. default: 1
  47. },
  48. beanNumber:{//采美豆显示数量
  49. type:Number,
  50. default:100
  51. }
  52. },
  53. data() {
  54. return{
  55. bgImagePath:'https://static.caimei365.com/app/img/icon/bean-icon-2@2x.png',
  56. }
  57. },
  58. created() {
  59. this.handInitType(this.beansType)
  60. },
  61. methods: {
  62. handInitType(type){
  63. this.bgImagePath = `https://static.caimei365.com/app/img/icon/bean-icon-${type}@2x.png`
  64. },
  65. handleClick(e) {
  66. console.log(e)
  67. if (!this.show) return
  68. this.$emit('click',false)
  69. },
  70. handleClickCancel() {
  71. this.$emit('cancel',false)
  72. },
  73. discard(){
  74. //丢弃
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss">
  80. .tui-alert-box {
  81. width: 100%;
  82. height: 100%;
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. flex-direction: column;
  87. position: fixed;
  88. left: 0;
  89. top: 100%;
  90. opacity: 0;
  91. background: rgba(51,51,51,0.7);
  92. z-index: 99999;
  93. }
  94. .tui-alert-show {
  95. top: 0;
  96. opacity: 1;
  97. // animation:rundtop 0.5s;
  98. }
  99. .tui-alert-hide{
  100. top: 100%;
  101. opacity: 0;
  102. // animation:rundbottom 0.5s;
  103. }
  104. .tui-alert-image{
  105. width: 626rpx;
  106. height: 532rpx;
  107. position: absolute;
  108. top: 0;
  109. left: 0;
  110. bottom: 0;
  111. right: 0;
  112. margin: auto;
  113. image{
  114. width: 626rpx;
  115. height: 532rpx;
  116. display: block;
  117. }
  118. }
  119. .tui-alert-content{
  120. width: 580rpx;
  121. height: 550rpx;
  122. border-radius: 40rpx;
  123. position: absolute;
  124. top: 0;
  125. left: 0;
  126. bottom: 0;
  127. right: 0;
  128. margin: auto;
  129. box-sizing: border-box;
  130. background-color: #FFFFFF;
  131. padding: 40rpx;
  132. .tui-alert-content-text{
  133. height: 100rpx;
  134. line-height: 100rpx;
  135. text-align: center;
  136. width: 100%;
  137. font-size: $font-size-36;
  138. color: #333333;
  139. font-weight: 600;
  140. float: left;
  141. letter-spacing: 2rpx;
  142. }
  143. .tui-alert-content-bean{
  144. height: auto;
  145. line-height: 60rpx;
  146. text-align: center;
  147. width: 100%;
  148. font-size: $font-size-30;
  149. color: #e10078;
  150. float: left;
  151. }
  152. .tui-alert-content-tips{
  153. width: 100%;
  154. height: 66rpx;
  155. line-height: 66rpx;
  156. margin-top: 60rpx;
  157. box-sizing: border-box;
  158. float: left;
  159. .tips{
  160. width: 240rpx;
  161. height: 70rpx;
  162. background-color: #e10078;
  163. border-radius: 36rpx;
  164. line-height: 70rpx;
  165. font-size: $font-size-30;
  166. color: #FFFFFF;
  167. text-align: center;
  168. margin: 0 auto;
  169. }
  170. }
  171. }
  172. .icon-2guanbi{
  173. display: block;
  174. width: 100rpx;
  175. height: 100rpx;
  176. line-height: 100rpx;
  177. text-align: center;
  178. color: #FFFFFF;
  179. position: absolute;
  180. bottom: 18%;
  181. left: 50%;
  182. font-size: 58rpx;
  183. margin-left: -50rpx;
  184. }
  185. .tui-alert-mask-show {
  186. visibility: visible;
  187. opacity: 1;
  188. }
  189. .tui-alert-btn {
  190. width: 100%;
  191. height: 90rpx;
  192. display: flex;
  193. align-items: center;
  194. justify-content: center;
  195. background-color: #fff;
  196. box-sizing: border-box;
  197. position: relative;
  198. font-size: 32rpx;
  199. line-height: 32rpx;
  200. }
  201. .tui-alert-btn-hover {
  202. background-color: #f7f7f7;
  203. }
  204. .tui-alert-btn::before {
  205. width: 100%;
  206. content: "";
  207. position: absolute;
  208. border-top: 1rpx solid #E0E0E0;
  209. -webkit-transform: scaleY(0.5);
  210. transform: scaleY(0.5);
  211. left: 0;
  212. top: 0;
  213. }
  214. @keyframes rundtop{
  215. 0%{top: 100%;opacity: 0;}
  216. 100%{top:0;opacity: 1;}
  217. }
  218. @keyframes rundbottom{
  219. 0%{top: 0;opacity: 1;}
  220. 100%{top:100%;opacity: 0;}
  221. }
  222. </style>