refactor: 移除旧服务模型统一使用业务提供项
This commit is contained in:
1 parent
ca85a583ce
commit
844a3bd715
13 files changed
+92
-146
No files matched your search
@@ -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(() => {
|
||||
|
||||
@@ -25,7 +25,7 @@ Page({
|
||||
},
|
||||
selectService(event) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/booking/index?serviceId=" + encodeURIComponent(event.currentTarget.dataset.id),
|
||||
url: "/pages/booking/index?offeringId=" + encodeURIComponent(event.currentTarget.dataset.id),
|
||||
});
|
||||
},
|
||||
goServices() {
|
||||
|
||||
@@ -21,7 +21,7 @@ Page({
|
||||
return wx.showToast({ title: "请从品牌主页查看联系方式", icon: "none" });
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: "/pages/booking/index?serviceId=" + encodeURIComponent(this.data.item?.id || ""),
|
||||
url: "/pages/booking/index?offeringId=" + encodeURIComponent(this.data.item?.id || ""),
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -52,7 +52,7 @@ Page({
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: "/pages/booking/index?serviceId=" + encodeURIComponent(e.currentTarget.dataset.id),
|
||||
url: "/pages/booking/index?offeringId=" + encodeURIComponent(e.currentTarget.dataset.id),
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user