diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java index a40b7dc..cea158a 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java @@ -12,6 +12,7 @@ import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand; import org.jeecg.modules.demo.appletBooks.entity.AppletBooks; import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize; import org.jeecg.modules.demo.appletCourse.entity.AppletCourse; +import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage; import org.jeecg.modules.demo.appletLabel.entity.AppletLabel; import org.springframework.beans.factory.annotation.Autowired; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -154,4 +155,22 @@ public class AppletApiBooksController { return Result.OK(Courses); } + + @IgnoreAuth + @Operation(summary = "获取课程页面列表", description = "根据课程id获取页面列表") + @GetMapping(value = "/coursePage") + public Result> coursePage(@Parameter(description = "课程id") String id) { + List Courses = appletApiBooksService.getCoursesPage(id); + return Result.OK(Courses); + } + + + @IgnoreAuth + @Operation(summary = "获取课程页面详情", description = "页面id") + @GetMapping(value = "/coursesPageDetail") + public Result getCoursesPageDetail(@Parameter(description = "页面id") String id) { + AppletCoursePage Courses = appletApiBooksService.getCoursesPageDetail(id); + return Result.OK(Courses); + } + } \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java index ddb60ea..5dca954 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiBooksService.java @@ -6,6 +6,7 @@ import org.jeecg.modules.demo.appletBookStand.entity.AppletBookStand; import org.jeecg.modules.demo.appletBooks.entity.AppletBooks; import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize; import org.jeecg.modules.demo.appletCourse.entity.AppletCourse; +import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage; import org.jeecg.modules.demo.appletLabel.entity.AppletLabel; import java.util.List; @@ -47,6 +48,10 @@ public interface AppletApiBooksService { */ IPage getCourses(Page coursePage, String id); + List getCoursesPage(String id); + + AppletCoursePage getCoursesPageDetail(String id); + List getLabel(); List category(); diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java index 2aa4a57..fb92bde 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java @@ -18,6 +18,8 @@ import org.jeecg.modules.demo.appletCategorize.entity.AppletCategorize; import org.jeecg.modules.demo.appletCategorize.service.IAppletCategorizeService; import org.jeecg.modules.demo.appletCourse.entity.AppletCourse; import org.jeecg.modules.demo.appletCourse.service.IAppletCourseService; +import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage; +import org.jeecg.modules.demo.appletCoursePage.service.IAppletCoursePageService; import org.jeecg.modules.demo.appletLabel.entity.AppletLabel; import org.jeecg.modules.demo.appletLabel.service.IAppletLabelService; import org.jeecg.modules.demo.appletVip.service.IAppletVipService; @@ -45,6 +47,8 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService { private IAppletCategorizeService appletCategorizeService; @Autowired private IAppletVipService appletVipService; + @Autowired + private IAppletCoursePageService appletCoursePageService; /** * 查询书籍列表 @@ -236,4 +240,22 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService { return book; } + @Override + public List getCoursesPage(String id){ + return appletCoursePageService.lambdaQuery() + .eq(AppletCoursePage::getCourseId, id) + .eq(AppletCoursePage::getStatus, "Y") + .orderByAsc(AppletCoursePage::getSort) + .select(AppletCoursePage::getId, + AppletCoursePage::getTitle, + AppletCoursePage::getPay + ) + .list(); + } + + @Override + public AppletCoursePage getCoursesPageDetail(String id){ + return appletCoursePageService.getById(id); + } + } diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java index 15720ef..7fcbc6c 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java @@ -110,7 +110,7 @@ public class AppletCourseController extends JeecgController edit(@RequestBody AppletCourse appletCourse) { appletCourseService.updateById(appletCourse); - return Result.OK("编辑成功!"); + return Result.OK("保存成功!"); } /** diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java index 967ac86..6af67bb 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java @@ -86,10 +86,9 @@ public class AppletCoursePageController extends JeecgController add(@RequestBody AppletCoursePage appletCoursePage) { + public Result add(@RequestBody AppletCoursePage appletCoursePage) { appletCoursePageService.save(appletCoursePage); - - return Result.OK("添加成功!"); + return Result.OK(appletCoursePage); } /** diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java index 665f323..0380aaf 100644 --- a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java @@ -64,13 +64,18 @@ public class AppletCoursePage implements Serializable { @Excel(name = "付费", width = 15,replace = {"是_Y","否_N"} ) @Schema(description = "付费") private java.lang.String pay; - /**内容*/ - @Excel(name = "内容", width = 15) + /**标题*/ + @Excel(name = "标题", width = 15) + @Schema(description = "标题") + private java.lang.String title; + /**内容*/ + @Excel(name = "内容", width = 15) @Schema(description = "内容") private java.lang.String content; /**类型*/ @Excel(name = "类型", width = 15) @Schema(description = "类型") + @Dict(dicCode = "applet_course_page_type") private java.lang.String type; /**课程*/ @Excel(name = "课程", width = 15) diff --git a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts index 816766d..0182fc6 100644 --- a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts +++ b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts @@ -52,6 +52,20 @@ export const batchDelete = (params, handleSuccess) => { } }); } +/** + * 新增 + */ +export const add = (params) => { + return defHttp.post({url: Api.save, params}); +} + +/** + * 编辑 + */ +export const edit = (params) => { + return defHttp.post({url: Api.edit, params}); +} + /** * 保存或者更新 */ diff --git a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue index e273d93..9055b29 100644 --- a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue +++ b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue @@ -23,26 +23,18 @@
-
- 课程页面列表 - 共 {{ pageList.length }} 个页面 -
-
+
-
{{ page.title || `页面 ${index + 1}` }}
+
{{ page.title || `${index + 1}` }}
{{ getPageTypeName(page.type) }} - 排序: {{ page.sort || 0 }} +
@@ -68,15 +60,9 @@
-
- 内容编辑 -
- - - - +
@@ -96,14 +82,10 @@
- +
-
+
@@ -113,11 +95,14 @@
- + +
+ + 中文 + 英文 + +
+
@@ -129,15 +114,9 @@
- +
uploaded
@@ -146,11 +125,7 @@
上传图片
- +
@@ -162,18 +137,10 @@
- - + + 上传视频 @@ -181,7 +148,7 @@
- +
@@ -203,88 +170,68 @@
页面设置
-
- - - - - - - - - - - 纯文本 - 图文混合 - 视频 - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + {{ option.label }} + + + + + + + + + + +
-
- -
-
- 手机预览 - - - -
-
-
-
-
-
-

暂无内容,请在左侧添加内容组件

-
-
-
- -
-
{{ component.content || '文本内容...' }}
-
- -
- -
图片预览
-

{{ component.alt }}

-
- -
- -
视频预览
+ +
+
+ 手机预览(该预览经供参考,请以实际手机为准) + + + +
+
+
+
+
+
+

暂无内容,请在左侧添加内容组件

+
+
+
+ +
+
{{ component.language === 'en' ? 'EN' : '中' }}
+
{{ component.content || '文本内容...' }}
+
+ +
+ +
图片预览
+

{{ component.alt }}

+
+ +
+ +
视频预览
+
@@ -299,344 +246,454 @@