goods-coupon-list.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="coupon-section">
  3. <view class="coupon-tags">
  4. <template v-for="(item, index) in couponList">
  5. <view class="tag" v-if="index < 2" :key="item.couponId">
  6. <view class="coupon-label" v-text="item.couponTitle"></view>
  7. </view>
  8. </template>
  9. </view>
  10. <view class="more" @click="$emit('click')">
  11. <text>领券</text>
  12. <text class="iconfont icon-chakangengduo"></text>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'goods-coupon-list',
  19. props: {
  20. couponList: {
  21. type: [Object, Array],
  22. default: null
  23. }
  24. }
  25. }
  26. </script>
  27. <style lang="scss" scoped>
  28. .coupon-section {
  29. @extend .cm-flex-between;
  30. padding: 0 24rpx;
  31. background-color: #fff;
  32. .coupon-tags {
  33. width: 80%;
  34. white-space: nowrap;
  35. overflow: hidden;
  36. text-overflow: clip;
  37. .tag {
  38. display: inline-block;
  39. height: 30rpx;
  40. padding: 0 8rpx;
  41. margin-right: 8rpx;
  42. background: #fff3f7;
  43. border: 1rpx solid #ff457b;
  44. border-radius: 4rpx;
  45. vertical-align: middle;
  46. .coupon-label {
  47. font-size: 22rpx;
  48. max-width: 230rpx;
  49. overflow: hidden;
  50. text-overflow: ellipsis;
  51. white-space: nowrap;
  52. color: #ff457b;
  53. &::before {
  54. content: '券 |';
  55. margin: 0 6rpx;
  56. margin-left: 0;
  57. }
  58. }
  59. &:first-child {
  60. margin-left: 0;
  61. }
  62. }
  63. }
  64. .more {
  65. line-height: 40rpx;
  66. text {
  67. font-size: 24rpx;
  68. color: #ff457b;
  69. }
  70. }
  71. }
  72. </style>