52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
const { bookingDetail } = require("../../mock/photoBook");
|
|
|
|
function getStatusClass(status) {
|
|
if ((status || "").includes("取消")) {
|
|
return "ui-pill-error";
|
|
}
|
|
if ((status || "").includes("待")) {
|
|
return "ui-pill-pending";
|
|
}
|
|
return "ui-pill-success";
|
|
}
|
|
|
|
Page({
|
|
data: {
|
|
detail: bookingDetail,
|
|
statusClass: getStatusClass(bookingDetail.status),
|
|
},
|
|
|
|
onTapCancel() {
|
|
wx.showModal({
|
|
title: "取消预约",
|
|
content: "确认取消后可重新预约,是否继续?",
|
|
confirmColor: "#E5484D",
|
|
success: (res) => {
|
|
if (!res.confirm) {
|
|
return;
|
|
}
|
|
this.setData({
|
|
"detail.status": "已取消",
|
|
statusClass: "ui-pill-error",
|
|
});
|
|
wx.showToast({
|
|
title: "已发起取消申请",
|
|
icon: "none",
|
|
});
|
|
},
|
|
});
|
|
},
|
|
|
|
onTapContact() {
|
|
wx.setClipboardData({
|
|
data: this.data.detail.contact,
|
|
success: () => {
|
|
wx.showToast({
|
|
title: "联系方式已复制",
|
|
icon: "none",
|
|
});
|
|
},
|
|
});
|
|
},
|
|
});
|