The belonging service team is a child page, and the registered service team is a parent page, and the pages are as follows:
in subpage
methods: { //Go back to the previous page goBcak(item) { let pages = getCurrentPages(); // Get the instance of the current page stack, given in the form of an array in the order of the stack, the first element is the homepage, the last one The element is the current page. let nowPage = pages[pages.length - 1]; //Current page page instance let prevPage = pages[pages.length - 2]; //Previous page page instance let object = { classname: item.classname }; prevPage. $vm.otherFun(object) // Bind method otherFun to the previous page, pass parameters object uni.navigateBack({ delta: 1 // You can not pass the delta value, the default is 1 }) },
}
on parent page
onLoad(option) {
if (option != {}) {
this.model.serve = option.classname;
}
this.PostSysDictionaryData()
},
methods: {
otherFun(object) {
if (object) {
this.model.serve = object.classname;
} else {
return
}
},// The page enters the belonging service team
gohome() { // console.log('11') uni.navigateTo({ url: '../BelongTo/BelongTo' }) },
}