You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
959 B
61 lines
959 B
5 years ago
|
// components/navbar/index.js
|
||
|
const App = getApp();
|
||
|
|
||
|
Component({
|
||
|
options: {
|
||
|
addGlobalClass: true,
|
||
|
},
|
||
|
externalClasses: ['custom-class'],
|
||
|
/**
|
||
|
* 组件的属性列表
|
||
|
*/
|
||
|
properties: {
|
||
|
pageName:String,
|
||
|
showNav: {
|
||
|
type: Boolean,
|
||
|
value: true
|
||
|
},
|
||
|
bgColor:{
|
||
|
type: String,
|
||
|
value: '#fff'
|
||
|
},
|
||
|
iconColor:{
|
||
|
type: String,
|
||
|
value: '#000'
|
||
|
}
|
||
|
},
|
||
|
|
||
|
/**
|
||
|
* 组件的初始数据
|
||
|
*/
|
||
|
data: {
|
||
|
|
||
|
},
|
||
|
lifetimes: {
|
||
|
attached: function () {
|
||
|
this.setData({
|
||
|
navHeight: App.globalData.navHeight,
|
||
|
navTop: App.globalData.navTop
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
/**
|
||
|
* 组件的方法列表
|
||
|
*/
|
||
|
methods: {
|
||
|
//回退
|
||
|
_navBack: function () {
|
||
|
wx.setStorageSync('isBackOpen', true)
|
||
|
wx.navigateBack({
|
||
|
delta: 1
|
||
|
})
|
||
|
},
|
||
|
//回主页
|
||
|
_toIndex: function () {
|
||
|
wx.reLaunch({
|
||
|
url: '/pages/index/index'
|
||
|
})
|
||
|
},
|
||
|
}
|
||
|
})
|