index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. </script>
  33. <style lang="scss">
  34. .main {
  35. .pre_one {
  36. text-align: center;
  37. padding: 2vw 0;
  38. }
  39. .pre_two {
  40. display: flex;
  41. justify-content: space-between;
  42. align-items: center;
  43. width: 94vw;
  44. margin: 0 2vw 1vw 2vw;
  45. border-radius: 3vw;
  46. .left {
  47. text-align: center;
  48. border-radius: 3vw;
  49. padding: 5vw 3vw;
  50. background-color: #FFFACD;
  51. color: #8B4513;
  52. .money {
  53. font-size: var(--font18Szie);
  54. font-weight: bold;
  55. }
  56. .man {
  57. font-size: var(--font14Size);
  58. }
  59. }
  60. .center {
  61. flex-grow: 1;
  62. border-radius: 3vw;
  63. border-top-right-radius: 0;
  64. border-bottom-right-radius: 0;
  65. padding: 5vw 2vw;
  66. background-color: var(--mainColor);
  67. .type {
  68. margin: 0 0 1vw 0;
  69. text {
  70. border: 0.5vw solid red;
  71. color: red;
  72. padding: 0 1vw;
  73. border-radius: 1vw;
  74. font-size: var(--font12Size);
  75. margin: 0 1vw 0 0;
  76. }
  77. font-size: var(--font16Size);
  78. }
  79. .date {
  80. font-size: var(--font12Size);
  81. color: var(--f99Color);
  82. }
  83. }
  84. .right {
  85. padding: 7vw 3vw;
  86. border-radius: 3vw;
  87. border-top-left-radius: 0;
  88. border-bottom-left-radius: 0;
  89. background-color: var(--mainColor);
  90. button {
  91. background-color: #FFD700;
  92. font-weight: bold;
  93. }
  94. }
  95. }
  96. }
  97. </style>