处理订单列表
This commit is contained in:
256
unpackage/dist/dev/mp-weixin/pages/order/index.js
vendored
256
unpackage/dist/dev/mp-weixin/pages/order/index.js
vendored
@@ -1,130 +1,72 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_order = require("../../api/order.js");
|
||||
const api_config = require("../../api/config.js");
|
||||
const api_index = require("../../api/index.js");
|
||||
if (!Array) {
|
||||
const _easycom_nut_dialog2 = common_vendor.resolveComponent("nut-dialog");
|
||||
const _easycom_nut_button2 = common_vendor.resolveComponent("nut-button");
|
||||
const _easycom_nut_searchbar2 = common_vendor.resolveComponent("nut-searchbar");
|
||||
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_nut_price2 = common_vendor.resolveComponent("nut-price");
|
||||
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
|
||||
(_easycom_nut_dialog2 + _easycom_nut_button2 + _easycom_nut_searchbar2 + _easycom_nut_tabs2 + _easycom_nut_sticky2 + _easycom_nut_tag2 + _easycom_nut_price2 + _easycom_z_paging2)();
|
||||
(_easycom_nut_tabs2 + _easycom_nut_sticky2 + _easycom_nut_tag2 + _easycom_z_paging2)();
|
||||
}
|
||||
const _easycom_nut_dialog = () => "../../uni_modules/nutui-uni/components/dialog/dialog.js";
|
||||
const _easycom_nut_button = () => "../../uni_modules/nutui-uni/components/button/button.js";
|
||||
const _easycom_nut_searchbar = () => "../../uni_modules/nutui-uni/components/searchbar/searchbar.js";
|
||||
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_nut_price = () => "../../uni_modules/nutui-uni/components/price/price.js";
|
||||
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
|
||||
if (!Math) {
|
||||
(_easycom_nut_dialog + _easycom_nut_button + _easycom_nut_searchbar + _easycom_nut_tabs + _easycom_nut_sticky + _easycom_nut_tag + _easycom_nut_price + _easycom_z_paging)();
|
||||
(_easycom_nut_tabs + _easycom_nut_sticky + _easycom_nut_tag + _easycom_z_paging)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const audit = common_vendor.ref(true);
|
||||
const images = common_vendor.ref([]);
|
||||
const current_tab_idx = common_vendor.ref(0);
|
||||
const dataList = common_vendor.ref([]);
|
||||
const paging = common_vendor.ref(null);
|
||||
const tabs_config = [
|
||||
{
|
||||
title: "今日",
|
||||
status: "today"
|
||||
},
|
||||
{
|
||||
title: "昨日",
|
||||
status: "yesterday"
|
||||
},
|
||||
{
|
||||
title: "当月",
|
||||
status: "month"
|
||||
},
|
||||
{
|
||||
title: "全部",
|
||||
status: "all"
|
||||
},
|
||||
{
|
||||
title: "待付款",
|
||||
status: "payment"
|
||||
},
|
||||
{
|
||||
title: "待发货",
|
||||
status: "delivery"
|
||||
},
|
||||
{
|
||||
title: "待收货",
|
||||
status: "received"
|
||||
},
|
||||
{
|
||||
title: "已完成",
|
||||
status: "finish"
|
||||
}
|
||||
];
|
||||
const visibleCancelOrderDialog = common_vendor.ref(false);
|
||||
const current_cancel_order_id = common_vendor.ref(0);
|
||||
const search_val = common_vendor.ref("");
|
||||
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 getConfig = () => {
|
||||
api_config.fetchGetConfig().then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:165", "getConfig=====>", res);
|
||||
audit.value = res.appConfig.is_audit == 1;
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:167", res.appConfig.pay_imgs);
|
||||
let pay_imgs = JSON.parse(res.appConfig.pay_imgs) || [];
|
||||
let wechat_imgs = JSON.parse(res.appConfig.wechat_imgs) || [];
|
||||
let pay_imgs_arr = pay_imgs.map((item) => item.file_path) || [];
|
||||
let wechat_imgs_arr = wechat_imgs.map((item) => item.file_path) || [];
|
||||
const merged_imgs_arr = pay_imgs_arr.concat(wechat_imgs_arr);
|
||||
images.value = merged_imgs_arr;
|
||||
});
|
||||
};
|
||||
const showPayImgs = () => {
|
||||
if (images.value.length === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "暂无图片",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:186", "preview images:", images);
|
||||
common_vendor.index.previewImage({
|
||||
urls: images.value
|
||||
});
|
||||
};
|
||||
const navigateToDetail = (id) => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:194", 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:196", "导航ID不能为空");
|
||||
common_vendor.index.__f__("warn", "at pages/order/index.vue:279", "导航ID不能为空");
|
||||
return;
|
||||
}
|
||||
common_vendor.index.navigateTo({
|
||||
url: `/pages/order/detail?id=${encodeURIComponent(id)}`
|
||||
url: `/pages/config/shopOrder/detail?id=${encodeURIComponent(id)}`
|
||||
});
|
||||
};
|
||||
const onClickCancelOrder = () => {
|
||||
api_order.fetchCancelOrder(current_cancel_order_id.value).then((res) => {
|
||||
common_vendor.index.showToast({
|
||||
title: "取消成功",
|
||||
icon: "none"
|
||||
});
|
||||
paging.value.reload();
|
||||
});
|
||||
};
|
||||
const onClickReceiptOrder = (id) => {
|
||||
api_order.fetchReceiptOrder(id).then((res) => {
|
||||
common_vendor.index.showToast({
|
||||
title: "确认收货成功",
|
||||
icon: "none"
|
||||
});
|
||||
paging.value.reload();
|
||||
});
|
||||
};
|
||||
const apiFetchOrderList = (pageNo = 1, pageSize = 10) => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:229", tabs_config[current_tab_idx.value]["status"]);
|
||||
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"],
|
||||
goods_no: search_val.value
|
||||
status: tabs_config[current_tab_idx.value]["status"]
|
||||
};
|
||||
api_order.fetchOrderList(params).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:237", res);
|
||||
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);
|
||||
@@ -134,58 +76,13 @@ const _sfc_main = {
|
||||
current_tab_idx.value = parseInt(options.tab);
|
||||
});
|
||||
common_vendor.onShow(() => {
|
||||
getConfig();
|
||||
});
|
||||
const onSearch = () => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:261", "搜索:", search_val.value);
|
||||
paging.value.reload();
|
||||
};
|
||||
const onClear = () => {
|
||||
common_vendor.index.__f__("log", "at pages/order/index.vue:267", "搜索:", search_val.value);
|
||||
paging.value.reload();
|
||||
};
|
||||
const getStatusText = (order) => {
|
||||
if (order.order_status.value == 20) {
|
||||
return order.order_status.text;
|
||||
} else if (order.order_status.value == 30) {
|
||||
return order.order_status.text;
|
||||
} else if (order.order_status.value == 10) {
|
||||
if (order.pay_status.value == 10) {
|
||||
return order.pay_status.text;
|
||||
} else if (order.pay_status.value == 20) {
|
||||
if (order.delivery_status.value == 10) {
|
||||
return order.delivery_status.text;
|
||||
} else if (order.delivery_status.value == 20) {
|
||||
return order.receipt_status.text;
|
||||
}
|
||||
}
|
||||
if (paging.value) {
|
||||
paging.value.refresh();
|
||||
}
|
||||
};
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.o(($event) => visibleCancelOrderDialog.value = false),
|
||||
b: common_vendor.o(onClickCancelOrder),
|
||||
c: common_vendor.o(($event) => visibleCancelOrderDialog.value = $event),
|
||||
d: common_vendor.p({
|
||||
title: "取消订单",
|
||||
content: "确认取消吗?此操作不可恢复!",
|
||||
visible: visibleCancelOrderDialog.value
|
||||
}),
|
||||
e: common_vendor.o(onSearch),
|
||||
f: common_vendor.p({
|
||||
size: "small",
|
||||
type: "primary"
|
||||
}),
|
||||
g: common_vendor.o(onSearch),
|
||||
h: common_vendor.o(onClear),
|
||||
i: common_vendor.o(($event) => search_val.value = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "请输入商品串号",
|
||||
clearable: true,
|
||||
["input-background"]: "#eee",
|
||||
modelValue: search_val.value
|
||||
}),
|
||||
k: common_vendor.f(tabs_config, (item, idx, i0) => {
|
||||
a: common_vendor.f(tabs_config, (item, idx, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: idx,
|
||||
@@ -193,85 +90,44 @@ const _sfc_main = {
|
||||
d: common_vendor.o(($event) => onChangeTab(item, idx), idx)
|
||||
};
|
||||
}),
|
||||
l: common_vendor.o(($event) => current_tab_idx.value = $event),
|
||||
m: common_vendor.p({
|
||||
b: common_vendor.o(($event) => current_tab_idx.value = $event),
|
||||
c: common_vendor.p({
|
||||
background: "#fff",
|
||||
modelValue: current_tab_idx.value
|
||||
}),
|
||||
n: common_vendor.f(dataList.value, (order, index, i0) => {
|
||||
return common_vendor.e({
|
||||
d: common_vendor.f(dataList.value, (order, index, i0) => {
|
||||
var _a;
|
||||
return {
|
||||
a: common_vendor.t(order.create_time),
|
||||
b: common_vendor.t(getStatusText(order)),
|
||||
c: "17a44f9d-6-" + i0 + ",17a44f9d-5",
|
||||
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.snapshot_info.degree.degree_name),
|
||||
b: "17a44f9d-7-" + i0 + "-" + i1 + ",17a44f9d-5",
|
||||
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.goods_no),
|
||||
e: "17a44f9d-8-" + i0 + "-" + i1 + ",17a44f9d-5",
|
||||
f: common_vendor.p({
|
||||
price: goods.goods_price,
|
||||
size: "small",
|
||||
["need-symbol"]: true
|
||||
}),
|
||||
g: iidx,
|
||||
h: common_vendor.o(($event) => navigateToDetail(order.order_id), iidx)
|
||||
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: "17a44f9d-9-" + i0 + ",17a44f9d-5",
|
||||
f: common_vendor.p({
|
||||
price: order.total_price,
|
||||
size: "normal",
|
||||
["need-symbol"]: true
|
||||
}),
|
||||
g: order.order_status.value === 10
|
||||
}, order.order_status.value === 10 ? common_vendor.e({
|
||||
h: order.pay_status.value === 10
|
||||
}, order.pay_status.value === 10 ? {
|
||||
i: common_vendor.o(($event) => {
|
||||
visibleCancelOrderDialog.value = true;
|
||||
current_cancel_order_id.value = order.order_id;
|
||||
}, index),
|
||||
j: "17a44f9d-10-" + i0 + ",17a44f9d-5",
|
||||
k: common_vendor.p({
|
||||
plain: true,
|
||||
size: "small"
|
||||
})
|
||||
} : {}, {
|
||||
l: order.pay_status.value === 10 && !audit.value
|
||||
}, order.pay_status.value === 10 && !audit.value ? {
|
||||
m: common_vendor.o(($event) => showPayImgs(), index),
|
||||
n: "17a44f9d-11-" + i0 + ",17a44f9d-5",
|
||||
o: common_vendor.p({
|
||||
type: "primary",
|
||||
size: "small"
|
||||
})
|
||||
} : {}, {
|
||||
p: order.pay_status.value === 20 && order.delivery_status.value === 20 && order.receipt_status.value === 10
|
||||
}, order.pay_status.value === 20 && order.delivery_status.value === 20 && order.receipt_status.value === 10 ? {
|
||||
q: common_vendor.o(($event) => onClickReceiptOrder(order.order_id), index),
|
||||
r: "17a44f9d-12-" + i0 + ",17a44f9d-5",
|
||||
s: common_vendor.p({
|
||||
type: "primary",
|
||||
size: "small"
|
||||
})
|
||||
} : {}) : {}, {
|
||||
t: index
|
||||
});
|
||||
e: index
|
||||
};
|
||||
}),
|
||||
o: common_vendor.p({
|
||||
e: common_vendor.p({
|
||||
["custom-color"]: "#1a1a1a"
|
||||
}),
|
||||
p: common_vendor.p({
|
||||
f: common_vendor.p({
|
||||
["custom-color"]: "#1a1a1a"
|
||||
}),
|
||||
q: common_vendor.sr(paging, "17a44f9d-5", {
|
||||
g: common_vendor.sr(paging, "17a44f9d-2", {
|
||||
"k": "paging"
|
||||
}),
|
||||
r: common_vendor.o(apiFetchOrderList),
|
||||
s: common_vendor.o(($event) => dataList.value = $event),
|
||||
t: common_vendor.p({
|
||||
h: common_vendor.o(queryList),
|
||||
i: common_vendor.o(($event) => dataList.value = $event),
|
||||
j: common_vendor.p({
|
||||
fixed: false,
|
||||
modelValue: dataList.value
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user