"use strict"; const common_vendor = require("../../common/vendor.js"); const api_order = require("../../api/order.js"); require("../../utils/request.js"); require("../../config/app.js"); require("../../store/user.js"); 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 + orderCanclePopup)(); } const good = () => "./component/good.js"; const orderCanclePopup = () => "../../components/orderCanclePopup.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: "待付款" }, { name: "待发货" }, { name: "待收货" } // { name: '退款/售后' }, ]); const swiperCurrent = common_vendor.ref(0); const animationfinish = ({ detail: { current } }) => { swiperCurrent.value = current; tabsActive.value = current; }; const showCancel = common_vendor.ref(false); const submitCancel = (e) => { showCancel.value = false; console.log(e); common_vendor.index.showToast({ title: "取消成功", icon: "none" }); }; const cancleOrder = (e) => { console.log(e); showCancel.value = true; }; const where = common_vendor.ref({ page_no: 1, page_size: 25, keyword: "" }); const orderList = common_vendor.ref([ [], [], [], [] ]); const getOrderList = (type = 0, status = "", paid = 1) => { api_order.orderListApi({ ...where.value, status, paid }).then((res) => { orderList.value[type] = res.data.lists; }); }; const searchOn = () => { orderList.value[+swiperCurrent.value] = []; if (swiperCurrent.value == 0) getOrderList(0); if (swiperCurrent.value == 1) getOrderList(1, "", 0); if (swiperCurrent.value == 2) getOrderList(2, 0); if (swiperCurrent.value == 3) getOrderList(3, 1); }; common_vendor.onLoad((options) => { if (options.type) { tabsActive.value = +options.type; swiperCurrent.value = +options.type; } getOrderList(0); getOrderList(1, "", 0); getOrderList(2, 0); getOrderList(3, 1); }); return (_ctx, _cache) => { return { a: common_vendor.o(searchOn), b: common_vendor.o(searchOn), c: common_vendor.o(searchOn), d: common_vendor.o(($event) => where.value.keyword = $event), e: common_vendor.p({ shape: "round", actionStyle: { color: "#20b128" }, modelValue: where.value.keyword }), f: common_vendor.o(changeTab), g: common_vendor.p({ current: tabsActive.value, list: tablist.value, lineColor: "#20b128", scrollable: false, activeStyle: { color: "#20b128", fontWeight: "bold" } }), h: common_vendor.p({ bgColor: "#fff" }), i: common_vendor.f(orderList.value, (list, k, i0) => { return common_vendor.e({ a: list.length > 0 }, list.length > 0 ? { b: common_vendor.f(list, (item, index, i1) => { return { a: index, b: common_vendor.o(cancleOrder, index), c: "aea1ad54-3-" + i0 + "-" + i1, d: common_vendor.p({ datas: item, type: k }) }; }) } : { c: "aea1ad54-4-" + i0, d: common_vendor.p({ text: "订单空空如也", icon: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png" }) }, { e: k }); }), j: swiperCurrent.value, k: common_vendor.o(animationfinish), l: common_vendor.o(($event) => showCancel.value = false), m: common_vendor.o(submitCancel), n: common_vendor.p({ show: showCancel.value }) }; }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/里海数字乡村/purchase-let/pagesOrder/order/order.vue"]]); wx.createPage(MiniProgramPage);