refactor: 接入详情与咨询标准模块
This commit is contained in:
1 parent
4f48f69625
commit
39f60ddfc9
5 files changed
+7
-4
No files matched your search
@@ -3,5 +3,6 @@ Page({
|
||||
data: { offering: null, submitting: false, values: { name: "", phone: "", city: "", doorType: "", note: "" }, fields: [{ key: "name", label: "联系人", placeholder: "请输入称呼" }, { key: "phone", label: "手机号码", placeholder: "请输入手机号" }, { key: "city", label: "项目所在城市", placeholder: "例如:上海 · 佘山" }, { key: "doorType", label: "希望定制的门类型", placeholder: "入户门 / 庭院门 / 室内门" }, { key: "note", label: "补充说明", placeholder: "告诉我们你的空间和需求" }] },
|
||||
onLoad(options) { this.setData({ offering: offerings.find((item) => item.id === options.offeringId) || null }); },
|
||||
onInput(e) { this.setData({ ["values." + e.currentTarget.dataset.key]: e.detail.value }); },
|
||||
onComponentInput(e) { this.setData({ ["values." + e.detail.key]: e.detail.value }); },
|
||||
submit() { const values = this.data.values; if (!values.name || !values.phone) return wx.showToast({ title: "请填写联系人和手机号", icon: "none" }); this.setData({ submitting: true }); setTimeout(() => { const id = "LJ" + Date.now().toString().slice(-8); const record = { id, offeringName: this.data.offering ? this.data.offering.name : "门系统定制咨询", type: values.doorType || "门系统定制", project: values.city || "待确认项目", status: "待主理人复核图纸", createdAt: new Date().toLocaleDateString("zh-CN"), values }; const records = wx.getStorageSync("linjingInquiryRecords") || []; wx.setStorageSync("linjingInquiryRecords", [record].concat(records)); this.setData({ submitting: false }); wx.redirectTo({ url: "/pages/inquiry-success/index?id=" + id }); }, 500); },
|
||||
});
|
||||
Reference in new issue
Block a user