Files
PC-202306242200\Administrator dac42e3b0c first commit
2026-03-28 23:09:02 +08:00

231 lines
7.3 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const hooks_useNav = require("../../hooks/useNav.js");
const api_api = require("../../api/api.js");
require("../../uni_modules/uview-plus/index.js");
const uni_modules_uviewPlus_libs_function_index = require("../../uni_modules/uview-plus/libs/function/index.js");
if (!Array) {
const _easycom_up_dropdown_item2 = common_vendor.resolveComponent("up-dropdown-item");
const _easycom_up_dropdown2 = common_vendor.resolveComponent("up-dropdown");
const _easycom_up_tag2 = common_vendor.resolveComponent("up-tag");
const _easycom_z_paging2 = common_vendor.resolveComponent("z-paging");
(_easycom_up_dropdown_item2 + _easycom_up_dropdown2 + _easycom_up_tag2 + _easycom_z_paging2)();
}
const _easycom_up_dropdown_item = () => "../../uni_modules/uview-plus/components/u-dropdown-item/u-dropdown-item.js";
const _easycom_up_dropdown = () => "../../uni_modules/uview-plus/components/u-dropdown/u-dropdown.js";
const _easycom_up_tag = () => "../../uni_modules/uview-plus/components/u-tag/u-tag.js";
const _easycom_z_paging = () => "../../uni_modules/z-paging/components/z-paging/z-paging.js";
if (!Math) {
(_easycom_up_dropdown_item + _easycom_up_dropdown + _easycom_up_tag + _easycom_z_paging)();
}
const _sfc_main = {
__name: "order",
setup(__props) {
const { navTo } = hooks_useNav.useNav();
const paging = common_vendor.ref(null);
let dataList = common_vendor.ref([]);
let dataFrom = common_vendor.reactive({
status: "",
businessPayType: "",
sourceType: ""
});
common_vendor.ref([
{
label: "商品",
value: 1
},
{
label: "套餐",
value: 2
}
]);
let options2 = common_vendor.ref([
{
label: "微信",
value: 1
},
{
label: "支付宝",
value: 2
},
{
label: "钱包",
value: 3
}
]);
let options3 = common_vendor.ref([
{
label: "待支付",
value: 0
},
{
label: "支付成功",
value: 1
},
{
label: "取消",
value: -1
},
{
label: "退款",
value: -2
}
]);
let isPagingRefNotFound = () => {
return !paging.value;
};
common_vendor.onPullDownRefresh(() => {
if (isPagingRefNotFound())
return;
paging.value.reload().catch(() => {
});
});
common_vendor.onPageScroll((e) => {
if (isPagingRefNotFound())
return;
paging.value.updatePageScrollTop(e.scrollTop);
e.scrollTop < 10 && paging.value.doChatRecordLoadMore();
});
common_vendor.onReachBottom(() => {
if (isPagingRefNotFound())
return;
paging.value.pageReachBottom();
});
const upChange = (e) => {
console.log(dataFrom);
paging.value.reload();
};
const queryList = (pageNo, pageSize) => {
common_vendor.index.getStorageSync("user");
const params = {
current: pageNo,
pageSize,
...dataFrom
};
api_api.orderPage(params).then((res) => {
paging.value.complete(res.records);
}).catch((res) => {
paging.value.complete(false);
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(upChange),
b: common_vendor.o(($event) => common_vendor.unref(dataFrom).businessPayType = $event),
c: common_vendor.p({
title: "支付类型",
options: common_vendor.unref(options2),
modelValue: common_vendor.unref(dataFrom).businessPayType
}),
d: common_vendor.o(upChange),
e: common_vendor.o(($event) => common_vendor.unref(dataFrom).status = $event),
f: common_vendor.p({
title: "状态",
options: common_vendor.unref(options3),
modelValue: common_vendor.unref(dataFrom).status
}),
g: common_vendor.f(common_vendor.unref(dataList), (i, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(i.orderNo),
b: i.status == 0
}, i.status == 0 ? {
c: "93207a4f-4-" + i0 + ",93207a4f-0",
d: common_vendor.p({
size: "mini",
text: "待支付",
plain: true
})
} : {}, {
e: i.status == -1
}, i.status == -1 ? {
f: "93207a4f-5-" + i0 + ",93207a4f-0",
g: common_vendor.p({
size: "mini",
text: "已取消",
type: "warning",
plain: true
})
} : {}, {
h: i.status == 1
}, i.status == 1 ? {
i: "93207a4f-6-" + i0 + ",93207a4f-0",
j: common_vendor.p({
size: "mini",
text: "支付成功",
type: "success",
plain: true
})
} : {}, {
k: i.status == -2
}, i.status == -2 ? {
l: "93207a4f-7-" + i0 + ",93207a4f-0",
m: common_vendor.p({
size: "mini",
text: "退款",
type: "error",
plain: true
})
} : {}, {
n: JSON.parse(i.picture)[0],
o: "93207a4f-8-" + i0 + ",93207a4f-0",
p: common_vendor.p({
size: "mini",
text: i.sourceType == 1 ? "商品" : "套餐",
bgColor: "#4874e5",
borderColor: "#4874e5"
}),
q: common_vendor.t(i.goodName),
r: common_vendor.t(i.num),
s: common_vendor.t(i.amount),
t: common_vendor.t(common_vendor.unref(uni_modules_uviewPlus_libs_function_index.timeFormat)(new Date(i.createTime).getTime(), "yyyy-mm-dd hh:MM")),
v: i.orderPlatform == 3
}, i.orderPlatform == 3 ? {
w: "93207a4f-9-" + i0 + ",93207a4f-0",
x: common_vendor.p({
size: "mini",
text: "支付宝",
plain: true
})
} : {}, {
y: i.orderPlatform == 2
}, i.orderPlatform == 2 ? {
z: "93207a4f-10-" + i0 + ",93207a4f-0",
A: common_vendor.p({
size: "mini",
text: "微信",
type: "success",
plain: true
})
} : {}, {
B: i.orderPlatform == 1
}, i.orderPlatform == 1 ? {
C: "93207a4f-11-" + i0 + ",93207a4f-0",
D: common_vendor.p({
size: "mini",
text: "钱包",
type: "warning",
plain: true
})
} : {}, {
E: i,
F: common_vendor.o(($event) => common_vendor.unref(navTo)(`/pages/order/details?id=${i.id}`))
});
}),
h: () => ({
r: paging,
k: "paging"
}),
i: common_vendor.o(queryList),
j: common_vendor.o(($event) => common_vendor.isRef(dataList) ? dataList.value = $event : dataList = $event),
k: common_vendor.p({
["use-page-scroll"]: true,
modelValue: common_vendor.unref(dataList)
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-93207a4f"]]);
_sfc_main.__runtimeHooks = 1;
my.createPage(MiniProgramPage);