Page({ data: { contact: { icon: 'logo-wechat-stroke', phone: '18618162956' }, services: {}, }, async onLoad() { const app = getApp() const services = await app.globalData.servicesReady this.setData({ services: services.sort((a, b) => parseFloat(a.price) - parseFloat(b.price)) }); }, makePhoneCall() { const phoneNumber = this.data.contact.phone; wx.makePhoneCall({ phoneNumber: phoneNumber, success: () => { console.log('拨打电话成功'); }, fail: () => { console.log('拨打电话失败'); } }); }, goToDetail(e) { const id = e.currentTarget.dataset.id; wx.navigateTo({ url: `/pages/itemdetail/itemdetail?id=${id}` }); }, goToAIChat() { wx.switchTab({ url: '/pages/ai/aichat/aichat' }); } });