cm-coupon-tips.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template name="alert">
  2. <view class="coupon-content-model">
  3. <view class="coupon-alert-content">
  4. <view class="coupon">
  5. <view class="coupon-list">
  6. <view class="list-cell-tags"
  7. ><text>{{ coupon.couponType | TypeFormat }}</text></view
  8. >
  9. <view class="list-cell-le">
  10. <view class="coupon-maxMoney"> <text class="small">¥</text> {{ coupon.couponAmount }} </view>
  11. <view class="coupon-minMoney">
  12. <text class="txt">满{{ coupon.touchPrice }}可用</text>
  13. </view>
  14. </view>
  15. <view class="list-cell-ri">
  16. <view class="list-cell-top">
  17. <text v-if="coupon.couponType == 0">
  18. {{
  19. coupon.productType && coupon.productType == 1
  20. ? '全商城商品通用'
  21. : coupon.couponName
  22. }}
  23. </text>
  24. <text v-if="coupon.couponType == 1">
  25. {{ coupon.categoryType == 1 ? coupon.couponName : coupon.couponName }}
  26. </text>
  27. <text v-if="coupon.couponType == 3">仅限购买店铺【{{ coupon.shopName }}】的商品</text>
  28. <text v-if="coupon.couponType == 4 || coupon.couponType == 2">全商城商品通用</text>
  29. </view>
  30. <view class="list-cell-time">{{ coupon.startDate }} - {{ coupon.endDate }}</view>
  31. </view>
  32. </view>
  33. <view class="coupon-btn" @click.stop="cancel">立即收下</view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: 'alert',
  41. props: {
  42. coupon: {
  43. type: Object
  44. }
  45. },
  46. filters: {
  47. TypeFormat(value) {
  48. const map = {
  49. 0:'活动券',
  50. 1:'品类券',
  51. 2:'用户专享券',
  52. 3:'店铺券',
  53. 4:'新用户券',
  54. }
  55. return map[value]
  56. }
  57. },
  58. data() {
  59. return {}
  60. },
  61. created() {},
  62. onLoad() {},
  63. methods: {
  64. cancel(){
  65. this.$emit('cancel')
  66. }
  67. },
  68. onShow() {}
  69. }
  70. </script>
  71. <style lang="scss">
  72. .coupon-content-model {
  73. width: 100%;
  74. height: 100%;
  75. background: rgba(0, 0, 0, 0.5);
  76. position: fixed;
  77. top: 0;
  78. left: 0;
  79. z-index: 8888;
  80. transition: all 0.4s;
  81. .coupon-alert-content {
  82. width: 600rpx;
  83. height: 612rpx;
  84. position: absolute;
  85. top: 0;
  86. left: 0;
  87. bottom: 0;
  88. right: 0;
  89. margin: auto;
  90. box-sizing: border-box;
  91. padding-top: 92rpx;
  92. .coupon {
  93. width: 600rpx;
  94. height: 522rpx;
  95. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  96. background-size: cover;
  97. box-sizing: border-box;
  98. padding: 230rpx 40rpx 0 40rpx;
  99. .coupon-list {
  100. width: 100%;
  101. height: 147rpx;
  102. margin-bottom: 32rpx;
  103. box-sizing: border-box;
  104. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  105. background-size: cover;
  106. position: relative;
  107. .list-cell-tags {
  108. display: inline-block;
  109. padding: 0 10rpx;
  110. height: 32rpx;
  111. line-height: 32rpx;
  112. background-color: #f94b4b;
  113. color: #ffffff;
  114. font-size: 18rpx;
  115. border-radius: 16rpx 0 16rpx 0;
  116. text-align: center;
  117. position: absolute;
  118. top: 0;
  119. left: 0;
  120. }
  121. .list-cell-le {
  122. width: 154rpx;
  123. height: 100%;
  124. box-sizing: border-box;
  125. padding: 30rpx 0;
  126. float: left;
  127. .coupon-maxMoney {
  128. width: 100%;
  129. height: 54rpx;
  130. line-height: 54rpx;
  131. font-size: 42rpx;
  132. color: #f94b4b;
  133. text-align: center;
  134. margin-top: 10rpx;
  135. .small {
  136. font-size: $font-size-20;
  137. }
  138. }
  139. .coupon-minMoney {
  140. width: 100%;
  141. height: 28rpx;
  142. float: left;
  143. box-sizing: border-box;
  144. padding-left: 24rpx;
  145. .txt {
  146. display: block;
  147. height: 28rpx;
  148. line-height: 28rpx;
  149. font-size: 16rpx;
  150. color: #f94b4b;
  151. text-align: center;
  152. padding: 0 5rpx;
  153. background-color: #fff1eb;
  154. border-radius: 4rpx;
  155. float: left;
  156. }
  157. }
  158. }
  159. .list-cell-ri {
  160. width: 366rpx;
  161. height: 100%;
  162. box-sizing: border-box;
  163. padding: 30rpx 20rpx;
  164. float: left;
  165. .list-cell-top {
  166. width: 100%;
  167. height: 64rpx;
  168. line-height: 64rpx;
  169. font-size: $font-size-26;
  170. color: #333333;
  171. float: left;
  172. text-overflow: ellipsis;
  173. display: -webkit-box;
  174. word-break: break-all;
  175. -webkit-box-orient: vertical;
  176. -webkit-line-clamp: 1;
  177. overflow: hidden;
  178. }
  179. .list-cell-time {
  180. width: 100%;
  181. height: 28rpx;
  182. line-height: 28rpx;
  183. text-align: left;
  184. font-size: $font-size-20;
  185. color: #999999;
  186. }
  187. }
  188. }
  189. .coupon-btn {
  190. width: 100%;
  191. height: 78rpx;
  192. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  193. background-size: cover;
  194. line-height: 78rpx;
  195. text-align: center;
  196. color: #ffffff;
  197. font-size: $font-size-36;
  198. }
  199. }
  200. }
  201. }
  202. </style>