Files
cmgd-mini-app/unpackage/dist/dev/mp-weixin/pages/order/index.js

202 lines
9.2 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);
const onChangeTab = (item, idx) => {
current_tab_idx.value = idx;
paging.value.reload();
};
const queryList = (pageNo = 1, pageSize = 10) => {
common_vendor.index.__f__("log", "at pages/order/index.vue:172", 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:179", 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, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
return common_vendor.e({
a: order.order_type == 1
}, order.order_type == 1 ? {
b: "17a44f9d-3-" + i0 + ",17a44f9d-2",
c: common_vendor.p({
plain: true,
type: "primary"
})
} : {
e: "17a44f9d-4-" + i0 + ",17a44f9d-2",
f: common_vendor.p({
plain: true,
type: "warning"
})
}, {
d: order.order_type == 2,
g: order.order_type == 1
}, order.order_type == 1 ? {
h: common_vendor.t((_a = order == null ? void 0 : order.rooms) == null ? void 0 : _a.room_name),
i: "17a44f9d-5-" + i0 + ",17a44f9d-2",
j: common_vendor.p({
["custom-color"]: "#ffc209"
})
} : {}, {
k: ((_b = order == null ? void 0 : order.status) == null ? void 0 : _b.value) == 1
}, ((_c = order == null ? void 0 : order.status) == null ? void 0 : _c.value) == 1 ? {
l: common_vendor.t((_d = order == null ? void 0 : order.status) == null ? void 0 : _d.text),
m: "17a44f9d-6-" + i0 + ",17a44f9d-2",
n: common_vendor.p({
plain: true,
type: "danger"
})
} : ((_e = order == null ? void 0 : order.status) == null ? void 0 : _e.value) == 2 ? {
p: common_vendor.t((_f = order == null ? void 0 : order.status) == null ? void 0 : _f.text),
q: "17a44f9d-7-" + i0 + ",17a44f9d-2",
r: common_vendor.p({
plain: true,
type: "success"
})
} : {}, {
o: ((_g = order == null ? void 0 : order.status) == null ? void 0 : _g.value) == 2,
s: order.order_type == 1 && ((_h = order == null ? void 0 : order.fee_type) == null ? void 0 : _h.value) != 0
}, order.order_type == 1 && ((_i = order == null ? void 0 : order.fee_type) == null ? void 0 : _i.value) != 0 ? common_vendor.e({
t: common_vendor.t((_j = order == null ? void 0 : order.fee_type) == null ? void 0 : _j.text),
v: "17a44f9d-8-" + i0 + ",17a44f9d-2",
w: common_vendor.p({
plain: true,
["custom-color"]: "#fa2400"
}),
x: ((_k = order == null ? void 0 : order.fee_type) == null ? void 0 : _k.value) == 0 || ((_l = order == null ? void 0 : order.fee_type) == null ? void 0 : _l.value) == 3
}, ((_m = order == null ? void 0 : order.fee_type) == null ? void 0 : _m.value) == 0 || ((_n = order == null ? void 0 : order.fee_type) == null ? void 0 : _n.value) == 3 ? {} : ((_o = order == null ? void 0 : order.fee_type) == null ? void 0 : _o.value) == 1 || ((_p = order == null ? void 0 : order.fee_type) == null ? void 0 : _p.value) == 2 ? {
z: common_vendor.t(order == null ? void 0 : order.fee_combo_name)
} : {}, {
y: ((_q = order == null ? void 0 : order.fee_type) == null ? void 0 : _q.value) == 1 || ((_r = order == null ? void 0 : order.fee_type) == null ? void 0 : _r.value) == 2,
A: ((_s = order == null ? void 0 : order.fee_type) == null ? void 0 : _s.value) == 0 || ((_t = order == null ? void 0 : order.fee_type) == null ? void 0 : _t.value) == 3
}, ((_u = order == null ? void 0 : order.fee_type) == null ? void 0 : _u.value) == 0 || ((_v = order == null ? void 0 : order.fee_type) == null ? void 0 : _v.value) == 3 ? {
B: common_vendor.t(order == null ? void 0 : order.fee_amount)
} : ((_w = order == null ? void 0 : order.fee_type) == null ? void 0 : _w.value) == 1 || ((_x = order == null ? void 0 : order.fee_type) == null ? void 0 : _x.value) == 2 ? {
D: common_vendor.t(order == null ? void 0 : order.fee_combo_price)
} : {}, {
C: ((_y = order == null ? void 0 : order.fee_type) == null ? void 0 : _y.value) == 1 || ((_z = order == null ? void 0 : order.fee_type) == null ? void 0 : _z.value) == 2,
E: common_vendor.t((_A = order == null ? void 0 : order.fee_pay_status) == null ? void 0 : _A.text)
}) : {}, {
F: order.over_often > 0
}, order.over_often > 0 ? {
G: "17a44f9d-9-" + i0 + ",17a44f9d-2",
H: common_vendor.p({
plain: true,
["custom-color"]: "#fa2400"
}),
I: common_vendor.t(order == null ? void 0 : order.over_often),
J: common_vendor.t(order == null ? void 0 : order.over_amount),
K: common_vendor.t((_B = order == null ? void 0 : order.over_pay_status) == null ? void 0 : _B.text)
} : {}, {
L: common_vendor.f(order.goods, (goods, iidx, i1) => {
return {
a: common_vendor.t(goods.goods_type_name),
b: "17a44f9d-10-" + 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(goods == null ? void 0 : goods.goods_pay_status_txt),
f: iidx
};
}),
M: common_vendor.t(order == null ? void 0 : order.discount_amount),
N: common_vendor.t(order == null ? void 0 : order.totalPrice),
O: order.remarks
}, order.remarks ? {} : {}, {
P: order.remarks
}, order.remarks ? {
Q: common_vendor.t(order.remarks)
} : {}, {
R: common_vendor.t(order.create_time),
S: common_vendor.t((_C = order == null ? void 0 : order.user) == null ? void 0 : _C.staff_name),
T: index
});
}),
e: common_vendor.p({
plain: true,
["custom-color"]: "#fa2400"
}),
f: common_vendor.sr(paging, "17a44f9d-2", {
"k": "paging"
}),
g: common_vendor.o(queryList),
h: common_vendor.o(($event) => dataList.value = $event),
i: 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