38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
const app = getApp()
|
||
Page({
|
||
data: {
|
||
navbarData: {
|
||
showCapsule: 0, //是否显示左上角图标 1表示显示 0表示不显示
|
||
title: '问诊消息', //导航栏 中间的标题
|
||
},
|
||
height: app.globalData.height,
|
||
has_data: true
|
||
},
|
||
|
||
onShow: function () {
|
||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||
this.getTabBar().setData({
|
||
active: 1 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
|
||
})
|
||
}
|
||
},
|
||
|
||
go(e){
|
||
wx.navigateTo({
|
||
url: e.currentTarget.dataset.url,
|
||
events: {
|
||
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
|
||
acceptDataFromOpenedPage: function(data) {
|
||
console.log(data)
|
||
},
|
||
someEvent: function(data) {
|
||
console.log(data)
|
||
}
|
||
},
|
||
success: function(res) {
|
||
// 通过 eventChannel 向被打开页面传送数据
|
||
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
|
||
}
|
||
})
|
||
}
|
||
}) |