项目需求如图:
2号页面跳转3号页面时用了路由替换
<view class="commitButton" @tap="submitApplication">提交申请</view>
submitApplication(){
// console.log(this.form);
this.jump('/pageCommons/feedback/feedbackSuccess');
},
// 路由跳转
jump(path, parmas) {
this.$Router.replace({
path: path,
query: parmas
});
},
3号页面返回1号页面:
<view class="backBtn" @tap="getback">关闭</view>
getback(){
//#ifdef H5
this.$router.go(-1);//返回上一层
//#endif
//#ifdef MP-WEIXIN
uni.navigateBack({
delta: 1
});
//#endif
}
用了条件编译,H5端用this.$router.go(-1);微信小程序调用底层方法uni.navigateBack