index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view>
  3. <view class="list" v-if="pageList.length>0">
  4. <view class="li ddflex" v-for="(item,index) in pageList" :key="index" @click="jumpUrl('/topics/home/home?userId='+item.uid)">
  5. <image :src="item.avatar" mode="aspectFill" class="userimg"></image>
  6. <view class="name fflex">{{item.userName}}</view>
  7. <view class="time">{{item.followDate}}</view>
  8. <image src="../../static/pages/images/more.png" class="rico"></image>
  9. </view>
  10. </view>
  11. <view class="nodata" v-else>
  12. <image :src="picUrlss+'empty_jl.png'"></image>
  13. <text>暂无记录</text>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. const app = getApp();
  19. const req = require("../../utils/request.js");
  20. const api = require("../../utils/api.js");
  21. export default {
  22. data() {
  23. return {
  24. picUrlss: req.public.picUrls,
  25. form: {
  26. page: 1,
  27. limit: 10
  28. },
  29. isLoad: true,
  30. pageList: [],
  31. };
  32. },
  33. props: {},
  34. onLoad: async function(options) {
  35. this.getPageList();
  36. },
  37. onReachBottom() {
  38. this.form.page++
  39. this.getPageList();
  40. },
  41. methods: {
  42. getPageList(){
  43. if (!this.isLoad) return false;
  44. this.isLoad = false;
  45. let form = this.form;
  46. form.behavior = 1;
  47. form.type = 11;
  48. req.getRequest(api.follow_user_list,form,data=>{
  49. if ( data && data.length >= 10) this.isLoad = true;
  50. if (this.form.page > 1) data = this.pageList.concat(data);
  51. this.pageList = data;
  52. })
  53. },
  54. jumpUrl(url){
  55. uni.navigateTo({
  56. url: url
  57. })
  58. }
  59. }
  60. };
  61. </script>
  62. <style>
  63. @import "./index.css";
  64. </style>