fix(order-list): ensure back button returns to user center instead of home page
这个提交包含在:
@@ -377,11 +377,17 @@ const handleBack = () => {
|
|||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
if (pages && pages.length > 1) {
|
if (pages && pages.length > 1) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
} else {
|
return;
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
const fromRoute = uni.getStorageSync('ORDER_PAGE_FROM');
|
||||||
|
if (fromRoute) {
|
||||||
|
uni.removeStorageSync('ORDER_PAGE_FROM');
|
||||||
|
uni.switchTab({ url: fromRoute });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/user/index'
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onThemeChanged = (key) => {
|
const onThemeChanged = (key) => {
|
||||||
|
|||||||
@@ -1333,6 +1333,7 @@ const navTo = (url) => {
|
|||||||
}
|
}
|
||||||
uni.switchTab({ url: '/pages/activity/list' });
|
uni.switchTab({ url: '/pages/activity/list' });
|
||||||
} else if (url === '/pages/order/list') {
|
} else if (url === '/pages/order/list') {
|
||||||
|
uni.setStorageSync('ORDER_PAGE_FROM', '/pages/user/index');
|
||||||
uni.switchTab({ url });
|
uni.switchTab({ url });
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({ url });
|
uni.navigateTo({ url });
|
||||||
|
|||||||
@@ -851,11 +851,16 @@ describe('ContentSecurityService & Compliance Architecture (TDD 微信内容安
|
|||||||
expect(content).toContain('nav-capsule-placeholder');
|
expect(content).toContain('nav-capsule-placeholder');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('必须包含智能返回上一级与首页兜底路由控制逻辑', () => {
|
it('必须包含智能返回上一级与针对个人中心等来源的返回兜底控制逻辑', () => {
|
||||||
const content = fs.readFileSync(orderListPath, 'utf-8');
|
const content = fs.readFileSync(orderListPath, 'utf-8');
|
||||||
expect(content).toContain('getCurrentPages()');
|
expect(content).toContain('getCurrentPages()');
|
||||||
expect(content).toContain('uni.navigateBack()');
|
expect(content).toContain('uni.navigateBack()');
|
||||||
expect(content).toContain('uni.switchTab');
|
expect(content).toContain('uni.switchTab');
|
||||||
|
expect(content).toContain('/pages/user/index');
|
||||||
|
|
||||||
|
const userIndexPath = path.join(rootDir, 'pwuniapp', 'pages', 'user', 'index.vue');
|
||||||
|
const userContent = fs.readFileSync(userIndexPath, 'utf-8');
|
||||||
|
expect(userContent).toContain("uni.setStorageSync('ORDER_PAGE_FROM', '/pages/user/index')");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('必须适配微信小程序胶囊安全避让变量与冷暖双主题', () => {
|
it('必须适配微信小程序胶囊安全避让变量与冷暖双主题', () => {
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户