com_top_nav.js
856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var t = getApp(),os = t.globalData.setting;
Component({
properties: {
title:{
type: String,value: '你好'
},
bcolor:{
type: String,value: '#fff'
},
color:{
type: String,value: '#313131'
}
},
data: {
iurl: os.imghost,
height:0,
h1:0,
h2:0,
user_id:0
},
ready: function() {
let height= getApp().globalData.navBarHeight;
let menuInfo = getApp().globalData.menuInfo;
//-- 胶囊的高度 --
this.setData({height,h1:menuInfo.top,h2:menuInfo.height,user_id:getApp().globalData.user_id});
},
methods: {
go_back(){
let pages = getCurrentPages();
if (pages[pages.length - 2]) {
wx.navigateBack();
} else {
getApp().goto('/pages/index/index/index')
}
}
}
})