goods-coupon-section.vue 1.9 KB

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