index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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="center">
  10. <view class="type"><text>{{item.type||'暂无'}}</text> {{item.name||'暂无'}}</view>
  11. <view class="date">有效期{{item.start_time||'暂无'}}-{{item.end_time||'暂无'}}</view>
  12. </view>
  13. <view class="right">
  14. <button type="default" size="mini" @click="toDiscount(item)">确认</button>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. couponList: {
  23. type: Array,
  24. },
  25. },
  26. data() {
  27. return {
  28. };
  29. },
  30. methods: {
  31. // 选择优惠劵
  32. toDiscount(e) {
  33. const that = this;
  34. that.$emit('toDiscount', {
  35. e
  36. })
  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: 94vw;
  52. margin: 0 2vw 1vw 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. .center {
  69. flex-grow: 1;
  70. border-radius: 3vw;
  71. border-top-right-radius: 0;
  72. border-bottom-right-radius: 0;
  73. padding: 5vw 2vw;
  74. background-color: var(--mainColor);
  75. .type {
  76. margin: 0 0 1vw 0;
  77. text {
  78. border: 0.5vw solid red;
  79. color: red;
  80. padding: 0 1vw;
  81. border-radius: 1vw;
  82. font-size: var(--font12Size);
  83. margin: 0 1vw 0 0;
  84. }
  85. font-size: var(--font16Size);
  86. }
  87. .date {
  88. font-size: var(--font12Size);
  89. color: var(--f99Color);
  90. }
  91. }
  92. .right {
  93. padding: 7vw 3vw;
  94. border-radius: 3vw;
  95. border-top-left-radius: 0;
  96. border-bottom-left-radius: 0;
  97. background-color: var(--mainColor);
  98. button {
  99. background-color: #FFD700;
  100. font-weight: bold;
  101. }
  102. }
  103. }
  104. }
  105. </style>