acdr-ui/dist/dev/mp-weixin/modules/pet/order/take.js

94 lines
3.0 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
2024-10-01 09:15:35 +08:00
const common_vendor = require("../../../common/vendor.js");
const utils_http = require("../../../utils/http.js");
2024-09-19 07:20:14 +08:00
if (!Array) {
const _component_layout_default_uni = common_vendor.resolveComponent("layout-default-uni");
_component_layout_default_uni();
}
if (!Math) {
OrderItem();
}
const OrderItem = () => "./components/OrderItem.js";
const _sfc_main = {
__name: "take",
setup(__props) {
const orders = common_vendor.ref([]);
const refresh = () => __async(this, null, function* () {
yield fetchOrders();
});
const fetchOrders = () => __async(this, null, function* () {
try {
const response = yield utils_http.httpPost("/order/ptOrdersInfo");
if (response.code === 200) {
orders.value = response.records;
} else {
console.error("订单数据获取失败", response.message);
}
} catch (error) {
console.error("订单数据获取失败", error);
}
});
2024-10-01 09:15:35 +08:00
common_vendor.onLoad(() => {
2024-09-19 07:20:14 +08:00
fetchOrders();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(orders.value, (order, k0, i0) => {
return {
a: order.id,
b: common_vendor.o(refresh, order.id),
2024-10-01 09:15:35 +08:00
c: "70423df4-1-" + i0 + ",70423df4-0",
2024-09-19 07:20:14 +08:00
d: common_vendor.p({
id: order.id,
userId: order.userId,
reservationTime: order.reservationTime,
serviceHours: order.serviceHours,
personalServiceId: order.personalServiceId,
personalServiceUserId: order.personalServiceUserId,
price: order.price,
isPay: order.isPay,
feedback: order.feedback,
star: order.star,
state: order.state,
paymentMethod: order.paymentMethod,
qrcode: order.qrcode,
createTime: order.createTime,
updateTime: order.updateTime,
address: order.address,
pet: order.pet,
user: order.user,
psUser: order.psUser,
serviceInfo: order.serviceInfo,
isTake: true
}),
e: order.id
};
}),
b: orders.value.length === 0
}, orders.value.length === 0 ? {} : {});
};
}
};
2024-10-01 09:15:35 +08:00
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-70423df4"]]);
2024-09-19 07:20:14 +08:00
wx.createPage(MiniProgramPage);