index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <app-layout>
  3. <view class="container">
  4. <template v-if="lists.length > 0">
  5. <view class="cell-box main-left" v-for="(item,index) in lists" :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 class="no-data main-center cross-center" v-else>
  29. <text>暂无数据</text>
  30. </view>
  31. </view>
  32. </app-layout>
  33. </template>
  34. <script>
  35. import appLayout from "@/components/app-layout"
  36. export default {
  37. components:{
  38. appLayout,
  39. },
  40. data() {
  41. return {
  42. lists: [],
  43. currentPage: 1,
  44. totalPage: 0
  45. }
  46. },
  47. methods: {
  48. getList(page){
  49. this.$u.api.userIncome(page).then(res => {
  50. this.currentPage = res.current_page
  51. this.totalPage = res.last_page
  52. this.lists = this.lists.concat(res.data);
  53. })
  54. }
  55. },
  56. onLoad(){
  57. this.getList();
  58. },
  59. onReachBottom(){
  60. if(this.currentPage < this.totalPage){
  61. this.getList(this.currentPage+1)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .cell-box{
  68. padding: 30rpx 0;
  69. .head-img{}
  70. .nickname{
  71. flex: 1;
  72. padding: 0 30rpx;
  73. color: #333333;
  74. font-size: 32rpx;
  75. font-weight: 500;
  76. text{
  77. margin-right: 12rpx;
  78. }
  79. }
  80. .price{
  81. color: #666666;
  82. font-size: 28rpx;
  83. }
  84. }
  85. </style>