feat: 完成真实咨询提交闭环
This commit is contained in:
1 parent
16b0967dc5
commit
ba0069ae6d
9 files changed
+259
-70
No files matched your search
@@ -1 +1,39 @@
|
||||
Page({ data: { records: [] }, onShow() { this.setData({ records: wx.getStorageSync("linjingInquiryRecords") || [] }); }, inquire() { wx.navigateTo({ url: "/pages/inquiry/index" }); } });
|
||||
const { customerRequest } = require("../../utils/request");
|
||||
|
||||
const statusLabels = {
|
||||
new: "待处理",
|
||||
reviewing: "沟通中",
|
||||
replied: "已回复",
|
||||
qualified: "已确认",
|
||||
converted: "已转化",
|
||||
closed: "已关闭",
|
||||
};
|
||||
|
||||
Page({
|
||||
data: { records: [], loading: false },
|
||||
onShow() {
|
||||
if (!wx.getStorageSync("customerToken")) return this.setData({ records: [] });
|
||||
this.setData({ loading: true });
|
||||
customerRequest("/customer/inquiry-submissions")
|
||||
.then((items) =>
|
||||
this.setData({
|
||||
loading: false,
|
||||
records: items.map((item) => ({
|
||||
...item,
|
||||
type: item.inquiryForm?.name || "品牌咨询",
|
||||
status: statusLabels[item.status] || item.status,
|
||||
project: "咨询记录",
|
||||
offeringName: item.offering?.name || "品牌合作",
|
||||
createdAt: new Date(item.createdAt).toLocaleDateString("zh-CN"),
|
||||
})),
|
||||
}),
|
||||
)
|
||||
.catch((error) => {
|
||||
this.setData({ loading: false });
|
||||
wx.showToast({ title: error.message || "记录加载失败", icon: "none" });
|
||||
});
|
||||
},
|
||||
inquire() {
|
||||
wx.navigateTo({ url: "/pages/inquiry/index" });
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user