"use strict"; const common_vendor = require("../../common/vendor.js"); const API_api = require("../../API/api.js"); if (!Array) { const _easycom_uni_steps2 = common_vendor.resolveComponent("uni-steps"); const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination"); (_easycom_uni_steps2 + _easycom_uni_pagination2)(); } const _easycom_uni_steps = () => "../../uni_modules/uni-steps/components/uni-steps/uni-steps.js"; const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js"; if (!Math) { (_easycom_uni_steps + _easycom_uni_pagination)(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "orderStateThree", setup(__props) { const currentPage = common_vendor.ref(1); const pageSize = common_vendor.ref(10); const totalItems = common_vendor.ref(0); const orderList = common_vendor.ref([]); const tell = (phone) => { console.log(phone); common_vendor.index.makePhoneCall({ phoneNumber: phone }); }; const obtion = (order) => { console.log(order.id); common_vendor.index.request({ url: `${API_api.apiImageUrl}/api/orders/update/state/user`, method: "POST", data: { id: order.id }, header: { "Content-Type": "application/json", "cookie": common_vendor.index.getStorageSync("cookie") || "" }, success(res) { console.log(res); }, fail(err) { console.log(err); } }); }; const getOrder = (page) => { common_vendor.index.request({ url: `${API_api.apiImageUrl}/api/orders/my/page`, method: "POST", data: { current: page, endTime: "", id: "", pageSize: pageSize.value, pickupMethod: "", sortField: "", sortOrder: "", startTime: "", state: 4 }, header: { "Content-Type": "application/json", "cookie": common_vendor.index.getStorageSync("cookie") || "" }, success(res) { if (res.data.code === 0) { const records = res.data.data.records; orderList.value = records.reverse(); totalItems.value = res.data.data.total; console.log("订单数据:", orderList.value); } }, fail() { console.log("出错啦"); } }); }; const onPageChange = (e) => { currentPage.value = e.current; getOrder(e.current); }; common_vendor.onMounted(() => { getOrder(currentPage.value); }); const merchantDetail = (order) => { var _a, _b, _c; console.log((_a = order.businessVO) == null ? void 0 : _a.id); common_vendor.index.setStorageSync("businessItem", (_b = order.businessVO) == null ? void 0 : _b.id); const merchantId = (_c = order.businessVO) == null ? void 0 : _c.id; common_vendor.index.navigateTo({ url: `/pages/merchant/merchant?merchantId=${merchantId}` }); }; return (_ctx, _cache) => { var _a; return { a: common_vendor.f(orderList.value, (order, index, i0) => { var _a2, _b; return { a: common_vendor.t((_a2 = order.businessVO) == null ? void 0 : _a2.businessName), b: common_vendor.o(($event) => merchantDetail(order), index), c: common_vendor.t(order.id), d: common_vendor.f(1, (sku, k1, i1) => { return { a: common_vendor.f(order.orderDetailsVOList, (item, index2, i2) => { var _a3; return { a: common_vendor.t((_a3 = item.dishesVO) == null ? void 0 : _a3.dishesName), b: common_vendor.t(item.attributeNames) }; }), b: sku }; }), e: (_b = order.businessVO) == null ? void 0 : _b.businessAvatar, f: "54db654a-0-" + i0, g: common_vendor.o(() => obtion(order), index), h: common_vendor.o(() => { var _a3; return tell((_a3 = order.businessVO) == null ? void 0 : _a3.businessPhone); }, index), i: index }; }), b: `/pagesOrder/detail/detail?id=1`, c: common_vendor.p({ options: _ctx.list1, active: _ctx.active }), d: common_vendor.t("没有更多数据~"), e: ((_a = _ctx.safeAreaInsets) == null ? void 0 : _a.bottom) + "px", f: common_vendor.o(onPageChange), g: common_vendor.p({ title: "订单列表", ["show-icon"]: true, current: currentPage.value, total: totalItems.value, pageSize: pageSize.value }) }; }; } }); wx.createComponent(_sfc_main);