"use strict"; const common_vendor = require("../common/vendor.js"); const api_order = require("../api/order.js"); const _sfc_main = { data() { return { status: "", orderList: [], tabList: [ { name: "全部", status: "" }, { name: "待支付", status: "1" }, { name: "待发货", status: "2" }, { name: "待收货", status: "3" }, { name: "待评价", status: "4" }, { name: "已完成", status: "5" } ] }; }, mounted() { this.getliveOrderList(this.status); }, methods: { // 确认收货 confirmReceipt(item) { var that = this; common_vendor.index.showModal({ title: "提示", content: "确认收到货了吗", success: function(res) { if (res.confirm) { var data = { orderId: item.orderId }; api_order.finishOrder(data).then((res2) => { if (res2.code == 200) { common_vendor.index.showToast({ icon: "success", title: "操作成功" }); that.getliveOrderList(that.status); } else { common_vendor.index.showToast({ icon: "none", title: res2.msg }); } }); } else if (res.cancel) ; } }); }, // 取消订单 cancel(item) { var that = this; common_vendor.index.showModal({ title: "提示", content: "确定取消订单吗", success: function(res) { if (res.confirm) { var data = { orderId: item.orderId }; api_order.cancelOrder(data).then((res2) => { if (res2.code == 200) { common_vendor.index.showToast({ icon: "success", title: "操作成功" }); that.getliveOrderList(that.status); } else { common_vendor.index.showToast({ icon: "none", title: res2.msg }); } }); } else if (res.cancel) ; } }); }, // 申请售后 refund(item) { common_vendor.index.navigateTo({ url: "./refundOrderProduct?orderId=" + item.orderId }); }, // tab切换 tabsClick(item) { this.getliveOrderList(item.status); this.status = item.status; }, // 订单列表 getliveOrderList(status) { let data = { pageSize: 10, page: 1, status // 添加状态参数 }; api_order.liveOrderList(data).then( (res) => { if (res.code == 200) { console.log("订单列表数据>>>>", res); this.orderList = res.rows; } else { common_vendor.index.showToast({ title: res.msg, icon: "none" }); } }, (rej) => { console.log("rej:" + JSON.stringify(rej)); } ); } } }; if (!Array) { const _easycom_u_tabs2 = common_vendor.resolveComponent("u-tabs"); _easycom_u_tabs2(); } const _easycom_u_tabs = () => "../uni_modules/uview-plus/components/u-tabs/u-tabs.js"; if (!Math) { _easycom_u_tabs(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return { a: common_vendor.o($options.tabsClick), b: common_vendor.p({ itemStyle: "width:33%;height:100rpx;", list: $data.tabList, lineColor: "#FF5C03" }), c: common_vendor.f($data.orderList, (item, index, i0) => { return common_vendor.e({ a: common_vendor.t(item.orderCode), b: item.status == -1 }, item.status == -1 ? {} : item.status == -2 ? {} : item.status == 1 ? {} : item.status == 2 ? {} : item.status == 3 ? {} : item.status == 4 ? {} : item.status == 5 ? {} : item.status == -3 ? {} : {}, { c: item.status == -2, d: item.status == 1, e: item.status == 2, f: item.status == 3, g: item.status == 4, h: item.status == 5, i: item.status == -3, j: common_vendor.f(item.orderItemList, (itm, idx, i1) => { return { a: itm.imgUrl, b: common_vendor.t(itm.productName), c: common_vendor.t(itm.sales), d: common_vendor.t(itm.num), e: idx }; }), k: common_vendor.t(item.totalPrice), l: item.status == 1 }, item.status == 1 ? { m: common_vendor.o(($event) => $options.cancel(item), index) } : {}, { n: item.status !== 1 }, item.status !== 1 ? { o: common_vendor.o(($event) => $options.refund(item), index) } : {}, { p: item.status == 1 }, item.status == 1 ? { q: common_vendor.o(($event) => _ctx.pay(item), index) } : {}, { r: item.status == 2 }, item.status == 2 ? { s: common_vendor.o(($event) => _ctx.urgeShipment(item), index) } : {}, { t: item.status == 3 }, item.status == 3 ? { v: common_vendor.o(($event) => $options.confirmReceipt(item), index) } : {}, { w: item.status == 4 }, item.status == 4 ? { x: common_vendor.o(($event) => _ctx.evaluate(item), index) } : {}, { y: index }); }) }; } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-11bfd2e6"]]); wx.createPage(MiniProgramPage);