新增运行时 openPage/takePageQuery,tabBar 页自动使用 switchTab 并传递参数 - 编译器写入 tabPages,并拒绝 navigateTo/redirectTo 到 tabBar 页或 switchTab 带参数 - 阿成首页、套餐、出摊、主理人、详情、记录、成功页跳转统一改用 openPage - 套餐筛选改用后台业务提供项分类;详情跳咨询时携带业务提供项 - 移除 capability-booking:小程序无入口且依赖已删除的 /public/brand,需求由咨询表单覆盖"
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
const { customerRequest, customerTokenKey } = require("../../utils/request");
|
|
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
|
const { openPage } = require("../../utils/navigation");
|
|
|
|
Page({
|
|
data: { record: {}, presentation: {} },
|
|
onLoad(options) {
|
|
loadWorkspaceWithFallback()
|
|
.then((workspace) =>
|
|
this.setData({ presentation: workspace.brand?.visualPresentation?.success || {} }),
|
|
)
|
|
.catch(() => {});
|
|
const record = wx.getStorageSync("latestInquirySubmission") || {};
|
|
if (record.id === options.id) this.setData({ record });
|
|
if (options.id && wx.getStorageSync(customerTokenKey())) {
|
|
customerRequest("/customer/inquiry-submissions/" + encodeURIComponent(options.id))
|
|
.then((submission) =>
|
|
this.setData({
|
|
record: {
|
|
...record,
|
|
id: submission.id,
|
|
status: submission.status === "new" ? "待处理" : submission.status,
|
|
createdAt: submission.createdAt,
|
|
offeringName: submission.offering?.name || record.offeringName || "品牌合作",
|
|
},
|
|
}),
|
|
)
|
|
.catch(() => {});
|
|
}
|
|
},
|
|
viewRecords() {
|
|
openPage("/pages/records/index");
|
|
},
|
|
home() {
|
|
openPage("/pages/index/index");
|
|
},
|
|
});
|