refactor(login-redirect): 统一登录跳转逻辑,提取公共方法
将多处手动调用登录弹窗的逻辑替换为公共的redirectTologin方法,简化代码并统一跳转处理流程
This commit is contained in:
@@ -64,7 +64,7 @@ export default {
|
||||
redirectTo(link) {
|
||||
if (link.wap_url) {
|
||||
if (this.$util.getCurrRoute() == this.$util.MEMBER_PAGE_URL && !this.storeToken) {
|
||||
this.$refs?.login?.open(link.wap_url);
|
||||
this.redirectTologin(link.wap_url)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,17 +205,14 @@ export default {
|
||||
if (option.order_id) this.order_id = option.order_id;
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologinOnShowLifecycle('/pages_order/list?status=' + this.orderStatus);
|
||||
return;
|
||||
}
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
this.getEvaluateConfig();
|
||||
this.getOrderStatus();
|
||||
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs?.login?.open('/pages_order/list?status=' + this.orderStatus, 'redirectTo');
|
||||
})
|
||||
}
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
},
|
||||
onUnload() {
|
||||
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
|
||||
|
||||
Reference in New Issue
Block a user