coupon.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view class="u-wrap">
  3. <view v-if="couponList.length>0" class="jingdong">
  4. <view class="left">
  5. <view class="sum">
  6. <text class="num">100</text>
  7. </view>
  8. <view class="type">满149元可用</view>
  9. </view>
  10. <view class="right">
  11. <view class="top">
  12. <text class="tag">新人券</text>
  13. <view class="title">
  14. 仅可购买个人护理部分商品
  15. </view>
  16. <view class="bottom">
  17. <view class="date u-line-1">2020.01.01-2020.01.31</view>
  18. <view class="immediate-use">立即使用</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-else class="empty">
  24. <image :src="empty" style="width: 200px;height: 200px;"></image>
  25. <view class="tip">暂时没有优惠卷</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. couponList: [],
  34. empty: '/static/empty/default.png',
  35. };
  36. },
  37. };
  38. </script>
  39. <style>
  40. page {
  41. background-color: #fff;
  42. }
  43. </style>
  44. <style lang="scss" scoped>
  45. .u-wrap {
  46. padding: 20 rpx;
  47. }
  48. .jingdong {
  49. width: 700 rpx;
  50. height: auto;
  51. background-color: #ffffff;
  52. display: flex;
  53. .left {
  54. padding: 0 30 rpx;
  55. background-color: $base-color;
  56. text-align: center;
  57. font-size: 28 rpx;
  58. color: #ffffff;
  59. .sum {
  60. margin-top: 50 rpx;
  61. font-weight: bold;
  62. font-size: 32 rpx;
  63. .num {
  64. font-size: 80 rpx;
  65. }
  66. }
  67. .type {
  68. margin-bottom: 50 rpx;
  69. font-size: 24 rpx;
  70. }
  71. }
  72. .right {
  73. padding: 20 rpx 20 rpx 0;
  74. font-size: 28 rpx;
  75. .top {
  76. .tag {
  77. padding: 4 rpx 20 rpx;
  78. background-color: $base-color;;
  79. border-radius: 20 rpx;
  80. color: #ffffff;
  81. font-weight: bold;
  82. font-size: 24 rpx;
  83. margin-right: 10 rpx;
  84. }
  85. .title {
  86. height: 80 rpx;
  87. line-height: 80 rpx;
  88. }
  89. .bottom {
  90. border-top: 2 rpx dashed $u-border-color;
  91. display: flex;
  92. margin-top: 15 rpx;
  93. padding-top: 15 rpx;
  94. align-items: center;
  95. justify-content: space-between;
  96. margin-bottom: 10 rpx;
  97. .date {
  98. font-size: 20 rpx;
  99. flex: 1;
  100. }
  101. .immediate-use {
  102. margin-left: 20 rpx;
  103. height: auto;
  104. padding: 0 20 rpx;
  105. font-size: 24 rpx;
  106. border-radius: 40 rpx;
  107. line-height: 40 rpx;
  108. color: rgb(117, 142, 165);
  109. border: 2 rpx solid rgb(117, 142, 165);
  110. }
  111. }
  112. }
  113. }
  114. }
  115. .empty {
  116. margin-top: 220 rpx;
  117. width: 100%;
  118. text-align: center;
  119. .title {
  120. color: $u-main-color;
  121. margin: 20 rpx 0 10 rpx 0;
  122. font-weight: 400;
  123. font-size: 18px;
  124. }
  125. .tip {
  126. color: $u-tips-color;
  127. font-size: 14px;
  128. }
  129. .btn {
  130. color: #fff;
  131. background-image: linear-gradient(to left, #ff536f, rgba(#ff536f, 0.6));
  132. width: 200 rpx;
  133. padding: 15 rpx 28 rpx;
  134. border-radius: 130 rpx;
  135. margin: 80 rpx 0 0 275 rpx;
  136. }
  137. }
  138. </style>