You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
5.5 KiB
144 lines
5.5 KiB
7 months ago
|
"use strict";
|
||
|
const common_vendor = require("../../common/vendor.js");
|
||
|
const api_chat = require("../../api/chat.js");
|
||
|
const enums_appEnums = require("../../enums/appEnums.js");
|
||
|
const stores_app = require("../../stores/app.js");
|
||
|
require("../../utils/request/index.js");
|
||
|
require("../../utils/request/http.js");
|
||
|
require("../../enums/requestEnums.js");
|
||
|
require("../../utils/request/cancel.js");
|
||
|
require("../../stores/user.js");
|
||
|
require("../../api/user.js");
|
||
|
require("../../enums/constantEnums.js");
|
||
|
require("../../hooks/useShareMessage.js");
|
||
|
require("../../router/index.js");
|
||
|
require("../../utils/cache.js");
|
||
|
require("../../api/task.js");
|
||
|
require("../../utils/util.js");
|
||
|
require("../../stores/navigationBarTitle.js");
|
||
|
require("../../mixins/share.js");
|
||
|
require("../../utils/auth.js");
|
||
|
require("../../config/index.js");
|
||
|
require("../../api/app.js");
|
||
|
if (!Array) {
|
||
|
const _easycom_u_search2 = common_vendor.resolveComponent("u-search");
|
||
|
const _easycom_u_image2 = common_vendor.resolveComponent("u-image");
|
||
|
const _easycom_router_navigate2 = common_vendor.resolveComponent("router-navigate");
|
||
|
const _easycom_u_empty2 = common_vendor.resolveComponent("u-empty");
|
||
|
const _easycom_page_status2 = common_vendor.resolveComponent("page-status");
|
||
|
const _easycom_tabbar2 = common_vendor.resolveComponent("tabbar");
|
||
|
(_easycom_u_search2 + _easycom_u_image2 + _easycom_router_navigate2 + _easycom_u_empty2 + _easycom_page_status2 + _easycom_tabbar2)();
|
||
|
}
|
||
|
const _easycom_u_search = () => "../../uni_modules/vk-uview-ui/components/u-search/u-search.js";
|
||
|
const _easycom_u_image = () => "../../uni_modules/vk-uview-ui/components/u-image/u-image.js";
|
||
|
const _easycom_router_navigate = () => "../../node-modules/uniapp-router-next/components/router-navigate/router-navigate.js";
|
||
|
const _easycom_u_empty = () => "../../uni_modules/vk-uview-ui/components/u-empty/u-empty.js";
|
||
|
const _easycom_page_status = () => "../../components/page-status/page-status.js";
|
||
|
const _easycom_tabbar = () => "../../components/tabbar/tabbar.js";
|
||
|
if (!Math) {
|
||
|
(_easycom_u_search + _easycom_u_image + _easycom_router_navigate + _easycom_u_empty + _easycom_page_status + _easycom_tabbar)();
|
||
|
}
|
||
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||
|
__name: "skills",
|
||
|
setup(__props) {
|
||
|
const status = common_vendor.ref(enums_appEnums.PageStatusEnum.LOADING);
|
||
|
const data = common_vendor.ref([]);
|
||
|
const currentCategory = common_vendor.ref({});
|
||
|
const keyword = common_vendor.ref("");
|
||
|
const changeCategory = (item) => {
|
||
|
currentCategory.value = item;
|
||
|
};
|
||
|
const appStore = stores_app.useAppStore();
|
||
|
const getData = async () => {
|
||
|
try {
|
||
|
data.value = await api_chat.getSkillLists({
|
||
|
keyword: keyword.value
|
||
|
});
|
||
|
const categoryAll = {
|
||
|
id: 0,
|
||
|
name: "全部",
|
||
|
skill: data.value.reduce((prev, current) => {
|
||
|
return prev.concat(current.skill);
|
||
|
}, [])
|
||
|
};
|
||
|
currentCategory.value = categoryAll;
|
||
|
data.value.unshift(categoryAll);
|
||
|
status.value = enums_appEnums.PageStatusEnum.NORMAL;
|
||
|
} catch (error) {
|
||
|
status.value = enums_appEnums.PageStatusEnum.ERROR;
|
||
|
}
|
||
|
};
|
||
|
common_vendor.onLoad(() => {
|
||
|
getData();
|
||
|
});
|
||
|
common_vendor.onShow(() => {
|
||
|
appStore.getConfig();
|
||
|
});
|
||
|
common_vendor.onPullDownRefresh(async () => {
|
||
|
await getData();
|
||
|
common_vendor.index.stopPullDownRefresh();
|
||
|
});
|
||
|
return (_ctx, _cache) => {
|
||
|
var _a, _b;
|
||
|
return common_vendor.e({
|
||
|
a: _ctx.$theme.navColor,
|
||
|
b: _ctx.$theme.navBgColor,
|
||
|
c: _ctx.$theme.pageStyle,
|
||
|
d: common_vendor.o(($event) => getData()),
|
||
|
e: common_vendor.o(($event) => keyword.value = $event),
|
||
|
f: common_vendor.p({
|
||
|
placeholder: "请输入关键词搜索",
|
||
|
height: "72",
|
||
|
["show-action"]: false,
|
||
|
modelValue: keyword.value
|
||
|
}),
|
||
|
g: common_vendor.f(data.value, (item, k0, i0) => {
|
||
|
return {
|
||
|
a: common_vendor.t(item.name),
|
||
|
b: currentCategory.value.id == item.id ? 1 : "",
|
||
|
c: item.id,
|
||
|
d: common_vendor.o(($event) => changeCategory(item), item.id)
|
||
|
};
|
||
|
}),
|
||
|
h: (_a = currentCategory.value.skill) == null ? void 0 : _a.length
|
||
|
}, ((_b = currentCategory.value.skill) == null ? void 0 : _b.length) ? {
|
||
|
i: common_vendor.f(currentCategory.value.skill, (item, k0, i0) => {
|
||
|
return common_vendor.e({
|
||
|
a: "60cb6924-3-" + i0 + "," + ("60cb6924-2-" + i0),
|
||
|
b: common_vendor.p({
|
||
|
src: item.image,
|
||
|
width: 76,
|
||
|
height: 76,
|
||
|
["border-radius"]: "8rpx"
|
||
|
}),
|
||
|
c: common_vendor.t(item.name),
|
||
|
d: item.describe
|
||
|
}, item.describe ? {
|
||
|
e: common_vendor.t(item.describe)
|
||
|
} : {}, {
|
||
|
f: "60cb6924-2-" + i0 + ",60cb6924-0",
|
||
|
g: common_vendor.p({
|
||
|
to: `/packages/pages/chat/chat?type=3&id=${item.id}`
|
||
|
}),
|
||
|
h: item.id
|
||
|
});
|
||
|
})
|
||
|
} : {
|
||
|
j: common_vendor.p({
|
||
|
text: "暂无数据~",
|
||
|
mode: "list"
|
||
|
})
|
||
|
}, {
|
||
|
k: common_vendor.p({
|
||
|
text: "加载出错~"
|
||
|
}),
|
||
|
l: common_vendor.p({
|
||
|
status: status.value
|
||
|
})
|
||
|
});
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/uniapp/uniapp/src/pages/skills/skills.vue"]]);
|
||
|
wx.createPage(MiniProgramPage);
|