cart.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="cart-con" :style="{maxHeight:active?'100%':'0'}">
  3. <component :is="cp.type" :sku="cp.sku" @backList="cp.type='list'" :fromList='cp.fromList' @toPay="handlePay"></component>
  4. </div>
  5. </template>
  6. <script>
  7. import list from './ctemp/list'
  8. import detail from './ctemp/detail'
  9. export default {
  10. props: ['active', 'cp'],
  11. data () {
  12. return {
  13. sku: ''
  14. }
  15. },
  16. methods: {
  17. handlePay (data) {
  18. this.cp.fromList = true
  19. this.cp.sku = data
  20. this.cp.type = 'detail'
  21. }
  22. },
  23. mounted () {
  24. },
  25. components: {
  26. list,
  27. detail
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .c-button {
  33. height: 50px;
  34. padding-top: 0;
  35. padding-bottom: 0;
  36. vertical-align: middle;
  37. margin-top: 10px;
  38. display: inline-block;
  39. background-color: #1fe4dc;
  40. text-align: center;
  41. cursor: pointer;
  42. &:first-child {
  43. width: 50px;
  44. box-sizing: border-box;
  45. }
  46. &:last-child {
  47. width: 150px;
  48. line-height: 50px;
  49. color: #000;
  50. font-size: 14px;
  51. }
  52. }
  53. .cart-con {
  54. $animateType: cubic-bezier(0.77, 0, 0.175, 1);
  55. width: 730px;
  56. position: fixed;
  57. right: 0;
  58. height: 100%;
  59. transition: max-height 0.7s $animateType;
  60. max-height: 100%;
  61. background: #fff;
  62. z-index: 99999;
  63. top: 0;
  64. overflow: hidden;
  65. .cart {
  66. color: #000;
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. padding: 0 30px;
  71. font-size: 16px;
  72. .c-title {
  73. height: 70px;
  74. line-height: 70px;
  75. }
  76. i {
  77. color: #999;
  78. cursor: pointer;
  79. }
  80. }
  81. .items {
  82. max-height:600px;
  83. overflow: auto;
  84. .item {
  85. display: flex;
  86. justify-content: space-between;
  87. align-items: center;
  88. border-top: 1px solid #e7e7e7;
  89. padding: 20px 60px;
  90. &:last-of-type {
  91. border-bottom: 1px solid #e7e7e7;
  92. }
  93. img {
  94. width: 80px;
  95. vertical-align: middle;
  96. &:last-of-type {
  97. width: 100px;
  98. margin-top: 40px;
  99. }
  100. }
  101. .iconfont {
  102. font-size: 36px;
  103. vertical-align: middle;
  104. margin: 0 20px;
  105. }
  106. .taocan {
  107. text-align: center;
  108. .numAP {
  109. margin-top: 30px;
  110. span {
  111. font-size: 16px;
  112. margin: 0 10px;
  113. }
  114. i {
  115. cursor: pointer;
  116. display: inline-block;
  117. width: 20px;
  118. height: 20px;
  119. line-height: 10px;
  120. padding: 5px;
  121. border: 1px solid #e7e7e7;
  122. }
  123. }
  124. }
  125. .jiage{
  126. .oper{
  127. margin-top: 30px;
  128. text-align: right;
  129. span{
  130. cursor: pointer;
  131. color: #a0a0a0;
  132. border-bottom: 1px solid #e7e7e7;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. .jiesuan{
  139. text-align: right;
  140. margin-top: 40px;
  141. margin-right: 60px;
  142. p{
  143. color: #a0a0a0;
  144. line-height: 36px;
  145. }
  146. .price{
  147. line-height: 40px;
  148. font-size: 24px;
  149. }
  150. }
  151. }
  152. </style>