|
@@ -169,6 +169,10 @@
|
|
|
type: [String, Number],
|
|
|
default: ''
|
|
|
},
|
|
|
+ bkUrl:{
|
|
|
+ type: [String, Number],
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
// 自定义返回逻辑
|
|
|
customBack: {
|
|
|
type: Function,
|
|
@@ -247,22 +251,22 @@
|
|
|
},
|
|
|
goBack() {
|
|
|
|
|
|
- if ('prodv4'==process.jphelp.NODE_ENV) {
|
|
|
-
|
|
|
- window.history.back()
|
|
|
-
|
|
|
+ //console.log("修复bug, 刷新后不能返回问题")
|
|
|
+
|
|
|
+ if(this.bkUrl){
|
|
|
+ uni.switchTab({
|
|
|
+ url:this.bkUrl
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
|
|
+ else if (typeof this.customBack === 'function') {
|
|
|
+ // 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
|
|
|
+ // 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
|
|
|
+ this.customBack.bind(this.$u.$parent.call(this))();
|
|
|
} else {
|
|
|
- // 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
|
|
|
- if (typeof this.customBack === 'function') {
|
|
|
- // 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
|
|
|
- // 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
|
|
|
- this.customBack.bind(this.$u.$parent.call(this))();
|
|
|
- } else {
|
|
|
- this.navberBack();
|
|
|
- }
|
|
|
+ this.navberBack();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
};
|