diff --git a/app.js b/app.js index 0a3ee86..6875b6e 100644 --- a/app.js +++ b/app.js @@ -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: [], } }) \ No newline at end of file diff --git a/app.json b/app.json index 90769b8..72d6707 100644 --- a/app.json +++ b/app.json @@ -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", diff --git a/pages/escort/itemdetail.wxss b/pages/escort/itemdetail.wxss index 14319c1..d82ea61 100644 --- a/pages/escort/itemdetail.wxss +++ b/pages/escort/itemdetail.wxss @@ -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; } diff --git a/pages/escort/itemlist.wxss b/pages/escort/itemlist.wxss index 011dae3..82da30c 100644 --- a/pages/escort/itemlist.wxss +++ b/pages/escort/itemlist.wxss @@ -203,7 +203,7 @@ page { display: flex; align-items: center; gap: 8rpx; - background: #2D6A4F; + background: #6B8E7B; color: #FFFFFF; font-size: 26rpx; padding: 16rpx 28rpx; diff --git a/pages/home/index.js b/pages/home/index.js index d84206d..7cec0a2 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -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' + }); + } } }); diff --git a/pages/home/index.wxml b/pages/home/index.wxml index 96d1304..109d7e2 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -47,7 +47,7 @@ 全部 >> - + @@ -56,7 +56,25 @@ - + + + + + + 就医工具 + + + + + + + + {{ item.name }} + + + + + @@ -65,7 +83,7 @@ - + @@ -73,4 +91,5 @@ + diff --git a/pages/home/index.wxss b/pages/home/index.wxss index 7c2ac26..4fcef42 100644 --- a/pages/home/index.wxss +++ b/pages/home/index.wxss @@ -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; diff --git a/pages/hospital/contact.js b/pages/hospital/contact.js new file mode 100644 index 0000000..c28e918 --- /dev/null +++ b/pages/hospital/contact.js @@ -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', + } + }, +}) diff --git a/pages/hospital/contact.json b/pages/hospital/contact.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/hospital/contact.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/hospital/contact.wxml b/pages/hospital/contact.wxml new file mode 100644 index 0000000..2c3a680 --- /dev/null +++ b/pages/hospital/contact.wxml @@ -0,0 +1,38 @@ + + + 北京主要医院联系电话 + 持续更新中, 仅供参考 + + + + 加载中... + + + + 暂无医院联系信息 + + + + + + {{item.name}} + + + {{phone}} + + + + + + diff --git a/pages/hospital/contact.wxss b/pages/hospital/contact.wxss new file mode 100644 index 0000000..53019ac --- /dev/null +++ b/pages/hospital/contact.wxss @@ -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; +} diff --git a/utils/api.js b/utils/api.js index 191324e..61774df 100644 --- a/utils/api.js +++ b/utils/api.js @@ -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: {