index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view v-if="goodsList.length" class="goods-list">
  3. <view v-for="item in goodsList" :key="item.userInfo.uid" class="item">
  4. <view class="head acea-row row-middle">
  5. <image class="avatar" :src="item.userInfo.avatar || '/static/images/f.png'" mode="aspectFill"></image>
  6. <view class="name-wrap">
  7. <view class="name-inner">
  8. <view class="name line1">{{ item.userInfo.nickname }}</view>
  9. <view v-if="item.userInfo.uid == uid">(我)</view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="body">
  14. <view v-for="cell in item.goods" :key="cell.id" class="cell acea-row">
  15. <image class="image" :src="cell.productInfo.attrInfo.image" mode="aspectFill"></image>
  16. <view class="name-wrap">
  17. <view class="name line2">{{ cell.productInfo.store_name }}</view>
  18. <view class="attr line1">{{ cell.productInfo.attrInfo.suk }}</view>
  19. </view>
  20. <view class="money-wrap">
  21. <BaseMoney :money="cell.truePrice" symbolSize="20" integerSize="32" decimalSize="20" color="#333333"></BaseMoney>
  22. <view class="num">共{{ cell.cart_num }}件</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. mapGetters
  32. } from 'vuex';
  33. export default {
  34. props: {
  35. goodsList: {
  36. type: Array,
  37. default: () => {
  38. return [];
  39. }
  40. },
  41. },
  42. computed: mapGetters(['uid']),
  43. };
  44. </script>
  45. <style lang="scss" scoped>
  46. .goods-list {
  47. .item {
  48. padding: 0 24rpx;
  49. border-radius: 24rpx;
  50. margin-top: 20rpx;
  51. background: #FFFFFF;
  52. &:first-child {
  53. margin-top: 0;
  54. }
  55. .head {
  56. height: 108rpx;
  57. border-bottom: 1rpx solid #F5F5F5;
  58. transform: rotateZ(360deg);
  59. font-size: 26rpx;
  60. color: #333333;
  61. .name-wrap {
  62. flex: 1;
  63. min-width: 0;
  64. padding-left: 20rpx;
  65. }
  66. .name-inner {
  67. display: inline-flex;
  68. align-items: center;
  69. max-width: 100%;
  70. }
  71. .name {
  72. flex: 1;
  73. min-width: 0;
  74. }
  75. }
  76. .avatar {
  77. width: 40rpx;
  78. height: 40rpx;
  79. border-radius: 50%;
  80. }
  81. .body {
  82. padding: 32rpx 0;
  83. .cell {
  84. margin-top: 32rpx;
  85. &:first-child {
  86. margin-top: 0;
  87. }
  88. .name-wrap {
  89. flex: 1;
  90. min-width: 0;
  91. padding: 0 20rpx;
  92. }
  93. .name {
  94. font-size: 28rpx;
  95. line-height: 40rpx;
  96. color: #333333;
  97. }
  98. .attr {
  99. margin-top: 12rpx;
  100. font-size: 24rpx;
  101. line-height: 34rpx;
  102. color: #999999;
  103. }
  104. }
  105. .image {
  106. width: 136rpx;
  107. height: 136rpx;
  108. border-radius: 16rpx;
  109. }
  110. .money-wrap {
  111. text-align: right;
  112. }
  113. .num {
  114. margin-top: 10rpx;
  115. font-size: 24rpx;
  116. line-height: 34rpx;
  117. color: #999999;
  118. }
  119. }
  120. }
  121. }
  122. </style>