重构Main.viewDetails