refactor: 接入详情与咨询标准模块

This commit is contained in:
que01 committed 2026-09-22 22:50:32 +08:00
1 parent 4f48f69625
commit 39f60ddfc9
5 files changed
+7 -4

No files matched your search

+1
View File
@@ -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); },
});
+2 -1
View File
@@ -6,6 +6,7 @@
"brand-button": "/components/ui/brand-button/brand-button",
"brand-field": "/components/ui/brand-field/brand-field",
"brand-loading": "/components/ui/brand-loading/brand-loading",
"brand-empty": "/components/ui/brand-empty/brand-empty"
"brand-empty": "/components/ui/brand-empty/brand-empty",
"inquiry-form": "/components/modules/inquiry-form/inquiry-form"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="page"><view class="head"><text class="eyebrow">PRIVATE CONSULTATION</text><text class="title">私享测量预约</text><text class="sub">{{offering ? offering.name : '主理人亲自沟通,72 小时内反馈空间构想'}}</text></view><view class="form"><view wx:for="{{fields}}" wx:key="key" class="field"><text>{{item.label}}</text><input data-key="{{item.key}}" placeholder="{{item.placeholder}}" value="{{values[item.key]}}" bindinput="onInput"/></view><button class="submit" loading="{{submitting}}" bindtap="submit">提交定制需求</button><text class="privacy">信息仅用于本次方案沟通,我们不会向第三方披露。</text></view></view>
<view class="page"><view class="head"><text class="eyebrow">PRIVATE CONSULTATION</text><text class="title">私享测量预约</text><text class="sub">{{offering ? offering.name : '主理人亲自沟通,72 小时内反馈空间构想'}}</text></view><inquiry-form fields="{{fields}}" values="{{values}}" submitting="{{submitting}}" bind:input="onComponentInput" bind:submit="submit" /></view>
+2 -1
View File
@@ -1,5 +1,6 @@
{
"navigationBarTitleText": "服务详情",
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black"
"navigationBarTextStyle": "black",
"usingComponents": { "offering-detail": "/components/modules/offering-detail/offering-detail" }
}
+1 -1
View File
@@ -1 +1 @@
<view class="page" wx:if="{{item}}"><image class="hero" src="{{item.image}}" mode="aspectFill"/><view class="content"><text class="category">{{item.category}} · {{item.tag}}</text><text class="title">{{item.name}}</text><text class="series">{{item.series}}</text><text class="price">{{item.priceRange}}</text><view class="rule"/><text class="label">项目摘要</text><text class="desc">{{item.desc}} 本案位于{{item.area}},从建筑入口、材质触感到五金开合,均由主理人亲自参与深化。</text><view class="chips"><text wx:for="{{item.keywords}}" wx:key="*this">{{item}}</text></view><view class="section"><text class="label">定制流程</text><text class="body">私享沟通 → 上门实测 → 构造出图 → 实样确认 → 工坊试装 → 终生维护</text></view></view><view class="bar"><button bindtap="inquire">预约测量 / 获取方案</button></view></view>
<offering-detail wx:if="{{item}}" item="{{item}}" bind:inquire="inquire" />