haomingming e7be139b04 优化
2023-04-26 09:57:07 +08:00

50 lines
958 B
JavaScript

// commpents/te_navbar/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
navbarData: { //navbarData 由父页面传递的数据,变量名字自命名
type: Object,
value: {
showCapsule: 1, //是否显示胶囊
title: '标题文字', //导航栏 中间的标题}
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onBack() {
console.log("onBackonBackonBack");
let back_url = this.data.navbarData.back_url;
let back_url_type = this.data.navbarData.back_url_type;
if(back_url){
if(back_url_type == 0){
app.go(back_url);
}else{
wx.reLaunch({
url: back_url,
});
}
}else{
wx.navigateBack();
}
},
onGoHome() {
wx.reLaunch({
url: '/Pages/index/index?from=navbar',
});
},
},
})