Files
ws_health/xui/wxapp/pages/index/index.js
2026-05-25 12:34:16 +08:00

43 lines
858 B
JavaScript

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'
});
}
});