BuyLogs.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view class="rigth-view">
  3. <scroll-view scroll-y="true" class="rigth-scroll" @scrolltolower="moreGoods">
  4. <view class="goods-li" v-for="(item, index) in buy_logs" :key="index">
  5. <view class="goods-main clearfix">
  6. <image class="goods-img float_left" :src="item.goodsImages" mode="aspectFill"></image>
  7. <view class="goods-info float_left ">
  8. <view class="goods-name ellipsis">{{ item.goodsName }}</view>
  9. <view class="goods-code">购买规格:{{ item.unitName }}</view>
  10. <view class="goods-code">
  11. <view class="num-ul">
  12. <view class="num-li" style="margin-right: 32rpx;">购买价格:{{ item.price }}</view>
  13. <view class="num-li">购买数量:{{ item.buyNum }}</view>
  14. <view class="num-li price">
  15. <text style="font-weight: 300;">¥</text>
  16. <text style="font-size: 28rpx;">{{item.totalMoney}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="bottom-view clearfix">
  23. <view class="float_left ellipsis shop-name">{{ item.goodsCode }}</view>
  24. <view class="float_right time">购买时间:{{ $u.timeFormat(item.createTime, 'mm-dd hh:MM:ss') }}</view>
  25. </view>
  26. </view>
  27. <u-loadmore v-if="buy_logs.length" :status="load_status" />
  28. </scroll-view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. props: {
  34. userCenterId: {
  35. type: [Number, String],
  36. default: ''
  37. }
  38. },
  39. data() {
  40. return {
  41. load_status: 'nomore',
  42. page: 1,
  43. pageSize: 10,
  44. buy_logs: [],
  45. total: 0
  46. };
  47. },
  48. created() {
  49. this.searchCustomerBuyLog();
  50. },
  51. methods: {
  52. moreGoods() {
  53. if (this.total / this.pageSize > this.page) {
  54. this.page += 1;
  55. this.searchCustomerBuyLog();
  56. }
  57. },
  58. searchCustomerBuyLog() {
  59. this.load_status = 'loading';
  60. this.$u.api
  61. .searchCustomerBuyLog({
  62. page: this.page,
  63. pageSize: this.pageSize,
  64. userCenterId: this.userCenterId
  65. })
  66. .then(res => {
  67. if (this.page === 1) {
  68. this.buy_logs = res.data;
  69. } else {
  70. this.buy_logs = this.buy_logs.concat(res.data);
  71. }
  72. this.total = res.pageTotal;
  73. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. .rigth-view {
  81. background-color: rgb(247, 248, 250);
  82. .rigth-scroll {
  83. width: 100%;
  84. height: calc(90vh - 200rpx);
  85. .goods-li {
  86. margin: 24rpx 20rpx 0;
  87. background-color: #ffffff;
  88. border-radius: 8px;
  89. position: relative;
  90. .bottom-view {
  91. padding: 0 24rpx;
  92. line-height: 86rpx;
  93. border-top: 1px solid #ecf0f7;
  94. .shop-name {
  95. font-weight: 600;
  96. }
  97. .time {
  98. color: #b8c0c8;
  99. }
  100. }
  101. .goods-main {
  102. padding: 27rpx 0 20rpx 24rpx;
  103. .goods-img {
  104. border-radius: 14rpx;
  105. width: 126rpx;
  106. height: 126rpx;
  107. margin-right: 16rpx;
  108. }
  109. .goods-info {
  110. width: 530rpx;
  111. .goods-name {
  112. color: #2d405e;
  113. font-size: 30rpx;
  114. font-weight: 600;
  115. }
  116. .goods-code {
  117. margin-top: 8rpx;
  118. width: 100%;
  119. font-size: 22rpx;
  120. font-family: DINPro-Regular;
  121. font-weight: 400;
  122. color: #62738e;
  123. }
  124. .goods-tag {
  125. padding: 10rpx 0;
  126. .tag-li {
  127. margin-right: 14rpx;
  128. }
  129. }
  130. .goods-num {
  131. color: #999999;
  132. font-size: 22rpx;
  133. text {
  134. padding-right: 10rpx;
  135. }
  136. }
  137. }
  138. }
  139. .num-ul {
  140. .num-li {
  141. float: left;
  142. &.price{
  143. font-weight: 600;
  144. float: right;
  145. color: #FA6400;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. // .log-scroll {
  153. // height: 100vh;
  154. // }
  155. // .logs-ul {
  156. // .logs-li {
  157. // padding: 20rpx 0;
  158. // border-bottom: 1px solid #eeeeee;
  159. // .goods-img {
  160. // position: relative;
  161. // width: 100rpx;
  162. // height: 100rpx;
  163. // border-radius: 20rpx;
  164. // overflow: hidden;
  165. // margin-right: 20rpx;
  166. // image {
  167. // width: 100%;
  168. // height: 100%;
  169. // display: block;
  170. // }
  171. // }
  172. // .goods-info {
  173. // width: 460rpx;
  174. // .date-time {
  175. // font-size: 22rpx;
  176. // }
  177. // .other-info {
  178. // padding-top: 10rpx;
  179. // display: flex;
  180. // flex-wrap: wrap;
  181. // font-size: 22rpx;
  182. // .info-li {
  183. // width: 50%;
  184. // display: inline-block;
  185. // color: #6c6c6c;
  186. // }
  187. // }
  188. // }
  189. // .float_right {
  190. // .look-btn {
  191. // font-size: 20rpx;
  192. // width: 118rpx;
  193. // line-height: 40rpx;
  194. // height: 40rpx;
  195. // text-align: center;
  196. // color: #ffffff;
  197. // background-color: $uni-color-primary;
  198. // border-radius: 6rpx;
  199. // margin: 20rpx auto;
  200. // }
  201. // }
  202. // }
  203. // }
  204. </style>