refactor: 统一小程序品牌运行时数据入口
This commit is contained in:
1 parent
accc113b2a
commit
947e6d1ac3
4 files changed
+58
-9
No files matched your search
@@ -1,18 +1,18 @@
|
||||
const { brand, trustContent } = require("../../utils/linjing-data");
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
Page({
|
||||
data: {
|
||||
brand, trustContent, records: [],
|
||||
brand: {}, trustContent: [], records: [],
|
||||
},
|
||||
onLoad() {
|
||||
this.setData({ records: wx.getStorageSync("linjingInquiryRecords") || [] });
|
||||
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: brand.phone.replace(/[^0-9-]/g, "") });
|
||||
wx.makePhoneCall({ phoneNumber: (this.data.brand.contactPhone || "").replace(/[^0-9-]/g, "") });
|
||||
},
|
||||
copyWechat() { wx.setClipboardData({ data: brand.wechat, success: () => wx.showToast({ title: "微信号已复制", icon: "none" }) }); },
|
||||
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" });
|
||||
|
||||
Reference in new issue
Block a user