index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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="right">
  10. <view class="other">
  11. <view class="type"><text>{{item.type||'暂无'}}</text> {{item.name||'暂无'}}</view>
  12. <view class="date">有效期{{item.start_time||'暂无'}}-{{item.end_time||'暂无'}}</view>
  13. </view>
  14. <view class="btn">
  15. <button type="default" size="mini" @click="toDiscount(item)">确认</button>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. couponList: {
  25. type: Array,
  26. },
  27. },
  28. data() {
  29. return {
  30. };
  31. },
  32. methods: {
  33. // 选择优惠劵
  34. toDiscount(e) {
  35. const that = this;
  36. that.$emit('toDiscount', {
  37. e
  38. })
  39. },
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. .main {
  45. .pre_one {
  46. text-align: center;
  47. padding: 2vw 0;
  48. }
  49. .pre_two {
  50. display: flex;
  51. justify-content: space-between;
  52. align-items: center;
  53. width: 94vw;
  54. margin: 0 2vw 1vw 2vw;
  55. border-radius: 3vw;
  56. .left {
  57. text-align: center;
  58. border-radius: 3vw;
  59. padding: 5vw 3vw;
  60. background-color: #FFFACD;
  61. color: #8B4513;
  62. .money {
  63. font-size: var(--font18Szie);
  64. font-weight: bold;
  65. }
  66. .man {
  67. font-size: var(--font14Size);
  68. }
  69. }
  70. .right {
  71. display: flex;
  72. justify-content: space-between;
  73. align-items: center;
  74. flex-grow: 1;
  75. border-radius: 3vw;
  76. padding: 8vw 2vw;
  77. background-color: var(--mainColor);
  78. .other {
  79. display: flex;
  80. flex-direction: column;
  81. width: 50vw;
  82. .type {
  83. margin: 0 0 1vw 0;
  84. text {
  85. border: 0.5vw solid red;
  86. color: red;
  87. padding: 0 1vw;
  88. border-radius: 1vw;
  89. font-size: var(--font12Size);
  90. margin: 0 1vw 0 0;
  91. }
  92. font-size: var(--font16Size);
  93. }
  94. .date {
  95. font-size: var(--font12Size);
  96. color: var(--f99Color);
  97. }
  98. }
  99. .btn {
  100. width: 20vw;
  101. button {
  102. background-color: #FFD700;
  103. font-weight: bold;
  104. }
  105. }
  106. }
  107. }
  108. }
  109. </style>