index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.discount_type_label||'暂无'}}</text>
  12. {{item.name||'暂无'}}
  13. </view>
  14. <view class="date">{{item.expire_time||'暂无'}}</view>
  15. <view class="date">{{item.use_limit_label||'暂无'}}-{{item.get_limit_label||'暂无'}}</view>
  16. </view>
  17. <view class="btn">
  18. <button v-if="Style&&Style.btn||false" type="default" size="mini"
  19. @click="toDiscount(item)">确认</button>
  20. <button v-if="Style&&Style.status||false" type="default"
  21. size="mini">{{item.status=='0'?'未使用':item.status=='1'?'已使用':'已过期'}}</button>
  22. <button v-if="Style&&Style.receive||false" type="default" size="mini"
  23. @click="toReceive(item)">领取</button>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. props: {
  32. couponList: {
  33. type: Array,
  34. },
  35. Style: {
  36. type: Object,
  37. },
  38. },
  39. data() {
  40. return {
  41. };
  42. },
  43. methods: {
  44. // 选择优惠劵
  45. toDiscount(e) {
  46. const that = this;
  47. that.$emit('toDiscount', e)
  48. },
  49. // 领取优惠劵
  50. toReceive(e) {
  51. const that = this;
  52. that.$emit('toReceive', e)
  53. },
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .main {
  59. .pre_one {
  60. text-align: center;
  61. padding: 2vw 0;
  62. }
  63. .pre_two {
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: center;
  67. width: 96vw;
  68. margin: 0 2vw 2vw 2vw;
  69. border-radius: 3vw;
  70. .left {
  71. text-align: center;
  72. border-radius: 3vw;
  73. padding: 6vw 3vw;
  74. background-color: #FFFACD;
  75. color: #8B4513;
  76. border-right: 0.5vw dashed var(--fcColor);
  77. .money {
  78. font-size: var(--font18Szie);
  79. font-weight: bold;
  80. }
  81. .man {
  82. font-size: var(--font14Size);
  83. }
  84. }
  85. .right {
  86. display: flex;
  87. justify-content: space-between;
  88. align-items: center;
  89. flex-grow: 1;
  90. border-radius: 3vw;
  91. padding: 1.5vw 3vw;
  92. background-color: var(--mainColor);
  93. .other {
  94. display: flex;
  95. flex-direction: column;
  96. width: 50vw;
  97. .type {
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. display: -webkit-box;
  101. line-height: 6vw;
  102. -webkit-line-clamp: 1;
  103. -webkit-box-orient: vertical;
  104. font-size: var(--font14Size);
  105. margin: 0 1vw 1vw 0;
  106. text {
  107. margin: 0 1vw 0 0;
  108. border: 0.5vw solid red;
  109. color: red;
  110. padding: 0 1vw;
  111. border-radius: 1vw;
  112. font-size: var(--font12Size);
  113. }
  114. }
  115. .date {
  116. overflow: hidden;
  117. text-overflow: ellipsis;
  118. display: -webkit-box;
  119. -webkit-line-clamp: 2;
  120. -webkit-box-orient: vertical;
  121. font-size: var(--font12Size);
  122. color: var(--f99Color);
  123. }
  124. }
  125. .btn {
  126. width: 20vw;
  127. button {
  128. background-color: #FFD700;
  129. font-weight: bold;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. </style>