index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view v-if="goodsList.length" class="goods-list">
  3. <view v-for="item in goodsList" class="item">
  4. <view class="head">
  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">{{ 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">
  15. <image class="image" :src="cell.productInfo.attrInfo.image" mode="aspectFill"></image>
  16. <view class="name-wrap">
  17. <view class="name">{{ cell.productInfo.store_name }}</view>
  18. <view class="attr">{{ cell.productInfo.attrInfo.suk }}</view>
  19. <view class="money">¥{{ cell.truePrice }}</view>
  20. </view>
  21. <view class="">x {{ cell.cart_num }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapGetters
  30. } from 'vuex';
  31. export default {
  32. props: {
  33. goodsList: {
  34. type: Array,
  35. default: () => {
  36. return [];
  37. }
  38. },
  39. },
  40. computed: mapGetters(['uid']),
  41. };
  42. </script>
  43. <style lang="scss" scoped>
  44. .goods-list {
  45. .item {
  46. border-radius: 14rpx;
  47. background-color: #FFFFFF;
  48. +.item {
  49. margin-top: 20rpx;
  50. }
  51. .head {
  52. display: flex;
  53. align-items: center;
  54. height: 86rpx;
  55. padding: 0 26rpx;
  56. border-bottom: 1rpx solid #F0F0F0;
  57. font-size: 26rpx;
  58. color: #333333;
  59. .name-wrap {
  60. flex: 1;
  61. min-width: 0;
  62. margin-left: 20rpx;
  63. }
  64. .name-inner {
  65. display: inline-flex;
  66. align-items: center;
  67. max-width: 100%;
  68. }
  69. .name {
  70. flex: 1;
  71. min-width: 0;
  72. overflow: hidden;
  73. white-space: nowrap;
  74. text-overflow: ellipsis;
  75. }
  76. }
  77. .avatar {
  78. display: block;
  79. width: 40rpx;
  80. height: 40rpx;
  81. border-radius: 50%;
  82. }
  83. .body {
  84. padding-left: 24rpx;
  85. .cell {
  86. display: flex;
  87. padding: 24rpx 26rpx 26rpx 0;
  88. font-size: 26rpx;
  89. line-height: 40rpx;
  90. color: #999999;
  91. +.cell {
  92. border-top: 1rpx solid #EEEEEE;
  93. }
  94. .name-wrap {
  95. flex: 1;
  96. min-width: 0;
  97. margin: 0 20rpx;
  98. }
  99. .name {
  100. overflow: hidden;
  101. white-space: nowrap;
  102. text-overflow: ellipsis;
  103. font-size: 28rpx;
  104. line-height: 40rpx;
  105. color: #333333;
  106. }
  107. .attr {
  108. margin-top: 8rpx;
  109. font-size: 20rpx;
  110. line-height: 28rpx;
  111. }
  112. .money {
  113. margin-top: 14rpx;
  114. line-height: 36rpx;
  115. color: #E93323;
  116. }
  117. }
  118. .image {
  119. display: block;
  120. width: 130rpx;
  121. height: 130rpx;
  122. border-radius: 6rpx;
  123. }
  124. }
  125. }
  126. }
  127. </style>