index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="main">
  3. <view class="pre_one">优惠劵({{couponList.length}})</view>
  4. <view class="pre_two" v-for="(item,index) in couponList" :key="index">
  5. <view class="left">
  6. <view class="money">¥{{item.money||'0'}}</view>
  7. <view class="man">满{{item.discount_money||'0'}}可以</view>
  8. </view>
  9. <view class="right">
  10. <view class="other">
  11. <view class="type"><text>{{item.type||'暂无'}}</text> {{item.coupon.name||'暂无'}}</view>
  12. <view class="date">有效期{{item.start_time||'暂无'}}-{{item.end_time||'暂无'}}</view>
  13. </view>
  14. <view class="btn">
  15. <button type="default" size="mini" @click="toDiscount(item)">确认</button>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. couponList: {
  25. type: Array,
  26. },
  27. },
  28. data() {
  29. return {
  30. };
  31. },
  32. methods: {
  33. // 选择优惠劵
  34. toDiscount(e) {
  35. const that = this;
  36. that.$emit('toDiscount', e)
  37. },
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .main {
  43. .pre_one {
  44. text-align: center;
  45. padding: 2vw 0;
  46. }
  47. .pre_two {
  48. display: flex;
  49. justify-content: space-between;
  50. align-items: center;
  51. width: 96vw;
  52. margin: 0 2vw 2vw 2vw;
  53. border-radius: 3vw;
  54. .left {
  55. text-align: center;
  56. border-radius: 3vw;
  57. padding: 5vw 3vw;
  58. background-color: #FFFACD;
  59. color: #8B4513;
  60. .money {
  61. font-size: var(--font18Szie);
  62. font-weight: bold;
  63. }
  64. .man {
  65. font-size: var(--font14Size);
  66. }
  67. }
  68. .right {
  69. display: flex;
  70. justify-content: space-between;
  71. align-items: center;
  72. flex-grow: 1;
  73. border-radius: 3vw;
  74. padding: 5vw 3vw;
  75. background-color: var(--mainColor);
  76. .other {
  77. display: flex;
  78. flex-direction: column;
  79. width: 50vw;
  80. .type {
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. display: -webkit-box;
  84. line-height: 6vw;
  85. -webkit-line-clamp: 1;
  86. -webkit-box-orient: vertical;
  87. font-size: var(--font14Size);
  88. margin: 0 1vw 1vw 0;
  89. text {
  90. margin: 0 1vw 0 0;
  91. border: 0.5vw solid red;
  92. color: red;
  93. padding: 0 1vw;
  94. border-radius: 1vw;
  95. font-size: var(--font12Size);
  96. }
  97. }
  98. .date {
  99. font-size: var(--font12Size);
  100. color: var(--f99Color);
  101. }
  102. }
  103. .btn {
  104. width: 20vw;
  105. button {
  106. background-color: #FFD700;
  107. font-weight: bold;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. </style>