index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <app-layout>
  3. <view class="container">
  4. <template v-for="(item,index) in lists">
  5. <view class="cell-box main-left" :key="index">
  6. <view class="head-img">
  7. <u-image
  8. width="140"
  9. height="140"
  10. :src="item.child.head_img"
  11. shape="circle"></u-image>
  12. </view>
  13. <view class="nickname main-left cross-center">
  14. <text>{{item.child.nickname}}</text>
  15. <u-image
  16. width="35"
  17. height="35"
  18. src="@/static/images/vip.png"
  19. v-if="item.child.is_vip"
  20. ></u-image>
  21. </view>
  22. <view class="price main-center cross-center">
  23. 推荐奖励:<text>{{item.income}}</text>元
  24. </view>
  25. </view>
  26. <u-line></u-line>
  27. </template>
  28. </view>
  29. </app-layout>
  30. </template>
  31. <script>
  32. import appLayout from "@/components/app-layout"
  33. export default {
  34. components:{
  35. appLayout,
  36. },
  37. data() {
  38. return {
  39. lists: [],
  40. currentPage: 1,
  41. totalPage: 0
  42. }
  43. },
  44. methods: {
  45. getList(page){
  46. this.$u.api.userIncome(page).then(res => {
  47. this.currentPage = res.current_page
  48. this.totalPage = res.last_page
  49. this.lists = this.lists.concat(res.data);
  50. })
  51. }
  52. },
  53. onLoad(){
  54. this.getList();
  55. },
  56. onReachBottom(){
  57. if(this.currentPage < this.totalPage){
  58. this.getList(this.currentPage+1)
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .cell-box{
  65. padding: 30rpx 0;
  66. .head-img{}
  67. .nickname{
  68. flex: 1;
  69. padding: 0 30rpx;
  70. color: #333333;
  71. font-size: 32rpx;
  72. font-weight: 500;
  73. text{
  74. margin-right: 12rpx;
  75. }
  76. }
  77. .price{
  78. color: #666666;
  79. font-size: 28rpx;
  80. }
  81. }
  82. </style>