Files
frontend-app/unpackage/dist/dev/mp-weixin/pages/supply_chain/supply_chain.js
T
2025-05-30 18:44:14 +08:00

259 lines
7.7 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const CustomTabBar = () => "../../components/custom-tab-bar.js";
const _sfc_main = {
components: { CustomTabBar },
data() {
return {
swiperList: ["/static/supply_chain/banner01.png"],
currentNum: 0,
guaranteeList: [
{
path: "/static/supply_chain/pz.png",
title: "品质保障",
content: "100%正品"
},
{
path: "/static/supply_chain/ks.png",
title: "快速发货",
content: "48小时内送出"
},
{
path: "/static/supply_chain/sh.png",
title: "售后服务",
content: "快速响应"
},
{
path: "/static/supply_chain/th.png",
title: "退货无忧",
content: "七天无条件退货"
}
],
sortList: [
{
path: "/static/supply_chain/sort_fs.png",
title: "服饰鞋包",
category: "258,259,377"
},
{
path: "/static/supply_chain/sort_sm.png",
title: "数码家电",
category: "255,257"
},
{
path: "/static/supply_chain/sort_mz.png",
title: "美妆个护",
category: "278,279,280"
},
{
path: "/static/supply_chain/sort_sp.png",
title: "食品酒水",
category: "274,275"
},
{
path: "/static/supply_chain/sort_jj.png",
title: "家居生活",
category: "271"
},
{
path: "/static/supply_chain/sort_my.png",
title: "母婴用品",
category: "379"
},
{
path: "/static/supply_chain/sort_yd.png",
title: "运动户外",
category: "380"
},
{
path: "/static/supply_chain/sort_qc.png",
title: "汽车用品",
category: "389"
},
{
path: "/static/supply_chain/sort_ts.png",
title: "图书音像",
category: "385"
},
{
path: "/static/supply_chain/sort_bg.png",
title: "办公用品",
category: "386"
}
],
loading: false,
form: {
page: 1,
limit: 20,
app_id: "2024111300164927",
sign_type: "MD5",
sign: "d04be0cedd49608e758458325faecf90",
category: null
},
productList: []
// 商品图
};
},
onLoad(option) {
this.searchGYLMall();
},
methods: {
/**
* 查询供应链的商品
*/
searchGYLMall() {
if (this.loading)
return;
this.loading = true;
try {
const params = this.form;
common_vendor.index.request({
url: "https://cyysc.gscm.top/outside/1/atm/goods/list",
method: "get",
data: params,
header: {},
success: (res) => {
const data = res.data;
if (data && data.result === 1) {
const newData = data.data.data;
const newArr = newData.map((obj) => {
const sales = Math.floor(Math.random() * 5e3) + 700;
return { ...obj, sales };
});
this.productList = [...this.productList, ...newArr];
this.form.page++;
}
},
fail: (error) => {
common_vendor.index.__f__("log", "at pages/supply_chain/supply_chain.vue:192", "error", error);
}
});
} catch (error) {
common_vendor.index.__f__("error", "at pages/supply_chain/supply_chain.vue:196", "加载数据失败:", error);
} finally {
this.loading = false;
}
},
/**
* 分类搜索
* @param {Object} item
*/
sortFun(item) {
this.productList = [];
this.form.page = 1;
this.form.category = item.category;
this.searchGYLMall();
},
// 当滚动到底部时触发的方法
loadMore() {
this.searchGYLMall();
},
/**
* 详情页面
*/
jumpInfo(item) {
common_vendor.index.navigateTo({
url: "/pages/productInfo/productInfo?id=" + item.id + "&source=supply_chain"
});
}
}
};
if (!Array) {
const _easycom_up_swiper2 = common_vendor.resolveComponent("up-swiper");
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
const _easycom_up_notice_bar2 = common_vendor.resolveComponent("up-notice-bar");
const _component_CustomTabBar = common_vendor.resolveComponent("CustomTabBar");
(_easycom_up_swiper2 + _easycom_up_image2 + _easycom_up_notice_bar2 + _component_CustomTabBar)();
}
const _easycom_up_swiper = () => "../../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
const _easycom_up_notice_bar = () => "../../uni_modules/uview-plus/components/u-notice-bar/u-notice-bar.js";
if (!Math) {
(_easycom_up_swiper + _easycom_up_image + _easycom_up_notice_bar)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($data.currentNum + 1),
b: common_vendor.t($data.swiperList.length),
c: common_vendor.o((e) => $data.currentNum = e.current),
d: common_vendor.p({
list: $data.swiperList,
height: "160",
bgColor: "#ffffff00"
}),
e: common_vendor.p({
src: "/static/common/note.png",
width: "16",
height: "16",
bgColor: "#f1f6ff00"
}),
f: common_vendor.p({
icon: false,
bgColor: "#F5F6F8FF",
color: "#000000E6",
text: "壹点科技全球聚合供应链:整合京东、阿里、唯品会等一手供应链资源,支持API一键导入,为私域电商全品类货源提供一件代发服务。"
}),
g: common_vendor.f($data.guaranteeList, (item, index, i0) => {
return {
a: "52071111-3-" + i0,
b: common_vendor.p({
src: item.path,
width: "20",
height: "20",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.title),
d: common_vendor.t(item.content),
e: index
};
}),
h: common_vendor.f($data.sortList, (item, index, i0) => {
return {
a: "52071111-4-" + i0,
b: common_vendor.p({
src: item.path,
width: "30",
height: "30",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.title),
d: index,
e: common_vendor.o(($event) => $options.sortFun(item), index)
};
}),
i: $data.productList && $data.productList.length !== 0
}, $data.productList && $data.productList.length !== 0 ? {
j: common_vendor.f($data.productList, (item, k0, i0) => {
return {
a: "52071111-5-" + i0,
b: common_vendor.p({
src: item.thumb,
width: "100%",
height: "140",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.title),
d: common_vendor.t(item.price),
e: common_vendor.t(item.sales),
f: item.id,
g: common_vendor.o(($event) => $options.jumpInfo(item), item.id)
};
})
} : {
k: common_vendor.p({
src: "/static/common/not_order.png",
width: "80",
height: "80",
bgColor: "#f1f6ff00"
})
}, {
l: common_vendor.o((...args) => $options.loadMore && $options.loadMore(...args)),
m: common_vendor.p({
tabIndex: 2
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-52071111"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/supply_chain/supply_chain.js.map