From b4f63efb3ccdec4a9acce5d5bad65e663e29987c Mon Sep 17 00:00:00 2001 From: tamguo Date: Fri, 31 Aug 2018 17:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=A0=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tamguo/web/tiku/CourseController.java | 7 +- .../resources/templates/mobile/chapter.html | 178 ++++++++++++++++++ 2 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 tamguo-tms/src/main/resources/templates/mobile/chapter.html diff --git a/tamguo-tms/src/main/java/com/tamguo/web/tiku/CourseController.java b/tamguo-tms/src/main/java/com/tamguo/web/tiku/CourseController.java index 0fa4b21..37d7d8c 100644 --- a/tamguo-tms/src/main/java/com/tamguo/web/tiku/CourseController.java +++ b/tamguo-tms/src/main/java/com/tamguo/web/tiku/CourseController.java @@ -23,6 +23,7 @@ import com.tamguo.modules.tiku.service.IBookService; import com.tamguo.modules.tiku.service.IChapterService; import com.tamguo.modules.tiku.service.ICourseService; import com.tamguo.modules.tiku.service.ISubjectService; +import com.tamguo.utils.BrowserUtils; /** * Controller - 科目 @@ -65,7 +66,11 @@ public class CourseController { model.addObject("subject", subject); model.addObject("bookList", bookList); model.addObject("book" , book); - model.setViewName("chapter"); + if(BrowserUtils.isMobile(request.getHeader("user-agent"))) { + model.setViewName("mobile/chapter"); + }else { + model.setViewName("chapter"); + } return model; } diff --git a/tamguo-tms/src/main/resources/templates/mobile/chapter.html b/tamguo-tms/src/main/resources/templates/mobile/chapter.html new file mode 100644 index 0000000..9a30faa --- /dev/null +++ b/tamguo-tms/src/main/resources/templates/mobile/chapter.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ 上海 +
+ +
+ +
+ + +
+ + + + + +
+

+ 章节学习更多 +

+
+
    +
  • + +
    +
    +
    +
    +
    + +
  • +
+
+
+ +
+ + + + +
+ +
+
+ + + + \ No newline at end of file