|
@@ -3,15 +3,83 @@ const common_vendor = require("../../../common/vendor.js");
|
|
|
const _sfc_main = common_vendor.defineComponent({
|
|
|
__name: "activity",
|
|
|
setup(__props) {
|
|
|
- const config = common_vendor.ref({});
|
|
|
+ const config = common_vendor.ref({ bottomTitle: "", logoUrl: "" });
|
|
|
+ const searchInfo = common_vendor.ref({ name: "" });
|
|
|
+ const list = common_vendor.ref([{ name: "测试球队" }, { name: "肝帝集团队" }]);
|
|
|
+ const skip = common_vendor.ref(0);
|
|
|
+ const limit = common_vendor.ref(6);
|
|
|
+ const page = common_vendor.ref(0);
|
|
|
+ const total = common_vendor.ref(0);
|
|
|
+ const scrollTop = common_vendor.ref(0);
|
|
|
+ const is_bottom = common_vendor.ref(false);
|
|
|
common_vendor.onShow(() => {
|
|
|
searchConfig();
|
|
|
+ search();
|
|
|
});
|
|
|
const searchConfig = async () => {
|
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
|
};
|
|
|
+ const search = async () => {
|
|
|
+ console.log("查询");
|
|
|
+ };
|
|
|
+ const toInput = (e) => {
|
|
|
+ if (searchInfo.value.name)
|
|
|
+ searchInfo.value.name = e.detail.value;
|
|
|
+ searchInfo.value = { name: "" };
|
|
|
+ clearPage();
|
|
|
+ search();
|
|
|
+ };
|
|
|
+ const toInfo = (item) => {
|
|
|
+ console.log(item);
|
|
|
+ };
|
|
|
+ const toPage = () => {
|
|
|
+ if (total.value > list.value.length) {
|
|
|
+ common_vendor.index.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ page.value = page.value + 1;
|
|
|
+ skip.value = page.value * limit.value;
|
|
|
+ search();
|
|
|
+ common_vendor.index.hideLoading();
|
|
|
+ } else
|
|
|
+ is_bottom.value = true;
|
|
|
+ };
|
|
|
+ const toScroll = (e) => {
|
|
|
+ let up = scrollTop.value;
|
|
|
+ scrollTop.value = e.detail.scrollTop;
|
|
|
+ let num = Math.sign(up - e.detail.scrollTop);
|
|
|
+ if (num == 1)
|
|
|
+ is_bottom.value = false;
|
|
|
+ };
|
|
|
+ const clearPage = () => {
|
|
|
+ list.value = [];
|
|
|
+ skip.value = 0;
|
|
|
+ limit.value = 6;
|
|
|
+ page.value = 0;
|
|
|
+ };
|
|
|
return (_ctx, _cache) => {
|
|
|
- return {};
|
|
|
+ return common_vendor.e({
|
|
|
+ a: common_vendor.o([($event) => searchInfo.value.name = $event.detail.value, toInput]),
|
|
|
+ b: searchInfo.value.name,
|
|
|
+ c: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
+ return {
|
|
|
+ a: item.logo || config.value.logoUrl,
|
|
|
+ b: common_vendor.t(item.name || "暂无名称"),
|
|
|
+ c: common_vendor.t(item.label || "成员"),
|
|
|
+ d: common_vendor.n(item.user_type == "0" ? "label_1" : "label_2"),
|
|
|
+ e: common_vendor.t(item.activity || "暂无活动"),
|
|
|
+ f: index,
|
|
|
+ g: common_vendor.o(($event) => toInfo(item), index)
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ d: is_bottom.value
|
|
|
+ }, is_bottom.value ? {
|
|
|
+ e: common_vendor.t(config.value.bottomTitle || "到底了!")
|
|
|
+ } : {}, {
|
|
|
+ f: common_vendor.o(toPage),
|
|
|
+ g: common_vendor.o(toScroll)
|
|
|
+ });
|
|
|
};
|
|
|
}
|
|
|
});
|