records.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view>
  3. <!-- 开盒记录start -->
  4. <view class="record-view">
  5. <view class="record-list-view">
  6. <view class="record-item flex" v-for="(item, index) in vgoods" :key="index">
  7. <view class="goods-img-view">
  8. <image :src="item.image" mode="aspectFit"></image>
  9. </view>
  10. <view class="record-item-right">
  11. <view class="goods-name-view flex">
  12. <text class="username">{{item.username}}</text>
  13. <text class="txt">开出了</text>
  14. <text class="goods-name">{{item.goods_name}}</text>
  15. </view>
  16. <view class="goods-price-view">
  17. 参考价 ¥{{item.price}}
  18. </view>
  19. <view class="goods-time-view">
  20. 开盒时间:{{item.createtime}}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 开盒记录end -->
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. vgoods: [],
  34. param:{
  35. page:1,
  36. limit:10
  37. },
  38. is_bottom:false
  39. }
  40. },
  41. onLoad () {
  42. this.getVgoods()
  43. },
  44. methods: {
  45. getVgoods(){
  46. this.$api.getVgoods(this.param).then(res=>{
  47. if (res.code === 1) {
  48. if(res.data.list.length < this.param.limit) this.is_bottom = true;
  49. this.vgoods = res.data.list
  50. }
  51. })
  52. },
  53. },
  54. onReachBottom () {
  55. if (!this.is_bottom) {
  56. this.param.page++
  57. this.getVgoods()
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .record-view {
  64. padding: 40rpx 0;
  65. .title {
  66. padding: 0 30rpx;
  67. margin: 30rpx 0 22rpx;
  68. .title-left {
  69. font-size: 34rpx;
  70. font-family: PingFangSC-Medium, PingFang SC;
  71. font-weight: 500;
  72. color: #171A20;
  73. line-height: 48rpx;
  74. }
  75. .title-right {
  76. font-size: 24rpx;
  77. font-family: PingFangSC-Regular, PingFang SC;
  78. font-weight: 400;
  79. color: #7A808D;
  80. line-height: 34rpx;
  81. .rule-box {
  82. width: 24rpx;
  83. height: 24rpx;
  84. margin-left: 6rpx;
  85. }
  86. }
  87. }
  88. .record-list-view {
  89. .record-item {
  90. margin: 0rpx auto 20rpx;
  91. width: 690rpx;
  92. height: 180rpx;
  93. background: #FFFFFF;
  94. border-radius: 16rpx;
  95. padding: 12rpx 0 10rpx 18rpx;
  96. .goods-img-view {
  97. width: 158rpx;
  98. height: 158rpx;
  99. }
  100. .record-item-right {
  101. flex: 1;
  102. margin-left: 22rpx;
  103. line-height: 42rpx;
  104. .goods-name-view {
  105. justify-content: flex-start;
  106. font-size: 24rpx;
  107. font-family: PingFangSC-Medium, PingFang SC;
  108. font-weight: 500;
  109. color: #171A20;
  110. .username, .goods-name {
  111. color: #0091FF;
  112. }
  113. .goods-name {
  114. display: inline-block;
  115. width: 200rpx;
  116. overflow: hidden;
  117. text-overflow:ellipsis;
  118. white-space: nowrap;
  119. }
  120. .txt {
  121. display: inline-block;
  122. margin: 0 8rpx;
  123. }
  124. }
  125. .goods-price-view {
  126. font-size: 24rpx;
  127. font-family: PingFangSC-Regular, PingFang SC;
  128. font-weight: 400;
  129. color: #FF495D;
  130. }
  131. .goods-time-view {
  132. font-size: 24rpx;
  133. font-family: PingFangSC-Regular, PingFang SC;
  134. font-weight: 400;
  135. color: #7A808D;
  136. }
  137. }
  138. }
  139. }
  140. }
  141. </style>