index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="discount">
  3. <view class="pre_one">优惠劵({{total||couponList.length}}张)</view>
  4. <view class="pre_two">
  5. <view class="list" v-for="(item,index) in couponList" :key="index">
  6. <view class="l">
  7. <view class="l_1" v-if="item.discount_type=='min'">
  8. <view class="money">¥{{item.discount_config.min||'0'}}</view>
  9. <view v-if="item.discount_config.limit=='nolimit'" class="man">不限</view>
  10. <view v-else class="man">满{{item.discount_config.limit||'0'}}可用</view>
  11. </view>
  12. <view class="l_2" v-else-if="item.discount_type=='discount'">
  13. <view class="money">{{item.discount_config.min||'0'}}折</view>
  14. <view v-if="item.discount_config.limit=='nolimit'" class="man">不限</view>
  15. <view v-else class="man">
  16. 满{{item.discount_config.limit||'0'}}可用,最多减{{item.discount_config.max||'0'}}元
  17. </view>
  18. </view>
  19. </view>
  20. <view class="c">
  21. <view class="type"><text>{{item.discount_type_label||'暂无'}}</text>
  22. {{item.name||'暂无'}}
  23. </view>
  24. <view v-if="item.expire_type=='days'" class="date">{{item.expire_time||'暂无'}}天内有效</view>
  25. <view v-if="item.expire_type=='fixed'" class="date">{{item.expire_time||'暂无'}}</view>
  26. <view v-if="item.get_limit=='max'" class="date">
  27. {{item.use_limit_label||'暂无'}}-{{item.expire_type_label}}-{{item.get_limit_label||'暂无'}}领取{{item.get_limit_config.max}}张
  28. </view>
  29. <view v-if="item.get_limit=='nolimit'" class="date">
  30. {{item.use_limit_label||'暂无'}}-{{item.expire_type_label}}-{{item.get_limit_label||'暂无'}}
  31. </view>
  32. </view>
  33. <view class="r">
  34. <button v-if="Style&&Style.btn||false" type="default" size="mini"
  35. @click="toDiscount(item)">确认</button>
  36. <button v-if="Style&&Style.status||false" type="default"
  37. size="mini">{{item.status=='0'?'未使用':item.status=='1'?'已使用':'已过期'}}</button>
  38. <button v-if="Style&&Style.receive==true&&item.canGet==true" type="default" size="mini"
  39. @click="toReceive(item)">领取</button>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. props: {
  48. couponList: {
  49. type: Array,
  50. },
  51. total: {
  52. type: Number
  53. },
  54. Style: {
  55. type: Object,
  56. },
  57. },
  58. data() {
  59. return {
  60. };
  61. },
  62. methods: {
  63. // 选择优惠劵
  64. toDiscount(e) {
  65. const that = this;
  66. that.$emit('toDiscount', e)
  67. },
  68. // 领取优惠劵
  69. toReceive(e) {
  70. const that = this;
  71. that.$emit('toReceive', e)
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss">
  77. .discount {
  78. .pre_one {
  79. text-align: center;
  80. margin: 2vw 0;
  81. }
  82. .pre_two {
  83. display: flex;
  84. flex-direction: column;
  85. padding: 0 2vw;
  86. .list {
  87. background-color: var(--fffColor);
  88. margin: 0 0 2vw 0;
  89. display: flex;
  90. justify-content: space-between;
  91. border-radius: 5px;
  92. padding: 2vw;
  93. .l {
  94. width: 20vw;
  95. background-color: #FFFACD;
  96. text-align: center;
  97. font-size: var(--font14Size);
  98. padding: 1vw;
  99. border-radius: 5px;
  100. }
  101. .c {
  102. width: 52vw;
  103. .type {
  104. font-size: var(--font14Size);
  105. margin: 0 0 1vw 0;
  106. text {
  107. background-color: var(--fFB1Color);
  108. color: var(--fffColor);
  109. padding: 1vw;
  110. border-radius: 5px;
  111. display: inline-block;
  112. margin: 0 1vw 0 0;
  113. }
  114. }
  115. .date {
  116. font-size: var(--font12Size);
  117. margin: 0 0 1vw 0;
  118. color: var(--f85Color);
  119. }
  120. }
  121. .r {
  122. width: 16vw;
  123. text-align: right;
  124. button {
  125. background-color: #FFD700;
  126. font-weight: bold;
  127. padding: 2vw;
  128. font-size: var(--font14Size);
  129. line-height: 1;
  130. }
  131. }
  132. }
  133. }
  134. }
  135. </style>