This commit is contained in:
2026-01-10 20:23:59 +08:00
parent 1fc846fae3
commit 9e957d5dea
127 changed files with 3528 additions and 3421 deletions

View File

@@ -4,21 +4,15 @@ const api_goods = require("../../api/goods.js");
const utils_helper = require("../../utils/helper.js");
if (!Array) {
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
const _easycom_nut_searchbar2 = common_vendor.resolveComponent("nut-searchbar");
const _easycom_nut_menu_item2 = common_vendor.resolveComponent("nut-menu-item");
const _easycom_nut_menu2 = common_vendor.resolveComponent("nut-menu");
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
(_easycom_nut_button2 + _easycom_nut_searchbar2 + _easycom_nut_menu_item2 + _easycom_nut_menu2 + _easycom_nut_tag2 + _easycom_z_paging2)();
(_easycom_nut_button2 + _easycom_nut_tag2 + _easycom_z_paging2)();
}
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
const _easycom_nut_searchbar = () => "../../uni_modules/nutui-uni/components/searchbar/searchbar.js";
const _easycom_nut_menu_item = () => "../../uni_modules/nutui-uni/components/menuitem/menuitem.js";
const _easycom_nut_menu = () => "../../uni_modules/nutui-uni/components/menu/menu.js";
const _easycom_nut_tag = () => "../../uni_modules/nutui-uni/components/tag/tag.js";
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
if (!Math) {
(_easycom_nut_button + _easycom_nut_searchbar + _easycom_nut_menu_item + _easycom_nut_menu + _easycom_nut_tag + _easycom_z_paging)();
(_easycom_nut_button + _easycom_nut_tag + _easycom_z_paging)();
}
const _sfc_main = {
__name: "goodsList",
@@ -30,9 +24,9 @@ const _sfc_main = {
};
const paging = common_vendor.ref(null);
const dataList = common_vendor.ref([]);
const selectPriceSortRef = common_vendor.ref(null);
const selectDegreeRef = common_vendor.ref(null);
const selectProductRef = common_vendor.ref(null);
common_vendor.ref(null);
common_vendor.ref(null);
common_vendor.ref(null);
const state = common_vendor.reactive({
type_params: [],
// 产品类型
@@ -72,113 +66,10 @@ const _sfc_main = {
search_val: ""
// 搜索
});
const onSearch = () => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:241", "搜索:", state.search_val);
paging.value.reload();
};
const onClear = () => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:247", "搜索:", state.search_val);
paging.value.reload();
};
const onResetProduct = () => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:255", "重置产品");
state.type_id = 1;
state.type_name = "手机";
state.brand_id = 0;
state.brand_name = "全部";
state.product_ids = [0];
state.product_name = "机型";
};
const onConfirmProduct = () => {
var _a;
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:265", "当前产品类型", {
"type_id": state.type_id,
"type_name": state.type_name,
"brand_id": state.brand_id,
"brand_name": state.brand_name,
"product_ids": state.product_ids
});
(_a = selectProductRef.value) == null ? void 0 : _a.toggle(false);
paging.value.reload();
};
const selectProduct = (product) => {
if (product.value === 0) {
state.product_ids = [0];
} else {
state.product_ids = state.product_ids.filter((e) => e != 0);
const index = state.product_ids.indexOf(product.value);
if (index > -1) {
state.product_ids.splice(index, 1);
if (state.product_ids.length === 0) {
state.product_ids = [0];
}
} else {
state.product_ids.push(product.value);
}
}
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:294", product);
};
const productOptions = common_vendor.computed(() => {
common_vendor.computed(() => {
var _a;
return (_a = state == null ? void 0 : state.o_drop_down_options[state.type_id]) == null ? void 0 : _a.children[state.brand_id].children;
});
const selectBrand = (brand) => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:304", brand);
state.brand_id = brand.value;
state.brand_name = brand.label;
state.product_ids = [0];
state.product_name = brand.label;
};
const selectType = (type) => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:314", type);
state.type_id = type.type_id;
state.type_name = type.name;
state.brand_id = 0;
state.brand_name = "全部";
state.product_ids = [0];
};
const selectPriceSort = (item) => {
var _a;
if (state.price_sort !== item.value) {
state.price_sort = item.value;
state.price_sort_name = item.text;
} else {
state.price_sort_name = "默认排序";
state.price_sort = "";
}
(_a = selectPriceSortRef.value) == null ? void 0 : _a.toggle(false);
paging.value.reload();
};
const selectDegree = (item) => {
const index = state.degree_ids.indexOf(item.value);
if (index > -1) {
state.degree_ids.splice(index, 1);
} else {
state.degree_ids.push(item.value);
}
if (state.degree_ids.length > 0) {
state.degree_name = "已选" + state.degree_ids.length.toString() + "项";
} else {
state.degree_name = "成色";
}
};
const onResetDegree = () => {
var _a;
state.degree_ids = [];
state.degree_name = "成色";
(_a = selectDegreeRef.value) == null ? void 0 : _a.toggle(false);
paging.value.reload();
};
const onConfirmDegree = () => {
var _a;
if (state.degree_ids.length > 0) {
state.degree_name = "已选" + state.degree_ids.length.toString() + "项";
} else {
state.degree_name = "成色";
}
(_a = selectDegreeRef.value) == null ? void 0 : _a.toggle(false);
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
const params = {
pageSize,
@@ -190,18 +81,18 @@ const _sfc_main = {
product_ids: state.product_ids,
search: state.search_val
};
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:387", params);
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:299", params);
api_goods.fetchSysGoodsList(params).then((res) => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:389", "res=>", res.list);
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:301", "res=>", res.list);
paging.value.complete(res.list);
}).catch((res) => {
paging.value.complete(false);
});
};
const init = () => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:406", "init111");
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:318", "init111");
api_goods.fetchFilterParmas().then((res) => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:409", res);
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:321", res);
let degree_params = res.degree_list;
state.degree_params = degree_params.reduce((it, cit) => {
it.push({
@@ -216,8 +107,8 @@ const _sfc_main = {
});
};
common_vendor.onShow(() => {
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:428", "onshow---");
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:429", "paging.value", paging.value);
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:340", "onshow---");
common_vendor.index.__f__("log", "at pages/config/goodsList.vue:341", "paging.value", paging.value);
if (paging.value) {
paging.value.refresh();
}
@@ -226,7 +117,6 @@ const _sfc_main = {
init();
});
return (_ctx, _cache) => {
var _a;
return {
a: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsAdd")),
b: common_vendor.p({
@@ -234,107 +124,13 @@ const _sfc_main = {
block: true,
plain: true
}),
c: common_vendor.o(onSearch),
d: common_vendor.p({
type: "primary"
}),
e: common_vendor.o(onSearch),
f: common_vendor.o(onClear),
g: common_vendor.o(($event) => state.search_val = $event),
h: common_vendor.p({
placeholder: "请输入商品名称",
clearable: true,
["input-background"]: "#eee",
modelValue: state.search_val
}),
i: common_vendor.f(state.price_sort_params, (item, idx, i0) => {
return {
a: common_vendor.t(item.text),
b: state.price_sort === item.value ? 1 : "",
c: idx,
d: common_vendor.o(($event) => selectPriceSort(item), idx)
};
}),
j: common_vendor.sr(selectPriceSortRef, "d044a737-5,d044a737-4", {
"k": "selectPriceSortRef"
}),
k: common_vendor.p({
title: state.price_sort_name
}),
l: common_vendor.f(state.type_params, (type, idx, i0) => {
return {
a: common_vendor.t(type.name),
b: idx,
c: common_vendor.o(($event) => selectType(type), idx),
d: state.type_id == type.type_id ? 1 : ""
};
}),
m: common_vendor.f((_a = state == null ? void 0 : state.drop_down_options[state.type_id]) == null ? void 0 : _a.children, (item, idx, i0) => {
return {
a: common_vendor.t(item.label),
b: idx,
c: common_vendor.o(($event) => selectBrand(item), idx),
d: item.value == state.brand_id ? 1 : ""
};
}),
n: common_vendor.f(productOptions.value, (item, idx, i0) => {
return {
a: common_vendor.t(item.label),
b: idx,
c: state.product_ids.includes(item.value) ? 1 : "",
d: common_vendor.o(($event) => selectProduct(item), idx)
};
}),
o: common_vendor.o(($event) => onResetProduct()),
p: common_vendor.p({
plain: true,
type: "default"
}),
q: common_vendor.o(($event) => onConfirmProduct()),
r: common_vendor.p({
block: true,
type: "primary"
}),
s: common_vendor.sr(selectProductRef, "d044a737-6,d044a737-4", {
"k": "selectProductRef"
}),
t: common_vendor.p({
title: state.product_name
}),
v: common_vendor.f(state.degree_params, (item, idx, i0) => {
return {
a: common_vendor.t(item.text),
b: state.degree_ids.includes(item.value) ? 1 : "",
c: idx,
d: common_vendor.o(($event) => selectDegree(item), idx)
};
}),
w: common_vendor.o(($event) => onResetDegree()),
x: common_vendor.p({
plain: true,
type: "default"
}),
y: common_vendor.o(($event) => onConfirmDegree()),
z: common_vendor.p({
block: true,
type: "primary"
}),
A: common_vendor.sr(selectDegreeRef, "d044a737-9,d044a737-4", {
"k": "selectDegreeRef"
}),
B: common_vendor.p({
title: state.degree_name
}),
C: common_vendor.p({
["title-class"]: "titleClass"
}),
D: common_vendor.s("top:0px"),
E: common_vendor.f(dataList.value, (item, index, i0) => {
c: common_vendor.s("top:0px"),
d: common_vendor.f(dataList.value, (item, index, i0) => {
return common_vendor.e({
a: getImg(item),
b: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsDetail?id=" + item.goods_id), index),
c: common_vendor.t(item.degree.degree_name),
d: "d044a737-12-" + i0 + ",d044a737-0",
d: "d044a737-2-" + i0 + ",d044a737-0",
e: common_vendor.t(item.goods_name),
f: common_vendor.t(item.content),
g: common_vendor.t(item.goods_price),
@@ -342,7 +138,7 @@ const _sfc_main = {
i: item.status.value == 10 || item.status.value == 20
}, item.status.value == 10 || item.status.value == 20 ? {
j: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
k: "d044a737-13-" + i0 + ",d044a737-0",
k: "d044a737-3-" + i0 + ",d044a737-0",
l: common_vendor.p({
size: "small",
type: "primary"
@@ -351,7 +147,7 @@ const _sfc_main = {
m: item.status.value == 40
}, item.status.value == 40 ? {
n: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsEdit?id=" + item.goods_id), index),
o: "d044a737-14-" + i0 + ",d044a737-0",
o: "d044a737-4-" + i0 + ",d044a737-0",
p: common_vendor.p({
size: "small",
type: "primary"
@@ -360,15 +156,15 @@ const _sfc_main = {
q: index
});
}),
F: common_vendor.p({
e: common_vendor.p({
["custom-color"]: "#1a1a1a"
}),
G: common_vendor.sr(paging, "d044a737-0", {
f: common_vendor.sr(paging, "d044a737-0", {
"k": "paging"
}),
H: common_vendor.o(queryList),
I: common_vendor.o(($event) => dataList.value = $event),
J: common_vendor.p({
g: common_vendor.o(queryList),
h: common_vendor.o(($event) => dataList.value = $event),
i: common_vendor.p({
["refresher-enabled"]: false,
["auto-clean-list-when-reload"]: false,
["auto-scroll-to-top-when-reload"]: false,