feat: 扫码商品详情页重设计 + 宣传主页 + nginx 路由完善
- public_product_screen: 1:1 复刻设计稿,新增商品介绍、批次防伪(自定义圆形印章)、完整商品参数表、门店营业时间、页脚链接 - app_theme: 完整品牌色系(brand/gray/accent/semantic) - shop model: 新增 business_hours 字段,public 接口同步返回 - nginx: 新增 /product/ → Flutter app 扫码入口,修复 /docs /download html 后缀兼容 - web/: 新增宣传主页、功能页、文档页、扫码 HTML 及设计资源 - app_shell: 界面优化 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,16 +37,17 @@ class _RouterNotifier extends ChangeNotifier {
|
||||
String? redirect(BuildContext context, GoRouterState state) {
|
||||
final authState = _ref.read(authStateProvider);
|
||||
final isLoggedIn = authState.isLoggedIn;
|
||||
final isLoginRoute = state.matchedLocation == '/login';
|
||||
final isPublicRoute = state.matchedLocation.startsWith('/product/');
|
||||
final loc = state.matchedLocation;
|
||||
final isPublicRoute = loc == '/login' ||
|
||||
loc.startsWith('/product/');
|
||||
final result = !authState.initialized
|
||||
? null
|
||||
: (!isLoggedIn && !isLoginRoute && !isPublicRoute)
|
||||
: (!isLoggedIn && !isPublicRoute)
|
||||
? '/login'
|
||||
: (isLoggedIn && isLoginRoute)
|
||||
: (isLoggedIn && loc == '/login')
|
||||
? '/stock-in'
|
||||
: null;
|
||||
debugPrint('[Router] redirect: location=${state.matchedLocation}'
|
||||
debugPrint('[Router] redirect: location=$loc'
|
||||
' initialized=${authState.initialized}'
|
||||
' isLoggedIn=$isLoggedIn'
|
||||
' → ${result ?? "null (no redirect)"}');
|
||||
@@ -71,7 +72,7 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
refreshListenable: notifier,
|
||||
redirect: notifier.redirect,
|
||||
routes: [
|
||||
// Public route — no auth, no shell nav bar
|
||||
// Public product scan — no auth, no shell nav bar
|
||||
GoRoute(
|
||||
path: '/product/:public_id',
|
||||
builder: (context, state) =>
|
||||
|
||||
Reference in New Issue
Block a user