pointsDetail.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view>
  3. <view class="bg-img flex justify-center align-center" style="background-image: url('/static/bgimg.png');height: 310upx;">
  4. <view class="text-center" style="margin-top: 80upx;">
  5. <view style="font-size: 24upx;font-family: PingFang SC;font-weight: 400;color: #cfc8f9;">可用积分</view>
  6. <view style="font-size: 54upx;font-family: PingFang SC;font-weight: 800;color: #ffffff;">205</view>
  7. </view>
  8. </view>
  9. <block v-for="(item, index) in pointsList" :key="index">
  10. <view class="flex justify-between align-center container">
  11. <view class="padding">
  12. <view class="type">{{item.note}}</view>
  13. <view class="time">{{item.createTime}}</view>
  14. </view>
  15. <view class="padding">
  16. <view class="points">{{item.pointsValue}} 积分</view>
  17. </view>
  18. </view>
  19. </block>
  20. <view style="height: 80rpx;" v-if="status">
  21. <u-divider bgColor="#f1f1f1;" height="80">到底了</u-divider>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. userId: '',
  30. pointsList: [],
  31. current: 1,
  32. size: 30,
  33. status: false,
  34. }
  35. },
  36. onLoad(options) {
  37. this.
  38. this.userId = uni.getStorageSync("userId");
  39. this.getPointsDetail();
  40. },
  41. onReachBottom() {
  42. if (this.pointsList.length < this.current * this.size) {
  43. this.status = true;
  44. } else {
  45. this.current += 1;
  46. this.getPointsDetail();
  47. }
  48. },
  49. methods: {
  50. getPointsDetail() {
  51. this.$u.api.points.list({id: this.userId, current: this.current, size: this.size}).then(res => {
  52. this.pointsList = [...this.pointsList,...res.records];
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style>
  59. .container {
  60. background-color: #FFFFFF;
  61. border-radius: 10upx;
  62. margin: 20upx;
  63. }
  64. .type {
  65. font-size: 32upx;
  66. font-family: PingFang SC;
  67. font-weight: bold;
  68. margin-bottom: 20upx;
  69. color: #111111;
  70. }
  71. .time {
  72. font-size: 24upx;
  73. font-family: PingFang SC;
  74. font-weight: bold;
  75. color: #9E9E9E;
  76. }
  77. .points {
  78. font-size: 28upx;
  79. font-family: PingFang SC;
  80. font-weight: bold;
  81. color: #111111;
  82. }
  83. </style>