湘妃到家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.0 KiB

1 month ago
  1. <template>
  2. <view v-if="list.length > 0" class="list">
  3. <view class="item"
  4. v-for="(item,index) in list"
  5. @click="$emit('select', item)"
  6. :key="index">
  7. <view class="price">
  8. <view class="num">
  9. <view class="icon">
  10. </view>
  11. {{ item.money }}
  12. </view>
  13. <view class="tiao">
  14. {{ item.useMoney }}可用
  15. </view>
  16. </view>
  17. <view class="date">
  18. 有效期{{ item.endTime }}
  19. </view>
  20. <view @click.stop="$emit('select',item)" class="status">
  21. <!-- 使 -->
  22. 使
  23. </view>
  24. </view>
  25. </view>
  26. <van-empty v-else image="/static/empty/coupon.png" image-size="400rpx" description="暂无优惠券"/>
  27. </template>
  28. <script>
  29. export default {
  30. props : ['list'],
  31. name:"couponList",
  32. data() {
  33. return {
  34. };
  35. },
  36. methods : {
  37. }
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. .list{
  42. .item{
  43. color: #4FD3BC;
  44. position: relative;
  45. width: calc(100% - 40rpx);
  46. height: 220rpx;
  47. background: url(/static/coupon/c.png);
  48. background-size: 100% 100%;
  49. margin: 20rpx;
  50. box-sizing: border-box;
  51. padding: 30rpx;
  52. .status{
  53. position: absolute;
  54. right: 20rpx;
  55. top: 20rpx;
  56. height: calc(100% - 40rpx);
  57. width: 60rpx;
  58. writing-mode:vertical-rl;
  59. box-sizing: border-box;
  60. padding: 20rpx;
  61. background-color: #fff;
  62. border-radius: 60rpx;
  63. display: flex;
  64. justify-content: center;
  65. align-items: center;
  66. }
  67. .price{
  68. display: flex;
  69. align-items: center;
  70. .num{
  71. color: #4FD3BC;
  72. font-weight: 900;
  73. font-size: 70rpx;
  74. display: flex;
  75. align-items: flex-end;
  76. .icon{
  77. color: #fff;
  78. background-color: #4FD3BC;
  79. width: 30rpx;
  80. height: 30rpx;
  81. display: flex;
  82. justify-content: center;
  83. align-items: center;
  84. font-size: 20rpx;
  85. border-radius: 14rpx;
  86. margin-bottom: 14rpx;
  87. margin-right: 10rpx;
  88. }
  89. }
  90. .tiao{
  91. padding: 10rpx 20rpx;
  92. background-color: #9ee3d1;
  93. color: #25a28c;
  94. font-size: 22rpx;
  95. margin-left: 20rpx;
  96. border-radius: 10rpx;
  97. }
  98. }
  99. .date{
  100. }
  101. }
  102. }
  103. </style>