myIncome.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view>
  3. <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  4. :up="upOption">
  5. <view class="card" v-for="(item,index) in list" :key="index">
  6. <view class="top">
  7. <view class="center">
  8. <image class="avatar" :src="item.avatar" mode=""></image>
  9. <text class="nickname">{{item.nickName}}</text>
  10. </view>
  11. <view class="center">
  12. <text class="time">{{item.createTime}}</text>
  13. </view>
  14. </view>
  15. <view class="bottom">
  16. <text class="name">{{item.shopName}}</text>
  17. <view class="data">
  18. <text class="margin-right-10">+</text>
  19. <text class="text-price" style="font-size: 36rpx;">{{item.fee}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </mescroll-body>
  24. </view>
  25. </template>
  26. <script>
  27. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  28. export default {
  29. mixins: [MescrollMixin],
  30. data() {
  31. return {
  32. list: [],
  33. downOption:{
  34. auto:false
  35. },
  36. }
  37. },
  38. onLoad() {
  39. },
  40. methods: {
  41. downCallback() {
  42. setTimeout(() => {
  43. uni.showToast({
  44. title: "刷新成功",
  45. icon: "none"
  46. })
  47. this.mescroll.resetUpScroll();
  48. }, 1000)
  49. },
  50. upCallback(mescroll) {
  51. let params = {
  52. agenter:this.vuex_userId,
  53. current:mescroll.num,
  54. size:mescroll.size,
  55. }
  56. try {
  57. this.$api.agenter.earningsDetail(params).then(res => {
  58. let data = res.data.records
  59. let total = res.data.total
  60. mescroll.endBySize(data.length, total);
  61. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  62. this.list = this.list.concat(data); //追加新数据
  63. })
  64. } catch (e) {
  65. this.mescroll.endErr()
  66. }
  67. },
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. .card{
  73. padding: 20rpx 40rpx;
  74. margin: 20rpx;
  75. background-color: #FFFFFF;
  76. border-radius: 12rpx;
  77. display: flex;
  78. flex-direction: column;
  79. justify-content: space-between;
  80. height: 170rpx;
  81. .top{
  82. display: flex;
  83. justify-content: space-between;
  84. font-size: 26rpx;
  85. border-bottom: 1rps solid #EEEEEE;
  86. .avatar{
  87. width: 50rpx;
  88. height: 50rpx;
  89. border-radius: 50%;
  90. }
  91. .nickname{
  92. color: #666666;
  93. margin-left: 10rpx;
  94. }
  95. .time{
  96. color: #666666;
  97. }
  98. }
  99. .bottom{
  100. display: flex;
  101. justify-content: space-between;
  102. .name{
  103. color: #252525;
  104. font-size: 32rpx;
  105. font-weight: 800;
  106. }
  107. .data{
  108. font-size: 36rpx;
  109. font-weight: 800;
  110. color: #EF9944;
  111. }
  112. }
  113. }
  114. </style>