purchase-let/unpackage/dist/dev/mp-weixin/pagesOrder/order/order.js

118 lines
3.7 KiB
JavaScript
Raw Normal View History

2024-04-26 18:04:56 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
2024-04-30 16:24:55 +08:00
const api_order = require("../../api/order.js");
require("../../utils/request.js");
require("../../config/app.js");
require("../../store/user.js");
2024-04-26 18:04:56 +08:00
if (!Array) {
const _easycom_up_search2 = common_vendor.resolveComponent("up-search");
const _easycom_up_tabs2 = common_vendor.resolveComponent("up-tabs");
const _easycom_up_sticky2 = common_vendor.resolveComponent("up-sticky");
const _easycom_up_empty2 = common_vendor.resolveComponent("up-empty");
(_easycom_up_search2 + _easycom_up_tabs2 + _easycom_up_sticky2 + _easycom_up_empty2)();
}
const _easycom_up_search = () => "../../uni_modules/uview-plus/components/u-search/u-search.js";
const _easycom_up_tabs = () => "../../uni_modules/uview-plus/components/u-tabs/u-tabs.js";
const _easycom_up_sticky = () => "../../uni_modules/uview-plus/components/u-sticky/u-sticky.js";
const _easycom_up_empty = () => "../../uni_modules/uview-plus/components/u-empty/u-empty.js";
if (!Math) {
(_easycom_up_search + _easycom_up_tabs + _easycom_up_sticky + good + _easycom_up_empty)();
}
const good = () => "./component/good.js";
const _sfc_main = {
__name: "order",
setup(__props) {
const tabsActive = common_vendor.ref(0);
const changeTab = ({ index }) => {
tabsActive.value = index;
swiperCurrent.value = index;
};
const tablist = common_vendor.ref([
{ name: "全部" },
{ name: "待付款" },
2024-04-30 18:08:36 +08:00
{ name: "待发货" },
2024-04-27 18:02:43 +08:00
{ name: "待收货" }
// { name: '退款/售后' },
2024-04-26 18:04:56 +08:00
]);
const swiperCurrent = common_vendor.ref(0);
const animationfinish = ({ detail: { current } }) => {
swiperCurrent.value = current;
tabsActive.value = current;
};
2024-04-30 16:24:55 +08:00
const where = common_vendor.ref({
page_no: 1,
page_size: 25
});
const orderList = common_vendor.ref([
2024-04-30 18:08:36 +08:00
[],
2024-04-30 16:24:55 +08:00
[],
[],
[]
]);
2024-04-30 18:08:36 +08:00
const getOrderList = (type = 0, status = "", paid = 1) => {
2024-04-30 16:24:55 +08:00
api_order.orderListApi({
2024-04-30 18:08:36 +08:00
...where.value,
2024-05-06 14:26:18 +08:00
status,
paid
2024-04-30 16:24:55 +08:00
}).then((res) => {
orderList.value[type] = res.data.lists;
2024-05-06 14:26:18 +08:00
console.log(orderList.value);
2024-04-30 16:24:55 +08:00
});
};
2024-04-27 18:02:43 +08:00
common_vendor.onLoad((options) => {
if (options.type) {
tabsActive.value = +options.type;
swiperCurrent.value = +options.type;
}
2024-04-30 18:08:36 +08:00
getOrderList(0);
getOrderList(1, "", 0);
getOrderList(2, 0);
getOrderList(3, 1);
2024-04-27 18:02:43 +08:00
});
2024-04-26 18:04:56 +08:00
return (_ctx, _cache) => {
2024-04-30 16:24:55 +08:00
return {
2024-04-26 18:04:56 +08:00
a: common_vendor.p({
shape: "round",
actionStyle: {
color: "#20b128"
}
}),
b: common_vendor.o(changeTab),
c: common_vendor.p({
current: tabsActive.value,
list: tablist.value,
lineColor: "#20b128",
scrollable: false,
activeStyle: {
color: "#20b128",
fontWeight: "bold"
}
}),
d: common_vendor.p({
bgColor: "#fff"
}),
2024-04-30 16:24:55 +08:00
e: common_vendor.f(orderList.value, (list, k, i0) => {
return common_vendor.e({
a: common_vendor.f(list, (item, index, i1) => {
return {
a: index,
b: "aea1ad54-3-" + i0 + "-" + i1,
c: common_vendor.p({
datas: item,
type: k
})
};
})
}, {
d: k
});
2024-04-26 18:04:56 +08:00
}),
2024-04-30 16:24:55 +08:00
f: swiperCurrent.value,
g: common_vendor.o(animationfinish)
};
2024-04-26 18:04:56 +08:00
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/里海数字乡村/purchase-let/pagesOrder/order/order.vue"]]);
wx.createPage(MiniProgramPage);