activityBean.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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%' : '13%'}" @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. console.log('type================》',type)
  78. this.bgImagePath = `https://static.caimei365.com/app/img/icon/bean-icon-${type}@2x.png`
  79. console.log(this.bgImagePath)
  80. },
  81. handleClick(e) {
  82. console.log(e);
  83. if (!this.show) return;
  84. this.$emit('click',false);
  85. },
  86. handleClickCancel() {
  87. this.$emit('cancel',false);
  88. },
  89. discard(){
  90. //丢弃
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. .tui-alert-box {
  97. width: 100%;
  98. height: 100%;
  99. display: flex;
  100. align-items: center;
  101. justify-content: center;
  102. flex-direction: column;
  103. position: fixed;
  104. left: 0;
  105. top: 100%;
  106. opacity: 0;
  107. background: rgba(51,51,51,0.7);
  108. z-index: 99999;
  109. }
  110. .tui-alert-show {
  111. top: 0;
  112. opacity: 1;
  113. // animation:rundtop 0.5s;
  114. }
  115. .tui-alert-hide{
  116. top: 100%;
  117. opacity: 0;
  118. // animation:rundbottom 0.5s;
  119. }
  120. .tui-alert-image{
  121. width: 626rpx;
  122. height: 532rpx;
  123. position: absolute;
  124. top: 0;
  125. left: 0;
  126. bottom: 0;
  127. right: 0;
  128. margin: auto;
  129. image{
  130. width: 626rpx;
  131. height: 532rpx;
  132. display: block;
  133. }
  134. }
  135. .tui-alert-content{
  136. width: 580rpx;
  137. height: 790rpx;
  138. position: absolute;
  139. top: 0;
  140. left: 0;
  141. bottom: 0;
  142. right: 0;
  143. margin: auto;
  144. box-sizing: border-box;
  145. padding-top: 485rpx;
  146. background-size: cover;
  147. .tui-alert-content-text{
  148. height: 118rpx;
  149. line-height: 118rpx;
  150. text-align: center;
  151. width: 100%;
  152. font-size: $font-size-36;
  153. color: #333333;
  154. }
  155. .tui-alert-content-bean{
  156. width: 100%;
  157. height: 74rpx;
  158. line-height: 74rpx;
  159. box-sizing: border-box;
  160. display: flex;
  161. flex-direction: column;
  162. align-items: center;
  163. .tui-alert-main{
  164. .tui-alert-icon{
  165. width: 94rpx;
  166. height: 74rpx;
  167. display: block;
  168. float: left;
  169. }
  170. .tui-alert-text{
  171. color: $color-system;
  172. line-height: 74rpx;
  173. float: left;
  174. .icon-add{
  175. font-size:40rpx;
  176. margin:0 15rpx;
  177. }
  178. .icon-text{
  179. font-weight: bold;
  180. font-size:48rpx;
  181. }
  182. }
  183. }
  184. }
  185. .tui-alert-content-tips{
  186. width: 100%;
  187. height: 40rpx;
  188. line-height: 40rpx;
  189. margin-top: 41rpx;
  190. box-sizing: border-box;
  191. display: flex;
  192. flex-direction: column;
  193. align-items: center;
  194. .tips{
  195. width: 224rpx;
  196. height: 40rpx;
  197. background-color: rgba(226, 91, 28, 0.1);
  198. border-radius: 36rpx;
  199. line-height: 40rpx;
  200. font-size: $font-size-24;
  201. color: $color-system;
  202. text-align: center;
  203. }
  204. }
  205. }
  206. .icon-2guanbi{
  207. display: block;
  208. width: 100rpx;
  209. height: 100rpx;
  210. line-height: 100rpx;
  211. text-align: center;
  212. color: #FFFFFF;
  213. position: absolute;
  214. bottom: 13%;
  215. left: 50%;
  216. font-size: 58rpx;
  217. margin-left: -50rpx;
  218. }
  219. .tui-alert-mask-show {
  220. visibility: visible;
  221. opacity: 1;
  222. }
  223. .tui-alert-btn {
  224. width: 100%;
  225. height: 90rpx;
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. background-color: #fff;
  230. box-sizing: border-box;
  231. position: relative;
  232. font-size: 32rpx;
  233. line-height: 32rpx;
  234. }
  235. .tui-alert-btn-hover {
  236. background-color: #f7f7f7;
  237. }
  238. .tui-alert-btn::before {
  239. width: 100%;
  240. content: "";
  241. position: absolute;
  242. border-top: 1rpx solid #E0E0E0;
  243. -webkit-transform: scaleY(0.5);
  244. transform: scaleY(0.5);
  245. left: 0;
  246. top: 0;
  247. }
  248. @keyframes rundtop{
  249. 0%{top: 100%;opacity: 0;}
  250. 100%{top:0;opacity: 1;}
  251. }
  252. @keyframes rundbottom{
  253. 0%{top: 0;opacity: 1;}
  254. 100%{top:100%;opacity: 0;}
  255. }
  256. </style>