This commit is contained in:
lik
2026-05-31 17:44:06 +08:00
parent 350da5f33a
commit 13a61896db
12 changed files with 318 additions and 27 deletions

11
app.js
View File

@@ -29,6 +29,16 @@ App({
resolve(null)
})
})
this.globalData.hospitalContactReady = new Promise((resolve) => {
API.resource.getHospitalContact().then((data) => {
this.globalData.hospitalContact = data.data.hospitalContact
resolve(data.data.hospitalContact)
}).catch((err) => {
console.error('获取医院联系电话失败', err)
resolve([])
})
})
},
onShow(options) {
@@ -86,5 +96,6 @@ App({
chatSocket: null,
services: [],
agreement: null,
hospitalContact: [],
}
})

View File

@@ -7,7 +7,8 @@
"pages/escort/recordlist",
"pages/escort/agreement",
"pages/mine/mine",
"pages/mine/about"
"pages/mine/about",
"pages/hospital/contact"
],
"window": {
"backgroundTextStyle": "light",

View File

@@ -235,7 +235,7 @@ page {
}
.order-btn {
background: linear-gradient(135deg, #D4A853 0%, #D4A853 100%);
background: linear-gradient(135deg, #6B8E7B 0%, #6B8E7B 100%);
color: #FFFFFF;
font-size: 30rpx;
font-weight: 600;
@@ -480,12 +480,12 @@ page {
}
.popup-submit-btn {
background: linear-gradient(135deg, #D4A853 0%, #D4A853 100%);
background: linear-gradient(135deg, #6B8E7B 0%, #6B8E7B 100%);
color: #FFFFFF;
font-size: 30rpx;
font-weight: 600;
padding: 24rpx 56rpx;
border-radius: 40rpx;
border-radius: 20rpx;
border: none;
line-height: 1.5;
}

View File

@@ -203,7 +203,7 @@ page {
display: flex;
align-items: center;
gap: 8rpx;
background: #2D6A4F;
background: #6B8E7B;
color: #FFFFFF;
font-size: 26rpx;
padding: 16rpx 28rpx;

View File

@@ -1,21 +1,23 @@
Page({
data: {
assistServices: [
{ id: 1, name: '陪诊', icon: 'heart-filled', iconColor: '#2D6A4F' },
{ id: 2, name: '代问诊', icon: 'chat-heart', iconColor: '#2D6A4F' },
{ id: 3, name: '代办买药', icon: 'cart-filled', iconColor: '#2D6A4F' },
{ id: 4, name: '代取结果', icon: 'draft-filled', iconColor: '#2D6A4F' },
{ id: 5, name: '检查预约', icon: 'calendar-1', iconColor: '#2D6A4F' },
{ id: 6, name: '出入院办理', icon: 'bridge', iconColor: '#2D6A4F' },
{ id: 7, name: 'vip陪诊', icon: 'user-vip-filled', iconColor: '#2D6A4F' },
{ id: 8, name: '其他助诊', icon: 'app-filled', iconColor: '#2D6A4F' }
escortServices: [
{ id: 1, name: '陪诊', icon: 'heart', url: '', type: '' },
{ id: 2, name: '代问诊', icon: 'chat-heart', url: '', type: '' },
{ id: 3, name: '代预约', icon: 'draft', url: '', type: '' },
{ id: 4, name: '其他助诊', icon: 'cooperate', url: '', type: '' },
],
otherServices: [
{ id: 1, name: '代探望', icon: 'apple', iconColor: '#D4A853' },
{ id: 2, name: '企业陪诊', icon: 'city-8', iconColor: '#D4A853' },
{ id: 3, name: '陪诊师入驻', icon: 'usergroup', iconColor: '#D4A853' },
{ id: 4, name: '商务合作', icon: 'command', iconColor: '#D4A853' },
]
{ id: 1, name: '代探望', icon: 'apple', url: '', type: '' },
{ id: 2, name: '企业陪诊', icon: 'city-8', url: '', type: '' },
{ id: 3, name: '陪诊师入驻', icon: 'usergroup', url: '', type: '' },
{ id: 4, name: '商务合作', icon: 'command', url: '', type: '' },
],
tools: [
{ id: 1, name: '医院电话', icon: 'call', url: 'pages/hospital/contact', type: 'page' },
{ id: 2, name: '科室排行', icon: 'ai-coordinate-system', url: '', type: '' },
{ id: 3, name: '医保备案', icon: 'system-code', url: '', type: '' },
{ id: 4, name: '医疗影像', icon: 'film-1', url: '', type: '' }
]
},
async onLoad() {
@@ -47,9 +49,29 @@ Page({
},
goToOtherServicesDetail(e) {
wx.showToast({
title: '建设中, 请电话联系!',
icon: 'none'
});
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/webview/index?url=' + encodeURIComponent(item.url) });
break;
default:
wx.showToast({
title: '建设中, 请电话联系!',
icon: 'none'
});
}
}
});

View File

@@ -47,7 +47,7 @@
<text class="section-more" bindtap="goToServiceList">全部 >></text>
</view>
<view class="assist-grid">
<view class="assist-item" wx:for="{{ assistServices }}" wx:key="id" bindtap="goToAssistDetail" data-id="{{ item.id }}">
<view class="assist-item" wx:for="{{ escortServices }}" wx:key="id" bindtap="goToAssistDetail" data-id="{{ item.id }}">
<view class="assist-icon-circle">
<t-icon name="{{ item.icon }}" class="assist-icon" style="color: #2D6A4F;" />
</view>
@@ -56,7 +56,25 @@
</view>
</view>
<!-- 其他服务 -->
<!-- 就诊工具 -->
<view class="tool-section">
<view class="section-header">
<view class="section-title-wrap">
<t-icon name="tools" class="section-icon" size="40rpx"/>
<text class="section-title">就医工具</text>
</view>
</view>
<view class="assist-grid">
<view class="assist-item" wx:for="{{ tools }}" wx:key="id" bindtap="goToOtherServicesDetail" data-item="{{ item }}">
<view class="assist-icon-circle">
<t-icon name="{{ item.icon }}" class="assist-icon" style="color: #2D6A4F;" />
</view>
<text class="assist-name">{{ item.name }}</text>
</view>
</view>
</view>
<!-- 其他业务 -->
<view class="other-section">
<view class="section-header">
<view class="section-title-wrap">
@@ -65,7 +83,7 @@
</view>
</view>
<view class="assist-grid">
<view class="assist-item" wx:for="{{ otherServices }}" wx:key="id" bindtap="goToOtherServicesDetail" data-id="{{ item.id }}">
<view class="assist-item" wx:for="{{ otherServices }}" wx:key="id" bindtap="goToOtherServicesDetail" data-item="{{ item }}">
<view class="assist-icon-circle">
<t-icon name="{{ item.icon }}" class="assist-icon" style="color: #2D6A4F;" />
</view>
@@ -73,4 +91,5 @@
</view>
</view>
</view>
</view>

View File

@@ -174,7 +174,7 @@ page {
/* 助诊服务 */
.assist-section {
background: #F0F8F2;
background: #FFFFFF;
padding: 50rpx 32rpx;
margin-top: 20rpx;
}
@@ -185,6 +185,12 @@ page {
margin-top: 20rpx;
}
.tool-section {
background: #FFFFFF;
padding: 50rpx 32rpx;
margin-top: 20rpx;
}
.section-header {
display: flex;
align-items: center;

57
pages/hospital/contact.js Normal file
View File

@@ -0,0 +1,57 @@
const app = getApp()
Page({
data: {
hospitalContact: [],
loading: true,
},
onLoad(options) {
this.loadHospitalContact()
},
loadHospitalContact() {
const appData = app.globalData
if (appData.hospitalContact && appData.hospitalContact.length > 0) {
this.setData({
hospitalContact: appData.hospitalContact,
loading: false,
})
} else if (appData.hospitalContactReady) {
appData.hospitalContactReady.then((data) => {
this.setData({
hospitalContact: data || [],
loading: false,
})
}).catch(() => {
this.setData({
hospitalContact: [],
loading: false,
})
})
} else {
this.setData({
hospitalContact: [],
loading: false,
})
}
},
onCallPhone(e) {
const phone = e.currentTarget.dataset.phone
if (!phone) return
wx.makePhoneCall({
phoneNumber: phone,
fail: (err) => {
console.error('拨打电话失败', err)
},
})
},
onShareAppMessage() {
return {
title: '医院联系电话',
path: '/pages/hospital/contact',
}
},
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,38 @@
<view class="container">
<view class="header">
<text class="title">北京主要医院联系电话</text>
<text class="subtitle">持续更新中, 仅供参考</text>
</view>
<view wx:if="{{loading}}" class="loading">
<text>加载中...</text>
</view>
<view wx:elif="{{hospitalContact.length === 0}}" class="empty">
<text>暂无医院联系信息</text>
</view>
<view wx:else class="list">
<view
class="item"
wx:for="{{hospitalContact}}"
wx:key="id"
>
<view class="info">
<text class="name">{{item.name}}</text>
<view class="phones">
<view
class="phone-wrap"
wx:for="{{item.phone}}"
wx:for-item="phone"
wx:key="*this"
data-phone="{{phone}}"
bindtap="onCallPhone"
>
<text class="phone">{{phone}}</text>
</view>
</view>
</view>
</view>
</view>
</view>

133
pages/hospital/contact.wxss Normal file
View File

@@ -0,0 +1,133 @@
page {
background-color: #F5F7F6;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.container {
min-height: 100vh;
padding-bottom: 32rpx;
}
/* 顶部导航栏 */
.nav-bar {
display: flex;
align-items: center;
padding: 120rpx 32rpx 20rpx 32rpx;
background: #FFFFFF;
}
.nav-logo {
display: flex;
align-items: center;
}
.logo-icon {
width: 56rpx;
height: 56rpx;
border-radius: 16rpx;
background: #FFFFFF;
padding: 4rpx;
}
.logo-text {
font-size: 36rpx;
font-weight: 700;
color: #1F2937;
margin-left: 16rpx;
}
/* Header区域 */
.header {
background: #FFFFFF;
padding: 24rpx 32rpx 40rpx 32rpx;
margin-bottom: 20rpx;
}
.title {
display: block;
font-size: 40rpx;
font-weight: 700;
color: #1F2937;
}
.subtitle {
display: block;
font-size: 26rpx;
color: #9CA3AF;
margin-top: 12rpx;
}
/* 加载和空状态 */
.loading,
.empty {
text-align: center;
padding: 120rpx 32rpx;
color: #9CA3AF;
font-size: 28rpx;
}
/* 列表区域 */
.list {
padding: 0 32rpx;
}
.item {
display: flex;
align-items: center;
justify-content: space-between;
background: #FFFFFF;
border-radius: 24rpx;
padding: 32rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
border: 2rpx solid #F0F0F0;
}
.info {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}
.name {
font-size: 30rpx;
font-weight: 700;
color: #1F2937;
line-height: 1.4;
margin-bottom: 16rpx;
word-wrap: break-word;
}
.phones {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 12rpx;
}
.phone-wrap {
display: flex;
align-items: center;
gap: 12rpx;
padding: 12rpx 20rpx;
background: #F5F7F6;
border-radius: 12rpx;
width: fit-content;
}
.phone {
font-size: 28rpx;
color: #2D6A4F;
line-height: 1.4;
font-weight: 500;
}
.action {
margin-left: 24rpx;
flex-shrink: 0;
}
.icon {
font-size: 40rpx;
}

View File

@@ -20,6 +20,7 @@ const API = {
resource: {
getServices: (params) => request.get('/health/service', params),
getAgreement: (params) => request.get('/health/agreement', params),
getHospitalContact: (params) => request.get('/health/hospital-contact', params),
},
ai: {