From ec68617f50c7f624683f81d7bcf6f16e49a020e5 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Sat, 5 Jun 2021 18:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91=E5=88=86=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/WechatAppletController.java | 40 +++++++++++++++++++ .../src/components/OrderDrawer/index.vue | 6 ++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java index 6a3add4a0..5a91d40bd 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java @@ -70,6 +70,8 @@ public class WechatAppletController extends BaseController { private IWechatAppletService iWechatAppletService; @Autowired private ISysServicesTopicService iSysServicesTopicService; + @Autowired + private ISysVideoClassifyService sysVideoClassifyService; /** * 查询微信小程序中展示的客户案例 @@ -386,6 +388,9 @@ public class WechatAppletController extends BaseController { sysNutritionalVideo.setUserType(1); } } + if(sysNutritionalVideo.getCateId() != null && sysNutritionalVideo.getCateId().longValue() == 0){ + sysNutritionalVideo.setCateId(null); + } startPage(); List list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo, true); return getDataTable(list); @@ -702,6 +707,41 @@ public class WechatAppletController extends BaseController { // } + /** + * 获取视频分类 + * @param openid + * @return + */ + @GetMapping("/getVideoClassify") + public AjaxResult getVideoClassify(@RequestParam("openid")String openid) { + List list = sysVideoClassifyService.selectSysVideoClassifyList(new SysVideoClassify()); + List>> result = new ArrayList<>(); + int groupCount = 3; + SysVideoClassify all = new SysVideoClassify(); + all.setId(0L); + all.setCateName("全部内容"); + list.add(0, all); + if(list != null && list.size() > 0){ + //分成三组 + int groupNum = list.size()/groupCount + (list.size() % groupCount > 0 ? 1 : 0); + for (int i = 0; i < groupNum; i++) { + List> groupList = new ArrayList<>(); + for (int j = i * groupCount; j < (i+1)*groupCount; j++) { + if(j < list.size()){ + Map videoClassifyMap = new HashMap<>(); + SysVideoClassify sysVideoClassify = list.get(j); + videoClassifyMap.put("cateName", sysVideoClassify.getCateName()); + videoClassifyMap.put("cateId", sysVideoClassify.getId()); + groupList.add(videoClassifyMap); + }else{ + break; + } + } + result.add(groupList); + } + } + return AjaxResult.success(result); + } } diff --git a/stdiet-ui/src/components/OrderDrawer/index.vue b/stdiet-ui/src/components/OrderDrawer/index.vue index 2d7af068a..1358ed683 100644 --- a/stdiet-ui/src/components/OrderDrawer/index.vue +++ b/stdiet-ui/src/components/OrderDrawer/index.vue @@ -65,8 +65,10 @@