Files
wxapp_escort/pages/home/index.js

168 lines
3.2 KiB
JavaScript

Page({
data: {
escortServices: [{
id: 1,
name: '陪诊',
icon: 'heart',
iconColor: '#E11D48',
bgColor: '#FFF1F2'
},
{
id: 2,
name: '代问诊',
icon: 'chat-heart',
iconColor: '#EA580C',
bgColor: '#FFF7ED'
},
{
id: 3,
name: '代办理',
icon: 'fact-check',
iconColor: '#059669',
bgColor: '#ECFDF5'
},
{
id: 8,
name: '其他助诊',
icon: 'app',
iconColor: '#2563EB',
bgColor: '#EFF6FF'
}
],
otherServices: [{
id: 1,
name: '代探望',
icon: 'apple',
url: '',
type: '',
iconColor: '#7C3AED',
bgColor: '#F5F3FF'
},
{
id: 2,
name: '企业陪诊',
icon: 'city-8',
url: '',
type: '',
iconColor: '#D97706',
bgColor: '#FFFBEB'
},
{
id: 3,
name: '陪诊师入驻',
icon: 'usergroup',
url: '',
type: '',
iconColor: '#4F46E5',
bgColor: '#EEF2FF'
},
{
id: 4,
name: '商务合作',
icon: 'command',
url: '',
type: '',
iconColor: '#0D9488',
bgColor: '#F0FDFA'
},
],
tools: [{
id: 1,
name: '预约记录',
icon: 'assignment',
url: 'pages/escort/recordlist',
type: 'page',
iconColor: '#0891B2',
bgColor: '#ECFEFF'
},
{
id: 2,
name: '健康档案',
icon: 'attach',
url: '',
type: '',
iconColor: '#DB2777',
bgColor: '#FDF2F8'
}
]
},
onShareAppMessage() {
return {
title: '暖橙陪诊', // 转发标题
path: '/pages/home/index',
}
},
onShareTimeline: function () {
return {
title: '暖橙陪诊',
}
},
async onLoad() {},
goToAiChat() {
wx.switchTab({
url: '/pages/ai/aichat'
});
},
goToContact() {
wx.makePhoneCall({
phoneNumber: '18618162956'
});
},
goToServiceList() {
wx.navigateTo({
url: '/pages/escort/itemlist'
});
},
goToAssistDetail(e) {
const id = e.currentTarget.dataset.id;
wx.navigateTo({
url: `/pages/escort/itemlist?assistId=${id}`
});
},
goToOtherServicesDetail(e) {
const item = e.currentTarget.dataset.item;
if (!item || !item.type || !item.url) {
wx.showToast({
title: '建设中...',
icon: 'none'
});
return;
}
switch (item.type) {
case 'page':
wx.navigateTo({
url: '/' + item.url
});
break;
case 'tab':
wx.switchTab({
url: '/' + item.url
});
break;
case 'website':
wx.navigateTo({
url: '/pages/home/webview?url=' + encodeURIComponent(item.url)
});
break;
case 'wxapp':
wx.navigateToMiniProgram({
shortLink: item.url,
env: 'release'
})
break;
default:
wx.showToast({
title: '建设中...',
icon: 'none'
});
}
}
});