index.vue 3.6 KB

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