var a;
(a = getApp()),
  Page({
    data: { page: 1, is_last: !1, list: [] },
    onLoad: function (t) {
      var e = this;
      wx.setNavigationBarTitle({
        title: 1 == t.type ? "我的粉丝" : "我的关注",
      }),
        a.util.request({
          url: "entry/wxapp/Api",
          data: {

            r: "me.fans",
            uid: wx.getStorageSync("uid"),
            type: t.type,
          },
          success: function (a) {
            a.data.data && e.setData({ list: a.data.data, type: t.type });
          },
        });
    },
    follow: function (t) {
      var e = this;
      a.util.request({
        url: "entry/wxapp/Api",
        data: {

          r: "me.follow",
          uid: wx.getStorageSync("uid"),
          type: 1,
          ucar_id: t.currentTarget.dataset.id,
        },
        success: function (a) {
          var s = e.data.list;
          (s[t.currentTarget.dataset.index].is_follow = a.data.data),
            e.setData({ list: s });
        },
      });
    },
    onReachBottom: function () {
      var t = this;
      t.data.is_last ||
        (console.log(t.data.is_last),
        a.util.request({
          url: "entry/wxapp/Api",
          data: {

            r: "me.fans",
            uid: wx.getStorageSync("uid"),
            page: t.data.page + 1,
            type: t.data.type,
          },
          success: function (a) {
            a.data.data ||
              (t.setData({ is_last: !0 }),
              wx.showToast({
                title: "没有更多数据了",
                icon: "success",
                duration: 2e3,
              }));
            for (var e = t.data.list, s = 0; s < a.data.data.length; s++)
              e.push(a.data.data[s]);
            t.setData({ list: e, page: t.data.page + 1 });
          },
        }));
    },
  });
