|
@@ -4,23 +4,19 @@ if (!Array) {
|
|
|
const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
|
|
|
const _easycom_up_notice_bar2 = common_vendor.resolveComponent("up-notice-bar");
|
|
|
const _easycom_up_tabs2 = common_vendor.resolveComponent("up-tabs");
|
|
|
- const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
|
|
|
- const _easycom_up_cell2 = common_vendor.resolveComponent("up-cell");
|
|
|
const _easycom_up_list_item2 = common_vendor.resolveComponent("up-list-item");
|
|
|
const _easycom_up_list2 = common_vendor.resolveComponent("up-list");
|
|
|
const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay");
|
|
|
- (_easycom_u_swiper2 + _easycom_up_notice_bar2 + _easycom_up_tabs2 + _easycom_up_avatar2 + _easycom_up_cell2 + _easycom_up_list_item2 + _easycom_up_list2 + _easycom_up_overlay2)();
|
|
|
+ (_easycom_u_swiper2 + _easycom_up_notice_bar2 + _easycom_up_tabs2 + _easycom_up_list_item2 + _easycom_up_list2 + _easycom_up_overlay2)();
|
|
|
}
|
|
|
const _easycom_u_swiper = () => "../../node-modules/uview-plus/components/u-swiper/u-swiper.js";
|
|
|
const _easycom_up_notice_bar = () => "../../node-modules/uview-plus/components/u-notice-bar/u-notice-bar.js";
|
|
|
const _easycom_up_tabs = () => "../../node-modules/uview-plus/components/u-tabs/u-tabs.js";
|
|
|
-const _easycom_up_avatar = () => "../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
|
|
|
-const _easycom_up_cell = () => "../../node-modules/uview-plus/components/u-cell/u-cell.js";
|
|
|
const _easycom_up_list_item = () => "../../node-modules/uview-plus/components/u-list-item/u-list-item.js";
|
|
|
const _easycom_up_list = () => "../../node-modules/uview-plus/components/u-list/u-list.js";
|
|
|
const _easycom_up_overlay = () => "../../node-modules/uview-plus/components/u-overlay/u-overlay.js";
|
|
|
if (!Math) {
|
|
|
- (_easycom_u_swiper + _easycom_up_notice_bar + _easycom_up_tabs + _easycom_up_avatar + _easycom_up_cell + _easycom_up_list_item + _easycom_up_list + login + _easycom_up_overlay)();
|
|
|
+ (_easycom_u_swiper + _easycom_up_notice_bar + _easycom_up_tabs + _easycom_up_list_item + _easycom_up_list + login + _easycom_up_overlay)();
|
|
|
}
|
|
|
const login = () => "../../components/login.js";
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
@@ -36,7 +32,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
]);
|
|
|
const config = common_vendor.ref({ icon: [], logo: [], file: [] });
|
|
|
const list = common_vendor.ref([]);
|
|
|
- common_vendor.ref(0);
|
|
|
+ const total = common_vendor.ref(0);
|
|
|
+ const skip = common_vendor.ref(0);
|
|
|
+ const limit = common_vendor.ref(5);
|
|
|
+ const page = common_vendor.ref(0);
|
|
|
+ const is_bottom = common_vendor.ref(false);
|
|
|
const subjectList = common_vendor.ref([]);
|
|
|
const show = common_vendor.ref(false);
|
|
|
const user = common_vendor.computed(() => {
|
|
@@ -45,33 +45,16 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
common_vendor.onShow(async () => {
|
|
|
await searchConfig();
|
|
|
await searchOther();
|
|
|
+ await clearPage();
|
|
|
await search();
|
|
|
if (!user.value)
|
|
|
show.value = true;
|
|
|
- loadmore();
|
|
|
});
|
|
|
- const urls = [
|
|
|
- "https://cdn.uviewui.com/uview/album/1.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/2.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/3.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/4.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/5.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/6.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/7.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/8.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/9.jpg",
|
|
|
- "https://cdn.uviewui.com/uview/album/10.jpg"
|
|
|
- ];
|
|
|
- const scrolltolower = () => {
|
|
|
- loadmore();
|
|
|
- };
|
|
|
- const loadmore = () => {
|
|
|
- for (let i = 0; i < 30; i++) {
|
|
|
- list.value.push({
|
|
|
- url: urls[common_vendor.index.$u.random(0, urls.length - 1)]
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
+ common_vendor.onPullDownRefresh(async () => {
|
|
|
+ await clearPage();
|
|
|
+ await search();
|
|
|
+ common_vendor.index.stopPullDownRefresh();
|
|
|
+ });
|
|
|
const searchConfig = async () => {
|
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
|
};
|
|
@@ -80,8 +63,25 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
res = await $api(`dictData`, "GET", { code: "subject", is_use: "0" });
|
|
|
if (res.errcode === 0)
|
|
|
subjectList.value = res.data;
|
|
|
+ subjectList.value.unshift({ label: "全部", value: "-1", is_show: true });
|
|
|
};
|
|
|
const search = async () => {
|
|
|
+ const info = {
|
|
|
+ skip: skip.value,
|
|
|
+ limit: limit.value,
|
|
|
+ status: "1",
|
|
|
+ is_show: "0"
|
|
|
+ };
|
|
|
+ const res = await $api("teacher", "GET", info);
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ list.value = list.value.concat(res.data);
|
|
|
+ total.value = res.total;
|
|
|
+ } else {
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: res.errmsg || "",
|
|
|
+ icon: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
const toTab = async (data) => {
|
|
|
console.log(data);
|
|
@@ -89,6 +89,25 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
const showChange = () => {
|
|
|
show.value = false;
|
|
|
};
|
|
|
+ const scrolltolower = () => {
|
|
|
+ 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 clearPage = () => {
|
|
|
+ list.value = [];
|
|
|
+ skip.value = 0;
|
|
|
+ limit.value = 6;
|
|
|
+ page.value = 0;
|
|
|
+ };
|
|
|
return (_ctx, _cache) => {
|
|
|
return common_vendor.e({
|
|
|
a: common_vendor.p({
|
|
@@ -120,19 +139,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
}),
|
|
|
g: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
return {
|
|
|
- a: "4978fed5-6-" + i0 + "," + ("4978fed5-5-" + i0),
|
|
|
- b: common_vendor.p({
|
|
|
- shape: "square",
|
|
|
- size: "35",
|
|
|
- src: item.url,
|
|
|
- customStyle: "margin: -3px 5px -3px 0"
|
|
|
- }),
|
|
|
- c: "4978fed5-5-" + i0 + "," + ("4978fed5-4-" + i0),
|
|
|
- d: common_vendor.p({
|
|
|
- title: `列表长度-${index + 1}`
|
|
|
- }),
|
|
|
- e: index,
|
|
|
- f: "4978fed5-4-" + i0 + ",4978fed5-3"
|
|
|
+ a: common_vendor.t(item.nick_name),
|
|
|
+ b: index,
|
|
|
+ c: "4978fed5-4-" + i0 + ",4978fed5-3"
|
|
|
};
|
|
|
}),
|
|
|
h: common_vendor.o(scrolltolower),
|