list.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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="https://xiansin.oss-cn-shenzhen.aliyuncs.com/sange-bridge/images/sample.jpg"
  11. shape="circle"></u-image>
  12. </view>
  13. <view class="nickname dir-top-wrap main-center">
  14. <view class="title main-left cross-center">
  15. <text>{{item.nickname}}</text>
  16. <u-image
  17. width="35"
  18. height="35"
  19. src="@/static/images/vip.png"
  20. v-if="item.is_vip"
  21. ></u-image>
  22. </view>
  23. <view class="sub-title">
  24. 绑定时间:{{item.become_child_at}}
  25. </view>
  26. </view>
  27. </view>
  28. <u-line></u-line>
  29. </template>
  30. </view>
  31. </app-layout>
  32. </template>
  33. <script>
  34. import appLayout from "@/components/app-layout"
  35. export default {
  36. components:{
  37. appLayout,
  38. },
  39. data() {
  40. return {
  41. lists: [],
  42. currentPage: 1,
  43. totalPage: 0
  44. }
  45. },
  46. methods: {
  47. getList(page){
  48. this.$u.api.userShares(page).then(res => {
  49. this.currentPage = res.current_page
  50. this.totalPage = res.last_page
  51. this.lists = this.lists.concat(res.data);
  52. })
  53. }
  54. },
  55. onLoad(){
  56. this.getList();
  57. },
  58. onReachBottom(){
  59. if(this.currentPage < this.totalPage){
  60. this.getList(this.currentPage+1)
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .cell-box{
  67. padding: 30rpx 0;
  68. .head-img{}
  69. .nickname{
  70. flex: 1;
  71. padding: 0 30rpx;
  72. color: #333333;
  73. font-size: 32rpx;
  74. font-weight: 500;
  75. .title{
  76. text{
  77. margin-right: 12rpx;
  78. }
  79. }
  80. .sub-title{
  81. color: #666666;
  82. font-size: 28rpx;
  83. line-height: 2em;
  84. }
  85. }
  86. }
  87. </style>