tmp
This commit is contained in:
3
app.json
3
app.json
@@ -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",
|
||||
|
||||
@@ -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' })
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
<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" />
|
||||
</view>
|
||||
<text class="assist-name">{{ item.name }}</text>
|
||||
<t-icon name="{{ item.icon }}" class="assist-icon" />
|
||||
</view>
|
||||
<text class="assist-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
70
pages/home/webview.js
Normal file
70
pages/home/webview.js
Normal 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
3
pages/home/webview.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
pages/home/webview.wxml
Normal file
2
pages/home/webview.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/home/webview.wxml-->
|
||||
<web-view src="{{url}}"></web-view>
|
||||
1
pages/home/webview.wxss
Normal file
1
pages/home/webview.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/home/webview.wxss */
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user