activityBean.vue 5.3 KB

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