index.vue 3.6 KB

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