index.vue 2.8 KB

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