893 lines
35 KiB
JavaScript
893 lines
35 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_house_goods = require("../../api/house_goods.js");
|
|
const api_goods = require("../../api/goods.js");
|
|
const api_config = require("../../api/config.js");
|
|
const utils_helper = require("../../utils/helper.js");
|
|
if (!Array) {
|
|
const _easycom_nut_noticebar2 = common_vendor.resolveComponent("nut-noticebar");
|
|
const _easycom_z_tabs2 = common_vendor.resolveComponent("z-tabs");
|
|
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_nut_price2 = common_vendor.resolveComponent("nut-price");
|
|
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
(_easycom_nut_noticebar2 + _easycom_z_tabs2 + _easycom_nut_button2 + _easycom_nut_searchbar2 + _easycom_nut_menu_item2 + _easycom_nut_menu2 + _easycom_nut_tag2 + _easycom_nut_price2 + _easycom_z_paging2)();
|
|
}
|
|
const _easycom_nut_noticebar = () => "../../uni_modules/nutui-uni/components/noticebar/noticebar.js";
|
|
const _easycom_z_tabs = () => "../../uni_modules/z-tabs/components/z-tabs/z-tabs.js";
|
|
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_nut_price = () => "../../uni_modules/nutui-uni/components/price/price.js";
|
|
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
|
if (!Math) {
|
|
(IndexCustomNavigationbar + _easycom_nut_noticebar + _easycom_z_tabs + _easycom_nut_button + _easycom_nut_searchbar + _easycom_nut_menu_item + _easycom_nut_menu + _easycom_nut_tag + _easycom_nut_price + _easycom_z_paging)();
|
|
}
|
|
const IndexCustomNavigationbar = () => "../../components/index-custom-navigationbar/index.js";
|
|
const _sfc_main = {
|
|
__name: "index",
|
|
setup(__props) {
|
|
const statusBarHeight = common_vendor.index.getWindowInfo().statusBarHeight;
|
|
const windowWidth = common_vendor.index.getWindowInfo().windowWidth;
|
|
const menu_top = common_vendor.ref(0);
|
|
const menu_bottom = common_vendor.ref(0);
|
|
const menu_button_info = common_vendor.index.getMenuButtonBoundingClientRect();
|
|
menu_top.value = menu_button_info.top;
|
|
menu_bottom.value = menu_button_info.bottom;
|
|
const navbarHeight = menu_bottom.value - statusBarHeight + (menu_top.value - statusBarHeight);
|
|
const getImg = (goods) => {
|
|
var _a, _b, _c, _d, _e;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:332", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
const url = (_c = (_b = (_a = goods == null ? void 0 : goods.goods_house) == null ? void 0 : _a.image) == null ? void 0 : _b[0]) == null ? void 0 : _c.file_path;
|
|
return url ? url + "?imageView2/1/w/200/h/200" : "";
|
|
} else {
|
|
const url = (_e = (_d = goods == null ? void 0 : goods.image) == null ? void 0 : _d[0]) == null ? void 0 : _e.file_path;
|
|
return url ? url + "?imageView2/1/w/200/h/200" : "";
|
|
}
|
|
};
|
|
const audit = common_vendor.ref(true);
|
|
const shopName = common_vendor.ref("");
|
|
const shopDesc = common_vendor.ref("");
|
|
const bulletinTxt = common_vendor.ref("");
|
|
const isWarehouse = common_vendor.ref(false);
|
|
const getConfig = () => {
|
|
api_config.fetchGetConfig().then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:361", "getConfig=====>", res);
|
|
audit.value = res.appConfig.is_audit == 1;
|
|
shopName.value = res.appConfig.shop_name;
|
|
shopDesc.value = res.appConfig.shop_desc;
|
|
bulletinTxt.value = res.appConfig.bulletin_txt;
|
|
isWarehouse.value = res.appConfig.is_warehouse == 1;
|
|
});
|
|
};
|
|
const singleRule = common_vendor.ref([]);
|
|
const rangeRule = common_vendor.ref([]);
|
|
const warehouseRule = common_vendor.reactive({
|
|
val: 0,
|
|
val_type: 1
|
|
});
|
|
const GetPriceRules = () => {
|
|
api_config.fetchGetPriceRules().then((res) => {
|
|
var _a;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:385", "res", res);
|
|
rangeRule.value = (res == null ? void 0 : res.range) ?? [];
|
|
singleRule.value = (res == null ? void 0 : res.single) ?? [];
|
|
Object.assign(warehouseRule, ((_a = res == null ? void 0 : res.warehouse) == null ? void 0 : _a[0]) ?? {
|
|
val: 0,
|
|
val_type: 1
|
|
});
|
|
});
|
|
};
|
|
const getPrice = (goods) => {
|
|
if (isWarehouse.value) {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:404", "开启整仓调价");
|
|
const list = singleRule.value || singleRule;
|
|
const rule = list.find((item) => item.product_id === goods.goods_id);
|
|
if (rule) {
|
|
const basePrice = Number(goods.goods_price);
|
|
const val = Number(rule.val);
|
|
let finalPrice = basePrice;
|
|
if (rule.val_type == 1) {
|
|
finalPrice = basePrice + val;
|
|
} else if (rule.val_type == 2) {
|
|
finalPrice = basePrice + basePrice * val / 100;
|
|
}
|
|
return finalPrice.toFixed(2);
|
|
} else {
|
|
const basePrice = Number(goods.goods_price);
|
|
const val = Number(warehouseRule.val);
|
|
let finalPrice = basePrice;
|
|
if (warehouseRule.val_type == 1) {
|
|
finalPrice = basePrice + val;
|
|
} else if (warehouseRule.val_type == 2) {
|
|
finalPrice = basePrice + basePrice * val / 100;
|
|
}
|
|
return finalPrice.toFixed(2);
|
|
}
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:435", "未开启整仓调价");
|
|
const singleRuleList = singleRule.value || singleRule;
|
|
const oneRule = singleRuleList.find((item) => item.product_id === goods.goods_id);
|
|
if (oneRule) {
|
|
const basePrice = Number(goods.goods_price);
|
|
const val = Number(oneRule.val);
|
|
let finalPrice = basePrice;
|
|
if (oneRule.val_type == 1) {
|
|
finalPrice = basePrice + val;
|
|
} else if (oneRule.val_type == 2) {
|
|
finalPrice = basePrice + basePrice * val / 100;
|
|
}
|
|
return finalPrice.toFixed(2);
|
|
} else {
|
|
const basePrice = Number(goods.goods_price);
|
|
const rangeRulelist = rangeRule.value || rangeRule;
|
|
const quRule = rangeRulelist.find((item) => {
|
|
const min = Number(item.min_price);
|
|
const max = Number(item.max_price);
|
|
return basePrice >= min && basePrice < max;
|
|
}) || null;
|
|
if (quRule) {
|
|
const val = Number(quRule.val);
|
|
let finalPrice = basePrice;
|
|
if (quRule.val_type == 1) {
|
|
finalPrice = basePrice + val;
|
|
} else if (quRule.val_type == 2) {
|
|
finalPrice = basePrice + basePrice * val / 100;
|
|
}
|
|
return finalPrice.toFixed(2);
|
|
} else {
|
|
return basePrice;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const tabList = common_vendor.ref(["仓库现货", "店内现货"]);
|
|
const tabIndex = common_vendor.ref(0);
|
|
const tabsChange = (index) => {
|
|
tabIndex.value = index;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:495", tabIndex.value);
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:497", "切换tab 重置选中排序");
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:498", "切换tab 重置选中产品");
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:499", "切换tab 重置选中成色");
|
|
if (tabIndex.value === 0) {
|
|
dataList.value = [];
|
|
house_state.price_sort_name = "默认排序";
|
|
house_state.price_sort = "";
|
|
house_state.type_id = 1;
|
|
house_state.type_name = "手机";
|
|
house_state.brand_id = 0;
|
|
house_state.brand_name = "全部";
|
|
house_state.product_ids = [0];
|
|
house_state.product_name = "机型";
|
|
house_state.degree_ids = [];
|
|
house_state.degree_name = "成色";
|
|
} else {
|
|
dataList.value = [];
|
|
state.price_sort_name = "默认排序";
|
|
state.price_sort = "";
|
|
state.type_id = 1;
|
|
state.type_name = "手机";
|
|
state.brand_id = 0;
|
|
state.brand_name = "全部";
|
|
state.product_ids = [0];
|
|
state.product_name = "机型";
|
|
state.degree_ids = [];
|
|
state.degree_name = "成色";
|
|
}
|
|
paging.value.reload();
|
|
};
|
|
const paging = common_vendor.ref(null);
|
|
const dataList = common_vendor.ref([]);
|
|
const user_goods_cart_ids = common_vendor.ref([]);
|
|
const goods_cart_ids = common_vendor.ref([]);
|
|
const selectPriceSortRef = common_vendor.ref(null);
|
|
const selectDegreeRef = common_vendor.ref(null);
|
|
const selectProductRef = common_vendor.ref(null);
|
|
const house_state = common_vendor.reactive({
|
|
type_params: [],
|
|
// 产品类型
|
|
drop_down_options: [],
|
|
// 产品类型下的品牌列表
|
|
o_drop_down_options: [],
|
|
// 价格排序
|
|
price_sort_params: [
|
|
{
|
|
text: "默认排序",
|
|
value: ""
|
|
},
|
|
{
|
|
text: "价格升序",
|
|
value: "ascend"
|
|
},
|
|
{
|
|
text: "价格降序",
|
|
value: "descend"
|
|
}
|
|
],
|
|
// 成色所有选项
|
|
degree_params: [],
|
|
price_sort: "",
|
|
price_sort_name: "默认排序",
|
|
degree_ids: [],
|
|
degree_name: "成色",
|
|
product_name: "机型",
|
|
type_id: 1,
|
|
// 产品类型id 默认 1 手机
|
|
type_name: "手机",
|
|
brand_id: 0,
|
|
// 品牌id // 默认 0 全部
|
|
brand_name: "全部",
|
|
product_ids: [0],
|
|
// 机型ids 默认 0 全部
|
|
search_val: ""
|
|
// 搜索
|
|
});
|
|
const state = common_vendor.reactive({
|
|
type_params: [],
|
|
// 产品类型
|
|
drop_down_options: [],
|
|
// 产品类型下的品牌列表
|
|
o_drop_down_options: [],
|
|
// 价格排序
|
|
price_sort_params: [
|
|
{
|
|
text: "默认排序",
|
|
value: ""
|
|
},
|
|
{
|
|
text: "价格升序",
|
|
value: "ascend"
|
|
},
|
|
{
|
|
text: "价格降序",
|
|
value: "descend"
|
|
}
|
|
],
|
|
// 成色所有选项
|
|
degree_params: [],
|
|
price_sort: "",
|
|
price_sort_name: "默认排序",
|
|
degree_ids: [],
|
|
degree_name: "成色",
|
|
product_name: "机型",
|
|
type_id: 1,
|
|
// 产品类型id 默认 1 手机
|
|
type_name: "手机",
|
|
brand_id: 0,
|
|
// 品牌id // 默认 0 全部
|
|
brand_name: "全部",
|
|
product_ids: [0],
|
|
// 机型ids 默认 0 全部
|
|
search_val: ""
|
|
// 搜索
|
|
});
|
|
const onSearch = () => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:679", "搜索:", state.search_val);
|
|
paging.value.reload();
|
|
};
|
|
const onClear = () => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:685", "搜索:", state.search_val);
|
|
paging.value.reload();
|
|
};
|
|
const onResetProduct = () => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:693", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:695", "重置产品");
|
|
house_state.type_id = 1;
|
|
house_state.type_name = "手机";
|
|
house_state.brand_id = 0;
|
|
house_state.brand_name = "全部";
|
|
house_state.product_ids = [0];
|
|
house_state.product_name = "机型";
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:703", "重置产品");
|
|
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/index/index.vue:715", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:717", "当前仓库产品类型", {
|
|
"type_id": house_state.type_id,
|
|
"type_name": house_state.type_name,
|
|
"brand_id": house_state.brand_id,
|
|
"brand_name": house_state.brand_name,
|
|
"product_ids": house_state.product_ids
|
|
});
|
|
} else {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:725", "当前自营产品类型", {
|
|
"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) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:742", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
if (product.value === 0) {
|
|
house_state.product_ids = [0];
|
|
} else {
|
|
house_state.product_ids = house_state.product_ids.filter((e) => e != 0);
|
|
const index = house_state.product_ids.indexOf(product.value);
|
|
if (index > -1) {
|
|
house_state.product_ids.splice(index, 1);
|
|
if (house_state.product_ids.length === 0) {
|
|
house_state.product_ids = [0];
|
|
}
|
|
} else {
|
|
house_state.product_ids.push(product.value);
|
|
}
|
|
}
|
|
} else {
|
|
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/index/index.vue:776", product);
|
|
};
|
|
const productOptions = common_vendor.computed(() => {
|
|
var _a, _b;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:780", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
return (_a = house_state == null ? void 0 : house_state.o_drop_down_options[house_state.type_id]) == null ? void 0 : _a.children[house_state.brand_id].children;
|
|
} else {
|
|
return (_b = state == null ? void 0 : state.o_drop_down_options[state.type_id]) == null ? void 0 : _b.children[state.brand_id].children;
|
|
}
|
|
});
|
|
const selectBrand = (brand) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:790", "====>tabIndex", tabIndex.value);
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:791", "====>brand", brand);
|
|
if (tabIndex.value === 0) {
|
|
house_state.brand_id = brand.value;
|
|
house_state.brand_name = brand.label;
|
|
house_state.product_ids = [0];
|
|
house_state.product_name = brand.label;
|
|
} else {
|
|
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/index/index.vue:811", "====>tabIndex", tabIndex.value);
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:812", "====>type", type);
|
|
if (tabIndex.value === 0) {
|
|
house_state.type_id = type.type_id;
|
|
house_state.type_name = type.name;
|
|
house_state.brand_id = 0;
|
|
house_state.brand_name = "全部";
|
|
house_state.product_ids = [0];
|
|
} else {
|
|
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;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:836", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
if (house_state.price_sort !== item.value) {
|
|
house_state.price_sort = item.value;
|
|
house_state.price_sort_name = item.text;
|
|
} else {
|
|
house_state.price_sort_name = "默认排序";
|
|
house_state.price_sort = "";
|
|
}
|
|
} else {
|
|
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) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:861", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
const index = house_state.degree_ids.indexOf(item.value);
|
|
if (index > -1) {
|
|
house_state.degree_ids.splice(index, 1);
|
|
} else {
|
|
house_state.degree_ids.push(item.value);
|
|
}
|
|
if (house_state.degree_ids.length > 0) {
|
|
house_state.degree_name = "已选" + house_state.degree_ids.length.toString() + "项";
|
|
} else {
|
|
house_state.degree_name = "成色";
|
|
}
|
|
} else {
|
|
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;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:891", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
house_state.degree_ids = [];
|
|
house_state.degree_name = "成色";
|
|
} else {
|
|
state.degree_ids = [];
|
|
state.degree_name = "成色";
|
|
}
|
|
(_a = selectDegreeRef.value) == null ? void 0 : _a.toggle(false);
|
|
paging.value.reload();
|
|
};
|
|
const onConfirmDegree = () => {
|
|
var _a;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:905", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
if (house_state.degree_ids.length > 0) {
|
|
house_state.degree_name = "已选" + house_state.degree_ids.length.toString() + "项";
|
|
} else {
|
|
house_state.degree_name = "成色";
|
|
}
|
|
} else {
|
|
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) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:928", "====>tabIndex", tabIndex.value);
|
|
if (tabIndex.value === 0) {
|
|
const params = {
|
|
pageSize,
|
|
page: pageNo,
|
|
price_sort: house_state.price_sort,
|
|
degree_ids: house_state.degree_ids,
|
|
type_id: house_state.type_id,
|
|
brand_id: house_state.brand_id,
|
|
product_ids: house_state.product_ids,
|
|
search: house_state.search_val
|
|
};
|
|
api_house_goods.houseFetchGoodsList(params).then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:941", res);
|
|
paging.value.complete(res.list);
|
|
user_goods_cart_ids.value = res.user_cart_goods_ids;
|
|
goods_cart_ids.value = res.cart_goods_ids;
|
|
}).catch((res) => {
|
|
paging.value.complete(false);
|
|
user_goods_cart_ids.value = [];
|
|
goods_cart_ids.value = [];
|
|
});
|
|
} else {
|
|
const params = {
|
|
pageSize,
|
|
page: pageNo,
|
|
price_sort: state.price_sort,
|
|
degree_ids: state.degree_ids,
|
|
type_id: state.type_id,
|
|
brand_id: state.brand_id,
|
|
product_ids: state.product_ids,
|
|
search: state.search_val
|
|
};
|
|
api_goods.fetchGoodsList(params).then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:965", res);
|
|
paging.value.complete(res.list);
|
|
user_goods_cart_ids.value = res.user_cart_goods_ids;
|
|
goods_cart_ids.value = res.cart_goods_ids;
|
|
}).catch((res) => {
|
|
paging.value.complete(false);
|
|
user_goods_cart_ids.value = [];
|
|
goods_cart_ids.value = [];
|
|
});
|
|
}
|
|
};
|
|
common_vendor.onShareAppMessage((obj) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:984", "====>tabIndex", tabIndex.value);
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:985", obj);
|
|
if (tabIndex.value === 0) {
|
|
if (obj.from == "button") {
|
|
let goods = obj.target.dataset.goods;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:989", goods);
|
|
return {
|
|
title: goods.goods_house.goods_name,
|
|
imageUrl: goods.goods_house.image[0].file_path,
|
|
path: "/pages/mall/houseDetail?id=" + goods.goods_id
|
|
};
|
|
}
|
|
} else {
|
|
if (obj.from == "button") {
|
|
let goods = obj.target.dataset.goods;
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:999", goods);
|
|
return {
|
|
title: goods.goods_name,
|
|
imageUrl: goods.image[0].file_path,
|
|
path: "/pages/mall/detail?id=" + goods.goods_id
|
|
};
|
|
}
|
|
}
|
|
});
|
|
const init = () => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:1033", "init");
|
|
getConfig();
|
|
GetPriceRules();
|
|
api_house_goods.houseFetchFilterParmas().then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:1054", "仓库默认筛选项目====>", res);
|
|
let degree_params = res.degree_list;
|
|
house_state.degree_params = degree_params.reduce((it, cit) => {
|
|
it.push({
|
|
text: cit.degree_name,
|
|
value: cit.degree_id
|
|
});
|
|
return it;
|
|
}, house_state.degree_params) || [];
|
|
house_state.type_params = res.type_list;
|
|
house_state.drop_down_options = res.drop_down_options;
|
|
house_state.o_drop_down_options = res.o_drop_down_options;
|
|
});
|
|
api_goods.fetchFilterParmas().then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:1073", "本地默认筛选项目====>", res);
|
|
let degree_params = res.degree_list;
|
|
state.degree_params = degree_params.reduce((it, cit) => {
|
|
it.push({
|
|
text: cit.degree_name,
|
|
value: cit.degree_id
|
|
});
|
|
return it;
|
|
}, state.degree_params) || [];
|
|
state.type_params = res.type_list;
|
|
state.drop_down_options = res.drop_down_options;
|
|
state.o_drop_down_options = res.o_drop_down_options;
|
|
});
|
|
};
|
|
common_vendor.onShow(() => {
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:1093", "onshow---");
|
|
getConfig();
|
|
GetPriceRules();
|
|
common_vendor.index.__f__("log", "at pages/index/index.vue:1097", "paging.value", paging.value);
|
|
if (paging.value) {
|
|
paging.value.refresh();
|
|
}
|
|
});
|
|
common_vendor.onMounted(() => {
|
|
init();
|
|
});
|
|
return (_ctx, _cache) => {
|
|
var _a, _b;
|
|
return common_vendor.e({
|
|
a: common_vendor.p({
|
|
statusBarHeight: common_vendor.unref(statusBarHeight),
|
|
windowWidth: common_vendor.unref(windowWidth),
|
|
navbarHeight,
|
|
title: shopName.value,
|
|
desc: shopDesc.value
|
|
}),
|
|
b: common_vendor.p({
|
|
text: bulletinTxt.value,
|
|
background: `rgba(251, 248, 220, 1)`,
|
|
["custom-color"]: `#D9500B`
|
|
}),
|
|
c: common_vendor.o(tabsChange),
|
|
d: common_vendor.p({
|
|
list: tabList.value,
|
|
["active-color"]: "rgba(233, 100, 67, 1)"
|
|
}),
|
|
e: tabIndex.value == 0
|
|
}, tabIndex.value == 0 ? {
|
|
f: common_vendor.o(onSearch),
|
|
g: common_vendor.p({
|
|
type: "primary"
|
|
}),
|
|
h: common_vendor.o(onSearch),
|
|
i: common_vendor.o(onClear),
|
|
j: common_vendor.o(($event) => house_state.search_val = $event),
|
|
k: common_vendor.p({
|
|
placeholder: "请输入商品名称",
|
|
clearable: true,
|
|
["input-background"]: "#eee",
|
|
modelValue: house_state.search_val
|
|
}),
|
|
l: common_vendor.f(house_state.price_sort_params, (item, idx, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.text),
|
|
b: house_state.price_sort === item.value ? 1 : "",
|
|
c: idx,
|
|
d: common_vendor.o(($event) => selectPriceSort(item), idx)
|
|
};
|
|
}),
|
|
m: common_vendor.sr(selectPriceSortRef, "1cf27b2a-7,1cf27b2a-6", {
|
|
"k": "selectPriceSortRef"
|
|
}),
|
|
n: common_vendor.p({
|
|
title: house_state.price_sort_name
|
|
}),
|
|
o: common_vendor.f(house_state.type_params, (type, idx, i0) => {
|
|
return {
|
|
a: common_vendor.t(type.name),
|
|
b: idx,
|
|
c: common_vendor.o(($event) => selectType(type), idx),
|
|
d: house_state.type_id == type.type_id ? 1 : ""
|
|
};
|
|
}),
|
|
p: common_vendor.f((_a = house_state == null ? void 0 : house_state.drop_down_options[house_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 == house_state.brand_id ? 1 : ""
|
|
};
|
|
}),
|
|
q: common_vendor.f(productOptions.value, (item, idx, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.label),
|
|
b: idx,
|
|
c: house_state.product_ids.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => selectProduct(item), idx)
|
|
};
|
|
}),
|
|
r: common_vendor.o(($event) => onResetProduct()),
|
|
s: common_vendor.p({
|
|
plain: true,
|
|
type: "default"
|
|
}),
|
|
t: common_vendor.o(($event) => onConfirmProduct()),
|
|
v: common_vendor.p({
|
|
block: true,
|
|
type: "primary"
|
|
}),
|
|
w: common_vendor.sr(selectProductRef, "1cf27b2a-8,1cf27b2a-6", {
|
|
"k": "selectProductRef"
|
|
}),
|
|
x: common_vendor.p({
|
|
title: house_state.product_name
|
|
}),
|
|
y: common_vendor.f(house_state.degree_params, (item, idx, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.text),
|
|
b: house_state.degree_ids.includes(item.value) ? 1 : "",
|
|
c: idx,
|
|
d: common_vendor.o(($event) => selectDegree(item), idx)
|
|
};
|
|
}),
|
|
z: common_vendor.o(($event) => onResetDegree()),
|
|
A: common_vendor.p({
|
|
plain: true,
|
|
type: "default"
|
|
}),
|
|
B: common_vendor.o(($event) => onConfirmDegree()),
|
|
C: common_vendor.p({
|
|
block: true,
|
|
type: "primary"
|
|
}),
|
|
D: common_vendor.sr(selectDegreeRef, "1cf27b2a-11,1cf27b2a-6", {
|
|
"k": "selectDegreeRef"
|
|
}),
|
|
E: common_vendor.p({
|
|
title: house_state.degree_name
|
|
}),
|
|
F: common_vendor.p({
|
|
["title-class"]: "titleClass"
|
|
})
|
|
} : {}, {
|
|
G: tabIndex.value == 1
|
|
}, tabIndex.value == 1 ? {
|
|
H: common_vendor.o(onSearch),
|
|
I: common_vendor.p({
|
|
type: "primary"
|
|
}),
|
|
J: common_vendor.o(onSearch),
|
|
K: common_vendor.o(onClear),
|
|
L: common_vendor.o(($event) => state.search_val = $event),
|
|
M: common_vendor.p({
|
|
placeholder: "请输入商品名称",
|
|
clearable: true,
|
|
["input-background"]: "#eee",
|
|
modelValue: state.search_val
|
|
}),
|
|
N: 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)
|
|
};
|
|
}),
|
|
O: common_vendor.sr(selectPriceSortRef, "1cf27b2a-17,1cf27b2a-16", {
|
|
"k": "selectPriceSortRef"
|
|
}),
|
|
P: common_vendor.p({
|
|
title: state.price_sort_name
|
|
}),
|
|
Q: 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 : ""
|
|
};
|
|
}),
|
|
R: common_vendor.f((_b = state == null ? void 0 : state.drop_down_options[state.type_id]) == null ? void 0 : _b.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 : ""
|
|
};
|
|
}),
|
|
S: 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)
|
|
};
|
|
}),
|
|
T: common_vendor.o(($event) => onResetProduct()),
|
|
U: common_vendor.p({
|
|
plain: true,
|
|
type: "default"
|
|
}),
|
|
V: common_vendor.o(($event) => onConfirmProduct()),
|
|
W: common_vendor.p({
|
|
block: true,
|
|
type: "primary"
|
|
}),
|
|
X: common_vendor.sr(selectProductRef, "1cf27b2a-18,1cf27b2a-16", {
|
|
"k": "selectProductRef"
|
|
}),
|
|
Y: common_vendor.p({
|
|
title: state.product_name
|
|
}),
|
|
Z: 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)
|
|
};
|
|
}),
|
|
aa: common_vendor.o(($event) => onResetDegree()),
|
|
ab: common_vendor.p({
|
|
plain: true,
|
|
type: "default"
|
|
}),
|
|
ac: common_vendor.o(($event) => onConfirmDegree()),
|
|
ad: common_vendor.p({
|
|
block: true,
|
|
type: "primary"
|
|
}),
|
|
ae: common_vendor.sr(selectDegreeRef, "1cf27b2a-21,1cf27b2a-16", {
|
|
"k": "selectDegreeRef"
|
|
}),
|
|
af: common_vendor.p({
|
|
title: state.degree_name
|
|
}),
|
|
ag: common_vendor.p({
|
|
["title-class"]: "titleClass"
|
|
})
|
|
} : {}, {
|
|
ah: common_vendor.s("top:" + (common_vendor.unref(statusBarHeight) + navbarHeight) + "px"),
|
|
ai: tabIndex.value == 0
|
|
}, tabIndex.value == 0 ? {
|
|
aj: common_vendor.f(dataList.value, (item, index, i0) => {
|
|
var _a2, _b2, _c, _d;
|
|
return common_vendor.e({
|
|
a: getImg(item),
|
|
b: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/houseDetail?id=" + item.goods_id), index),
|
|
c: common_vendor.t((_b2 = (_a2 = item == null ? void 0 : item.goods_house) == null ? void 0 : _a2.degree) == null ? void 0 : _b2.degree_name),
|
|
d: "1cf27b2a-24-" + i0 + ",1cf27b2a-0",
|
|
e: common_vendor.t((_c = item == null ? void 0 : item.goods_house) == null ? void 0 : _c.goods_name),
|
|
f: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/houseDetail?id=" + item.goods_id), index),
|
|
g: common_vendor.t((_d = item == null ? void 0 : item.goods_house) == null ? void 0 : _d.content),
|
|
h: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/houseDetail?id=" + item.goods_id), index),
|
|
i: "1cf27b2a-25-" + i0 + ",1cf27b2a-0",
|
|
j: common_vendor.p({
|
|
price: getPrice(item)
|
|
})
|
|
}, !audit.value ? common_vendor.e({
|
|
k: goods_cart_ids.value.includes(item.goods_id)
|
|
}, goods_cart_ids.value.includes(item.goods_id) ? {
|
|
l: "1cf27b2a-26-" + i0 + ",1cf27b2a-0",
|
|
m: common_vendor.p({
|
|
size: "small",
|
|
plain: true
|
|
})
|
|
} : {}, {
|
|
n: item
|
|
}) : {}, {
|
|
o: index
|
|
});
|
|
}),
|
|
ak: common_vendor.p({
|
|
["custom-color"]: "#1a1a1a"
|
|
}),
|
|
al: !audit.value
|
|
} : {
|
|
an: common_vendor.f(dataList.value, (item, index, i0) => {
|
|
var _a2;
|
|
return common_vendor.e({
|
|
a: getImg(item),
|
|
b: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/detail?id=" + item.goods_id), index),
|
|
c: common_vendor.t((_a2 = item == null ? void 0 : item.degree) == null ? void 0 : _a2.degree_name),
|
|
d: "1cf27b2a-27-" + i0 + ",1cf27b2a-0",
|
|
e: common_vendor.t(item.goods_name),
|
|
f: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/detail?id=" + item.goods_id), index),
|
|
g: common_vendor.t(item.content),
|
|
h: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/mall/detail?id=" + item.goods_id), index),
|
|
i: "1cf27b2a-28-" + i0 + ",1cf27b2a-0",
|
|
j: common_vendor.p({
|
|
price: item.goods_price
|
|
})
|
|
}, !audit.value ? {
|
|
k: item
|
|
} : {}, {
|
|
l: index
|
|
});
|
|
}),
|
|
ao: common_vendor.p({
|
|
["custom-color"]: "#1a1a1a"
|
|
}),
|
|
ap: !audit.value
|
|
}, {
|
|
am: tabIndex.value == 1,
|
|
aq: common_vendor.sr(paging, "1cf27b2a-0", {
|
|
"k": "paging"
|
|
}),
|
|
ar: common_vendor.o(queryList),
|
|
as: common_vendor.o(($event) => dataList.value = $event),
|
|
at: common_vendor.p({
|
|
["refresher-enabled"]: false,
|
|
["auto-clean-list-when-reload"]: false,
|
|
["auto-scroll-to-top-when-reload"]: false,
|
|
modelValue: dataList.value
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
|
|
_sfc_main.__runtimeHooks = 2;
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|