This commit is contained in:
lik
2026-05-31 20:12:53 +08:00
parent 87c852b6a9
commit c121ebdb94
8 changed files with 93 additions and 16 deletions

View File

@@ -9,7 +9,8 @@
"pages/mine/mine",
"pages/mine/about",
"pages/hospital/contact",
"pages/hospital/ranking"
"pages/hospital/ranking",
"pages/home/webview"
],
"window": {
"backgroundTextStyle": "light",

View File

@@ -16,7 +16,7 @@ Page({
{ id: 1, name: '医院电话', icon: 'call', url: 'pages/hospital/contact', type: 'page' },
{ id: 2, name: '科室排行', icon: 'ai-coordinate-system', url: 'pages/hospital/ranking', type: 'page' },
{ id: 3, name: '医保备案', icon: 'system-code', url: '#小程序://异地备案/FfXUvTLmNptZx5E', type: 'wxapp' },
{ id: 4, name: '医疗影像', icon: 'film-1', url: 'https://www.114yygh.com/', type: 'website' }
{ id: 4, name: '医疗影像', icon: 'film-1', url: '', type: '' }
]
},
@@ -65,7 +65,7 @@ Page({
wx.switchTab({ url: '/' + item.url });
break;
case 'website':
wx.navigateTo({ url: '/pages/webview/index?url=' + encodeURIComponent(item.url) });
wx.navigateTo({ url: '/pages/home/webview?url=' + encodeURIComponent(item.url) });
break;
case 'wxapp':
wx.navigateToMiniProgram({ shortLink: item.url, env: 'release' })

70
pages/home/webview.js Normal file
View File

@@ -0,0 +1,70 @@
// pages/home/webview.js
Page({
/**
* 页面的初始数据
*/
data: {
url: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
if (options.url) {
this.setData({
url: decodeURIComponent(options.url)
});
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/home/webview.json Normal file
View File

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

2
pages/home/webview.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/home/webview.wxml-->
<web-view src="{{url}}"></web-view>

1
pages/home/webview.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/home/webview.wxss */

View File

@@ -2,36 +2,36 @@ const app = getApp()
Page({
data: {
hospitalContact: [],
hospitalInfo: [],
loading: true,
},
onLoad(options) {
this.loadHospitalContact()
this.loadhospitalInfo()
},
loadHospitalContact() {
loadhospitalInfo() {
const appData = app.globalData
if (appData.hospitalContact && appData.hospitalContact.length > 0) {
if (appData.hospitalInfo && appData.hospitalInfo.length > 0) {
this.setData({
hospitalContact: appData.hospitalContact,
hospitalInfo: appData.hospitalInfo,
loading: false,
})
} else if (appData.hospitalContactReady) {
appData.hospitalContactReady.then((data) => {
} else if (appData.hospitalInfoReady) {
appData.hospitalInfoReady.then((data) => {
this.setData({
hospitalContact: data || [],
hospitalInfo: data || [],
loading: false,
})
}).catch(() => {
this.setData({
hospitalContact: [],
hospitalInfo: [],
loading: false,
})
})
} else {
this.setData({
hospitalContact: [],
hospitalInfo: [],
loading: false,
})
}