36 lines
974 B
JavaScript
36 lines
974 B
JavaScript
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
|
Page({
|
|
data: {
|
|
brand: {},
|
|
trustContent: [],
|
|
records: [],
|
|
},
|
|
onLoad() {
|
|
loadWorkspaceWithFallback().then((workspace) =>
|
|
this.setData({
|
|
brand: workspace.brand || {},
|
|
trustContent: workspace.trustContent || [],
|
|
records: wx.getStorageSync("linjingInquiryRecords") || [],
|
|
}),
|
|
);
|
|
},
|
|
onShow() {
|
|
this.setData({ records: wx.getStorageSync("linjingInquiryRecords") || [] });
|
|
},
|
|
call() {
|
|
wx.makePhoneCall({ phoneNumber: (this.data.brand.contactPhone || "").replace(/[^0-9-]/g, "") });
|
|
},
|
|
copyWechat() {
|
|
wx.setClipboardData({
|
|
data: this.data.brand.contactWechat || "",
|
|
success: () => wx.showToast({ title: "微信号已复制", icon: "none" }),
|
|
});
|
|
},
|
|
recordsPage() {
|
|
wx.navigateTo({ url: "/pages/records/index" });
|
|
},
|
|
inquire() {
|
|
wx.navigateTo({ url: "/pages/inquiry/index" });
|
|
},
|
|
});
|