87 lines
2.4 KiB
JavaScript
87 lines
2.4 KiB
JavaScript
|
"use strict";
|
||
|
const common_vendor = require("../../common/vendor.js");
|
||
|
const common_js_util = require("../../common/js/util.js");
|
||
|
const api_index = require("../../api/index.js");
|
||
|
if (!Array) {
|
||
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||
|
_easycom_uni_icons2();
|
||
|
}
|
||
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||
|
if (!Math) {
|
||
|
_easycom_uni_icons();
|
||
|
}
|
||
|
const _sfc_main = {
|
||
|
__name: "newFans",
|
||
|
setup(__props) {
|
||
|
const store = common_vendor.useStore();
|
||
|
const userinfo = common_vendor.computed(() => {
|
||
|
let result = store.state.userinfo;
|
||
|
return result;
|
||
|
});
|
||
|
const userList = common_vendor.reactive({
|
||
|
data: [],
|
||
|
pageNum: 1,
|
||
|
pageSize: 10,
|
||
|
total: 0
|
||
|
});
|
||
|
common_vendor.onLoad(() => {
|
||
|
getFriendList();
|
||
|
});
|
||
|
function getFriendList() {
|
||
|
api_index.api.video.getFansList({
|
||
|
path: [userinfo.value.userId],
|
||
|
query: {
|
||
|
pageNum: userList.pageNum,
|
||
|
pageSize: userList.pageSize
|
||
|
}
|
||
|
}).then((rs) => {
|
||
|
console.log(rs);
|
||
|
if (rs.code == 200) {
|
||
|
if (userList.pageNum)
|
||
|
userList.data.length = 0;
|
||
|
userList.data.push(...rs.data.map((item) => {
|
||
|
item.format_userPortrait = common_js_util.util.format_url(item.userPortrait, "img");
|
||
|
return item;
|
||
|
}));
|
||
|
console.log(userList.data);
|
||
|
userList.total = rs.total;
|
||
|
return;
|
||
|
}
|
||
|
common_js_util.util.alert({
|
||
|
content: rs.msg,
|
||
|
showCancel: false
|
||
|
});
|
||
|
}).finally(() => {
|
||
|
common_vendor.index.stopPullDownRefresh();
|
||
|
});
|
||
|
}
|
||
|
function handleUser(item) {
|
||
|
common_vendor.index.navigateTo({
|
||
|
url: common_js_util.util.setUrl("/pages/index/videoHome", {
|
||
|
userId: item.userId
|
||
|
})
|
||
|
});
|
||
|
}
|
||
|
return (_ctx, _cache) => {
|
||
|
return {
|
||
|
a: common_vendor.f(userList.data, (item, index, i0) => {
|
||
|
return {
|
||
|
a: item.format_userPortrait,
|
||
|
b: common_vendor.t(item.userNickname),
|
||
|
c: common_vendor.t(item.createTime),
|
||
|
d: "12d494dc-0-" + i0,
|
||
|
e: index,
|
||
|
f: common_vendor.o$1(($event) => handleUser(item), index)
|
||
|
};
|
||
|
}),
|
||
|
b: common_vendor.p({
|
||
|
type: "right",
|
||
|
color: "#999",
|
||
|
size: "32rpx"
|
||
|
})
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
wx.createPage(_sfc_main);
|