141 lines
5.0 KiB
JavaScript
141 lines
5.0 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_index = require("../../api/index.js");
|
|
if (!Array) {
|
|
const _easycom_nut_tabs2 = common_vendor.resolveComponent("nut-tabs");
|
|
const _easycom_nut_sticky2 = common_vendor.resolveComponent("nut-sticky");
|
|
const _easycom_nut_tag2 = common_vendor.resolveComponent("nut-tag");
|
|
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
|
(_easycom_nut_tabs2 + _easycom_nut_sticky2 + _easycom_nut_tag2 + _easycom_z_paging2)();
|
|
}
|
|
const _easycom_nut_tabs = () => "../../uni_modules/nutui-uni/components/tabs/tabs.js";
|
|
const _easycom_nut_sticky = () => "../../uni_modules/nutui-uni/components/sticky/sticky.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_tabs + _easycom_nut_sticky + _easycom_nut_tag + _easycom_z_paging)();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "index",
|
|
setup(__props) {
|
|
const current_tab_idx = common_vendor.ref(0);
|
|
const tabs_config = [
|
|
{
|
|
title: "今日",
|
|
status: "today"
|
|
},
|
|
{
|
|
title: "昨日",
|
|
status: "yesterday"
|
|
},
|
|
{
|
|
title: "当月",
|
|
status: "month"
|
|
},
|
|
{
|
|
title: "全部",
|
|
status: "all"
|
|
}
|
|
];
|
|
const dataList = common_vendor.ref([]);
|
|
const paging = common_vendor.ref(null);
|
|
common_vendor.ref(false);
|
|
common_vendor.ref(0);
|
|
common_vendor.ref(false);
|
|
common_vendor.ref(0);
|
|
common_vendor.ref("");
|
|
const onChangeTab = (item, idx) => {
|
|
current_tab_idx.value = idx;
|
|
paging.value.reload();
|
|
};
|
|
const navigateToDetail = (id) => {
|
|
common_vendor.index.__f__("log", "at pages/order/index.vue:277", id);
|
|
if (!id) {
|
|
common_vendor.index.__f__("warn", "at pages/order/index.vue:279", "导航ID不能为空");
|
|
return;
|
|
}
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/config/shopOrder/detail?id=${encodeURIComponent(id)}`
|
|
});
|
|
};
|
|
const queryList = (pageNo = 1, pageSize = 10) => {
|
|
common_vendor.index.__f__("log", "at pages/order/index.vue:317", tabs_config[current_tab_idx.value]["status"]);
|
|
const params = {
|
|
page: pageNo,
|
|
pageSize: 10,
|
|
status: tabs_config[current_tab_idx.value]["status"]
|
|
};
|
|
api_index.fetchOrderList(params).then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/order/index.vue:324", res);
|
|
paging.value.complete(res.list);
|
|
}).catch((res) => {
|
|
paging.value.complete(false);
|
|
});
|
|
};
|
|
common_vendor.onLoad((options) => {
|
|
current_tab_idx.value = parseInt(options.tab);
|
|
});
|
|
common_vendor.onShow(() => {
|
|
if (paging.value) {
|
|
paging.value.refresh();
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.f(tabs_config, (item, idx, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.title),
|
|
b: idx,
|
|
c: idx === current_tab_idx.value ? 1 : "",
|
|
d: common_vendor.o(($event) => onChangeTab(item, idx), idx)
|
|
};
|
|
}),
|
|
b: common_vendor.o(($event) => current_tab_idx.value = $event),
|
|
c: common_vendor.p({
|
|
background: "#fff",
|
|
modelValue: current_tab_idx.value
|
|
}),
|
|
d: common_vendor.f(dataList.value, (order, index, i0) => {
|
|
var _a;
|
|
return {
|
|
a: common_vendor.t(order.create_time),
|
|
b: common_vendor.t((_a = order == null ? void 0 : order.status) == null ? void 0 : _a.text),
|
|
c: "17a44f9d-3-" + i0 + ",17a44f9d-2",
|
|
d: common_vendor.f(order.goods, (goods, iidx, i1) => {
|
|
var _a2;
|
|
return {
|
|
a: common_vendor.t(goods.goods_type_name),
|
|
b: "17a44f9d-4-" + i0 + "-" + i1 + ",17a44f9d-2",
|
|
c: common_vendor.t(goods.goods_name),
|
|
d: common_vendor.t(goods == null ? void 0 : goods.goods_price),
|
|
e: common_vendor.t((_a2 = goods == null ? void 0 : goods.goods_pay_status) == null ? void 0 : _a2.text),
|
|
f: iidx,
|
|
g: common_vendor.o(($event) => navigateToDetail(order.order_id), iidx)
|
|
};
|
|
}),
|
|
e: index
|
|
};
|
|
}),
|
|
e: common_vendor.p({
|
|
["custom-color"]: "#1a1a1a"
|
|
}),
|
|
f: common_vendor.p({
|
|
["custom-color"]: "#1a1a1a"
|
|
}),
|
|
g: common_vendor.sr(paging, "17a44f9d-2", {
|
|
"k": "paging"
|
|
}),
|
|
h: common_vendor.o(queryList),
|
|
i: common_vendor.o(($event) => dataList.value = $event),
|
|
j: common_vendor.p({
|
|
fixed: false,
|
|
modelValue: dataList.value
|
|
})
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-17a44f9d"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/order/index.js.map
|