activityBean.vue 8.0 KB

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