activityBean.vue 4.9 KB

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