cart.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view>
  3. <navigation-bar title="购物车" background-color="#0081ff" front-color="#ffffff" :left-button="null" />
  4. <u-tabs lineWidth="50" :list="list" itemStyle="height:90rpx;width: 100rpx;" :is-scroll="false"
  5. :current="current" @change="change"></u-tabs>
  6. <u-list style="margin-top: 10rpx;padding: 15rpx;" @scrolltolower="scrolltolower">
  7. <u-list-item v-for="(item, index) in cartList" :key="index">
  8. <view class="item-box">
  9. <view class="goods-item">
  10. <view class="good-row">
  11. <view>
  12. <view class="shop">
  13. <view class="shop-icon">
  14. <uni-icons type="shop" color="#0081ff" size="26"></uni-icons>
  15. </view>
  16. <text style="font-size: 35rpx; margin-left: 8rpx;">{{item.goodsName}}</text>
  17. </view>
  18. </view>
  19. <view class="status">
  20. <uni-icons type="trash" color="red" size="30"></uni-icons>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="goods-item">
  25. <view class="good-row">
  26. <view>
  27. <u--image radius="10" :showLoading="true" :src="item.goodsImg" width="250rpx"
  28. height="210rpx"></u--image>
  29. </view>
  30. <view class="des">
  31. <view style="font-size: 34rpx; height: 100rpx;">{{item.goodsName}}</view>
  32. <!-- <view style="font-size: 34rpx;">[老板力荐]鲜活小龙虾(帮剪头去虾线)约250g/份</view> -->
  33. <view class="subtit">
  34. <view class="price">¥{{item.totalPrice}}</view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="goods-item">
  40. <view class="footer-item">
  41. <view style="margin: 15rpx 0rpx;"><button size="mini"
  42. :plain="true">立即购买</button></view>
  43. </view>
  44. </view>
  45. </view>
  46. </u-list-item>
  47. </u-list>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. cartList: [],
  55. }
  56. },
  57. onLoad() {
  58. this.getCartList()
  59. },
  60. methods: {
  61. getCartList() {
  62. this.http.request({
  63. url: '/level-one-server/TbGoodsCart/getList',
  64. success: res => {
  65. this.cartList = res.data.data;
  66. }
  67. });
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss">
  73. .goods-item {
  74. margin-bottom: 15rpx;
  75. }
  76. .good-row {
  77. display: flex;
  78. align-items: center;
  79. }
  80. .shop {
  81. display: flex;
  82. align-items: center;
  83. width: 480rpx;
  84. }
  85. .shop-icon {
  86. width: 60rpx;
  87. height: 60rpx;
  88. border-radius: 30rpx;
  89. background-color: #eaf1fe;
  90. display: flex;
  91. align-items: center;
  92. justify-content: center;
  93. }
  94. .status {
  95. width: 200rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: flex-end;
  99. }
  100. .des {
  101. margin-left: 20rpx;
  102. position: relative;
  103. top: 1rpx;
  104. height: 200rpx;
  105. }
  106. .subtit {
  107. font-size: 28rpx;
  108. color: #9C9C9C;
  109. margin: 20rpx 10rpx;
  110. }
  111. .footer-item {
  112. display: flex;
  113. justify-content: flex-end;
  114. margin-top: -15rpx;
  115. margin-bottom: 5rpx;
  116. }
  117. .price {
  118. font-size: 30rpx;
  119. }
  120. .item-box {
  121. height: 370rpx;
  122. width: 85%;
  123. padding: 30rpx;
  124. border: 1rpx #888 solid;
  125. margin: 10rpx 15rpx;
  126. border-radius: 10rpx;
  127. }
  128. </style>