refactor: 移除旧服务模型统一使用业务提供项

This commit is contained in:
que01 committed 2026-09-21 17:11:45 +08:00
1 parent ca85a583ce
commit 844a3bd715
13 files changed
+92 -146

No files matched your search

+5 -5
View File
@@ -4,7 +4,7 @@ Page({
data: {
service: {},
form: {},
serviceId: "",
offeringId: "",
quantity: 1,
fulfillment: "pickup",
submitting: false,
@@ -15,12 +15,12 @@ Page({
.then(([services, brand]) => {
const list = Array.isArray(services) ? services : [];
const service =
list.find((item) => item.id === query.serviceId) ||
list.find((item) => item.id === query.offeringId || item.id === query.serviceId) ||
list.find((item) => item.priceAmount !== null) ||
{};
this.setData({
service,
serviceId: service.id || "",
offeringId: service.id || "",
template: getTemplate(brand.templateKey),
});
})
@@ -40,7 +40,7 @@ Page({
},
submit() {
const form = this.data.form;
if (!this.data.serviceId) return wx.showToast({ title: "请先选择服务", icon: "none" });
if (!this.data.offeringId) return wx.showToast({ title: "请先选择服务", icon: "none" });
if (!form.customerName || !form.wechatId)
return wx.showToast({ title: "请填写称呼和联系方式", icon: "none" });
if (this.data.fulfillment === "delivery" && !form.deliveryAddress)
@@ -58,7 +58,7 @@ Page({
deliveryAddress: form.deliveryAddress,
requestedTime: form.requestedTime,
note: form.note,
items: [{ serviceId: this.data.serviceId, quantity: this.data.quantity }],
items: [{ offeringId: this.data.offeringId, quantity: this.data.quantity }],
},
})
.then(() => {