CartItem.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template lang="pug">
  2. li.cart-item
  3. h3.item-name
  4. input.item-quantity(type='number' min='1')
  5. span.item-x x
  6. span.item-price
  7. span.item-equals =
  8. span.item-subtotal
  9. .cart-item-options-wrapper
  10. .cart-item-options
  11. .cart-item-option(class='fa fa-plus')
  12. .cart-item-option(class='fa fa-minus')
  13. .cart-item-option(class='fa fa-trash')
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. index: {
  19. type: Number,
  20. default: -1,
  21. required: true
  22. },
  23. item: {
  24. type: Object,
  25. default: null
  26. }
  27. }
  28. }
  29. </script>
  30. <style lang="sass">
  31. @import '../../assets/variables'
  32. .cart-item
  33. width: 100%
  34. height: 90px
  35. list-style: none outside none
  36. border-bottom: 1px solid $app-border-color
  37. box-sizing: border-box
  38. position: relative
  39. &:nth-child(1)
  40. border-top: 1px solid $app-border-color
  41. &:hover
  42. transition-duration: 1000ms
  43. border-bottom: 2px solid $app-main-color
  44. .item-name
  45. width: 100%
  46. height: 20px
  47. margin: 10px 0 5px 0
  48. float: left
  49. font-size: 8pt
  50. display: inline-block
  51. .item-quantity
  52. width: 50px
  53. height: 28px
  54. margin-top: 6px
  55. text-align: right
  56. float: left
  57. display: inline-block
  58. .item-x
  59. width: 20px
  60. height: 20px
  61. margin-top: 12px
  62. text-align: right
  63. float: left
  64. display: inline-block
  65. .item-price
  66. width: 80px
  67. height: 20px
  68. margin-top: 12px
  69. text-align: right
  70. float: left
  71. display: inline-block
  72. .item-equals
  73. width: 20px
  74. height: 20px
  75. margin-top: 12px
  76. text-align: center
  77. float: left
  78. display: inline-block
  79. .item-subtotal
  80. width: 100px
  81. height: 20px
  82. margin-top: 12px
  83. text-align: right
  84. font-weight: bold
  85. display: inline-block
  86. .cart-item-options-wrapper
  87. width: 100%
  88. height: 20px
  89. position: absolute
  90. bottom: 0
  91. display: flex
  92. justify-content: center
  93. .cart-item-options
  94. width: 90px
  95. height: 20px
  96. border: 1px solid #d3d3d3
  97. border-bottom: none
  98. display: flex
  99. justify-content: center
  100. .cart-item-option
  101. width: 18px
  102. height: 18px
  103. margin: 0 5px
  104. color: #666
  105. &:hover
  106. cursor: pointer
  107. &.fa
  108. padding-left: 2px
  109. line-height: 20px
  110. &.fa-plus:hover
  111. color: #2196f3
  112. &.fa-minus:hover
  113. color: #ffc107
  114. &.fa-trash:hover
  115. color: #f44336
  116. </style>