JiFen.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="积分日志" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="" style="width: 95%; margin: auto; margin-top: 20rpx">
  5. <view v-if="list.length > 0" class="item" v-for="item in list" :key="item.id">
  6. <view class="">任务:{{ item.created_at }} {{ item.memo }}</view>
  7. <view class="" style="color: #5ac725">+{{ item.score }}</view>
  8. </view>
  9. <u-empty v-else text="暂无积分日志" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. let that;
  15. export default {
  16. data() {
  17. return {
  18. page: 1,
  19. list: []
  20. };
  21. },
  22. onLoad() {
  23. that = this;
  24. this.getScoreLog();
  25. },
  26. methods: {
  27. // 积分
  28. getScoreLog() {
  29. this.$api.getScoreLog({ main_body_id: 1, page: this.page, pageSize: 20 }, function (res) {
  30. that.list = [...that.list, ...res.data];
  31. });
  32. }
  33. },
  34. /* 页面触底 */
  35. onReachBottom() {
  36. if (this.isLoading) {
  37. return;
  38. } else {
  39. this.page++;
  40. this.getScoreLog();
  41. }
  42. }
  43. };
  44. </script>
  45. <style>
  46. .box {
  47. width: 100%;
  48. padding-bottom: 50rpx;
  49. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  50. background-size: 100% 100%;
  51. background-attachment: fixed;
  52. background-repeat: repeat-y;
  53. min-height: 100%;
  54. height: auto;
  55. }
  56. .item {
  57. width: 100%;
  58. height: 80rpx;
  59. line-height: 80rpx;
  60. border-bottom: 2rpx solid #e2e2e1;
  61. display: flex;
  62. justify-content: space-between;
  63. color: #909193;
  64. }
  65. </style>