Przeglądaj źródła

粤菜文化 点赞收藏相关功能

lijj 2 lat temu
rodzic
commit
db1060a159
44 zmienionych plików z 1117 dodań i 142 usunięć
  1. 1 0
      admin/src/main/java/org/springblade/common/enums/DictBizEnum.java
  2. 7 1
      admin/src/main/java/org/springblade/modules/ycwh/controller/pc/InformationInfoController.java
  3. 4 4
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXCollectInfoController.java
  4. 19 1
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousDishController.java
  5. 19 1
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousSnacksController.java
  6. 19 2
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousStoreController.java
  7. 17 12
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXInformationController.java
  8. 112 0
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXLikeInfoController.java
  9. 19 2
      admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXProfessionalStyleController.java
  10. 4 0
      admin/src/main/java/org/springblade/modules/ycwh/entity/CollectInfoEntity.java
  11. 0 3
      admin/src/main/java/org/springblade/modules/ycwh/entity/FamousDishEntity.java
  12. 1 3
      admin/src/main/java/org/springblade/modules/ycwh/entity/FamousSnacksEntity.java
  13. 0 3
      admin/src/main/java/org/springblade/modules/ycwh/entity/FamousStoreEntity.java
  14. 0 3
      admin/src/main/java/org/springblade/modules/ycwh/entity/InformationInfoEntity.java
  15. 69 0
      admin/src/main/java/org/springblade/modules/ycwh/entity/LikeInfoEntity.java
  16. 1 3
      admin/src/main/java/org/springblade/modules/ycwh/entity/ProfessionalStyleEntity.java
  17. 16 5
      admin/src/main/java/org/springblade/modules/ycwh/enums/CollectionTypeEnum.java
  18. 41 0
      admin/src/main/java/org/springblade/modules/ycwh/mapper/LikeInfoMapper.java
  19. 27 0
      admin/src/main/java/org/springblade/modules/ycwh/mapper/LikeInfoMapper.xml
  20. 18 0
      admin/src/main/java/org/springblade/modules/ycwh/service/ICollectInfoService.java
  21. 58 0
      admin/src/main/java/org/springblade/modules/ycwh/service/ILikeInfoService.java
  22. 22 0
      admin/src/main/java/org/springblade/modules/ycwh/service/impl/CollectInfoServiceImpl.java
  23. 66 0
      admin/src/main/java/org/springblade/modules/ycwh/service/impl/LikeInfoServiceImpl.java
  24. 5 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/CollectInfoVO.java
  25. 16 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/FamousDishVO.java
  26. 15 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/FamousSnacksVO.java
  27. 15 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/FamousStoreVO.java
  28. 17 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/InformationInfoVO.java
  29. 31 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/LikeInfoVO.java
  30. 16 0
      admin/src/main/java/org/springblade/modules/ycwh/vo/ProfessionalStyleVO.java
  31. 62 10
      admin/src/main/java/org/springblade/modules/ycwh/wrapper/CollectInfoWrapper.java
  32. 43 0
      admin/src/main/java/org/springblade/modules/ycwh/wrapper/LikeInfoWrapper.java
  33. 1 0
      miniapp/api/biz/biz.js
  34. 8 6
      miniapp/api/collection.js
  35. 56 0
      miniapp/api/like.js
  36. 1 1
      miniapp/pages.json
  37. 137 0
      miniapp/pages/components/detailbottom.vue
  38. 15 36
      miniapp/pages/yuecai/collection/index.vue
  39. 23 5
      miniapp/pages/yuecai/dish/detail/index.vue
  40. 32 0
      miniapp/pages/yuecai/dish/index.vue
  41. 15 26
      miniapp/pages/yuecai/information/detail/index.vue
  42. 23 5
      miniapp/pages/yuecai/professional_style/detail/index.vue
  43. 23 5
      miniapp/pages/yuecai/restaurant/detail/index.vue
  44. 23 5
      miniapp/pages/yuecai/snacks/detail/index.vue

+ 1 - 0
admin/src/main/java/org/springblade/common/enums/DictBizEnum.java

@@ -18,6 +18,7 @@ package org.springblade.common.enums;
 
 import lombok.AllArgsConstructor;
 import lombok.Getter;
+import org.springblade.core.tool.utils.Func;
 
 /**
  * 业务字典枚举类

+ 7 - 1
admin/src/main/java/org/springblade/modules/ycwh/controller/pc/InformationInfoController.java

@@ -28,13 +28,17 @@ import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.InformationInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.InformationInfoExcel;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
 import org.springblade.modules.ycwh.service.IInformationInfoService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springframework.web.bind.annotation.*;
@@ -67,8 +71,10 @@ public class InformationInfoController extends BladeController {
 	@ApiOperation(value = "详情", notes = "传入informationInfo")
 	public R<InformationInfoVO> detail(InformationInfoEntity informationInfo) {
 		InformationInfoEntity detail = informationInfoService.getOne(Condition.getQueryWrapper(informationInfo));
-		return R.data(InformationInfoWrapper.build().entityVO(detail));
+		InformationInfoVO rs = InformationInfoWrapper.build().entityVO(detail);
+		return R.data(rs);
 	}
+
 	/**
 	 * 资讯信息 分页
 	 */

+ 4 - 4
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXCollectInfoController.java

@@ -75,7 +75,7 @@ public class WXCollectInfoController extends BladeController {
 			return R.fail("未登录");
 		}
 		QueryWrapper<CollectInfoEntity> qw = Condition.getQueryWrapper(collectInfo, CollectInfoEntity.class);
-		qw.eq("create_user", user.getUserId());
+		qw.eq("member_id", user.getUserId());
 		IPage<CollectInfoEntity> pages = collectInfoService.page(Condition.getPage(query), qw);
 		return R.data(CollectInfoWrapper.build().pageVO(pages));
 	}
@@ -104,15 +104,15 @@ public class WXCollectInfoController extends BladeController {
 	@PostMapping("/remove")
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "逻辑删除", notes = "id, 收藏类型")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam Long id, @ApiParam(value = "收藏类型", required = true) @RequestParam String collectionType) {
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam Long collectId, @ApiParam(value = "收藏类型", required = true) @RequestParam String collectType) {
 		BladeUser user = AuthUtil.getUser();
 		if (Func.isEmpty(user)) {
 			return R.fail("未登录");
 		}
 		LambdaQueryWrapper<CollectInfoEntity> lqw = new LambdaQueryWrapper();
 		lqw.eq(CollectInfoEntity::getMemberId, user.getUserId());
-		lqw.eq(CollectInfoEntity::getCollectId, id);
-		lqw.eq(CollectInfoEntity::getCollectType, collectionType);
+		lqw.eq(CollectInfoEntity::getCollectId, collectId);
+		lqw.eq(CollectInfoEntity::getCollectType, collectType);
 		return R.status(collectInfoService.remove(lqw));
 	}
 

+ 19 - 1
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousDishController.java

@@ -28,15 +28,21 @@ import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.FamousDishEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.FamousDishExcel;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
 import org.springblade.modules.ycwh.service.IFamousDishService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.FamousDishVO;
+import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.wrapper.FamousDishWrapper;
+import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
@@ -55,6 +61,8 @@ import java.util.Map;
 public class WXFamousDishController extends BladeController {
 
 	private final IFamousDishService famousDishService;
+	private final ICollectInfoService collectInfoService;
+	private final ILikeInfoService likeInfoService;
 
 	/**
 	 * 名菜 详情
@@ -63,11 +71,21 @@ public class WXFamousDishController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入famousDish")
 	public R<FamousDishVO> detail(FamousDishEntity famousDish) {
+		Long memberId = AuthUtil.getUserId();
+		if (Func.isEmpty(memberId)) {
+			return R.fail("未登录");
+		}
 		FamousDishEntity detail = famousDishService.getOne(Condition.getQueryWrapper(famousDish));
 		/** 更新浏览量 */
 		detail.setViews(Func.toInt(detail.getViews(), 0) + 1);
 		famousDishService.updateById(detail);
-		return R.data(FamousDishWrapper.build().entityVO(detail));
+		//
+		FamousDishVO rs = FamousDishWrapper.build().entityVO(detail);
+		rs.setLiked(likeInfoService.checkHasLiked(memberId, ArticleTypeEnum.DISH, detail.getId()));
+		rs.setCollected(collectInfoService.checkHasCollected(memberId, ArticleTypeEnum.DISH, detail.getId()));
+		rs.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.DISH, detail.getId()));
+		rs.setCollectNum(collectInfoService.countCollectionNum(ArticleTypeEnum.DISH, detail.getId()));
+		return R.data(rs);
 	}
 
 	/**

+ 19 - 1
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousSnacksController.java

@@ -24,12 +24,18 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.FamousSnacksEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
 import org.springblade.modules.ycwh.service.IFamousSnacksService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.FamousSnacksVO;
+import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.wrapper.FamousSnacksWrapper;
+import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
@@ -48,6 +54,8 @@ import java.util.Map;
 public class WXFamousSnacksController extends BladeController {
 
 	private final IFamousSnacksService famousSnacksService;
+	private final ICollectInfoService collectInfoService;
+	private final ILikeInfoService likeInfoService;
 
 	/**
 	 * 名点 详情b
@@ -56,11 +64,21 @@ public class WXFamousSnacksController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入famousSnacks")
 	public R<FamousSnacksVO> detail(FamousSnacksEntity famousSnacks) {
+		Long memberId = AuthUtil.getUserId();
+		if (Func.isEmpty(memberId)) {
+			return R.fail("未登录");
+		}
 		FamousSnacksEntity detail = famousSnacksService.getOne(Condition.getQueryWrapper(famousSnacks));
 		/** 更新浏览量 */
 		detail.setViews(Func.toInt(detail.getViews(), 0) + 1);
 		famousSnacksService.updateById(detail);
-		return R.data(FamousSnacksWrapper.build().entityVO(detail));
+		//
+		FamousSnacksVO rs = FamousSnacksWrapper.build().entityVO(detail);
+		rs.setLiked(likeInfoService.checkHasLiked(memberId, ArticleTypeEnum.SNACKS, detail.getId()));
+		rs.setCollected(collectInfoService.checkHasCollected(memberId, ArticleTypeEnum.SNACKS, detail.getId()));
+		rs.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.SNACKS, detail.getId()));
+		rs.setCollectNum(collectInfoService.countCollectionNum(ArticleTypeEnum.SNACKS, detail.getId()));
+		return R.data(rs);
 	}
 
 	/**

+ 19 - 2
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFamousStoreController.java

@@ -28,15 +28,21 @@ import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.FamousStoreEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.FamousStoreExcel;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
 import org.springblade.modules.ycwh.service.IFamousStoreService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.FamousStoreVO;
+import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.wrapper.FamousStoreWrapper;
+import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
@@ -58,7 +64,8 @@ import java.util.Map;
 public class WXFamousStoreController extends BladeController {
 
 	private final IFamousStoreService famousStoreService;
-
+	private final ICollectInfoService collectInfoService;
+	private final ILikeInfoService likeInfoService;
 	/**
 	 * 名店 详情
 	 */
@@ -66,11 +73,21 @@ public class WXFamousStoreController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入famousStore")
 	public R<FamousStoreVO> detail(FamousStoreEntity famousStore) {
+		Long memberId = AuthUtil.getUserId();
+		if (Func.isEmpty(memberId)) {
+			return R.fail("未登录");
+		}
 		FamousStoreEntity detail = famousStoreService.getOne(Condition.getQueryWrapper(famousStore));
 		/** 更新浏览量 */
 		detail.setViews(Func.toInt(detail.getViews(), 0) + 1);
 		famousStoreService.updateById(detail);
-		return R.data(FamousStoreWrapper.build().entityVO(detail));
+		//
+		FamousStoreVO rs = FamousStoreWrapper.build().entityVO(detail);
+		rs.setLiked(likeInfoService.checkHasLiked(memberId, ArticleTypeEnum.RESTAURANT, detail.getId()));
+		rs.setCollected(collectInfoService.checkHasCollected(memberId, ArticleTypeEnum.RESTAURANT, detail.getId()));
+		rs.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.RESTAURANT, detail.getId()));
+		rs.setCollectNum(collectInfoService.countCollectionNum(ArticleTypeEnum.RESTAURANT, detail.getId()));
+		return R.data(rs);
 	}
 	/**
 	 * 名店 分页

+ 17 - 12
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXInformationController.java

@@ -16,34 +16,27 @@
  */
 package org.springblade.modules.ycwh.controller.wx;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
-import org.apache.poi.hssf.record.aggregates.PageSettingsBlock;
 import org.springblade.core.boot.ctrl.BladeController;
-import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
-import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.constant.BladeConstant;
-import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.InformationInfoEntity;
-import org.springblade.modules.ycwh.excel.InformationInfoExcel;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
 import org.springblade.modules.ycwh.service.IInformationInfoService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -59,6 +52,8 @@ import java.util.Map;
 public class WXInformationController extends BladeController {
 
 	private final IInformationInfoService informationInfoService;
+	private final ICollectInfoService collectInfoService;
+	private final ILikeInfoService likeInfoService;
 
 	/**
 	 * 资讯信息 详情
@@ -67,11 +62,21 @@ public class WXInformationController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入informationInfo")
 	public R<InformationInfoVO> detail(InformationInfoEntity informationInfo) {
+		Long memberId = AuthUtil.getUserId();
+		if (Func.isEmpty(memberId)) {
+			return R.fail("未登录");
+		}
 		InformationInfoEntity detail = informationInfoService.getOne(Condition.getQueryWrapper(informationInfo));
 		/** 更新浏览量 */
 		detail.setViews(Func.toInt(detail.getViews(), 0) + 1);
 		informationInfoService.updateById(detail);
-		return R.data(InformationInfoWrapper.build().entityVO(detail));
+		//
+		InformationInfoVO rs = InformationInfoWrapper.build().entityVO(detail);
+		rs.setLiked(likeInfoService.checkHasLiked(memberId, ArticleTypeEnum.INFORMATION, detail.getId()));
+		rs.setCollected(collectInfoService.checkHasCollected(memberId, ArticleTypeEnum.INFORMATION, detail.getId()));
+		rs.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.INFORMATION, detail.getId()));
+		rs.setCollectNum(collectInfoService.countCollectionNum(ArticleTypeEnum.INFORMATION, detail.getId()));
+		return R.data(rs);
 	}
 
 	/**

+ 112 - 0
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXLikeInfoController.java

@@ -0,0 +1,112 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.controller.wx;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
+import org.springblade.modules.ycwh.vo.LikeInfoVO;
+import org.springblade.modules.ycwh.wrapper.LikeInfoWrapper;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 名菜名点名店收藏 控制器
+ *
+ * @author BladeX
+ * @since 2023-08-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("yuecai-wx/like_info")
+@Api(value = "名菜名点名店收藏", tags = "名菜名点名店收藏接口")
+public class WXLikeInfoController extends BladeController {
+
+	private final ILikeInfoService likeInfoService;
+
+
+	/**
+	 * 名菜名点名店收藏 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "分页", notes = "传入likeInfo")
+	public R<IPage<LikeInfoVO>> list(@ApiIgnore @RequestParam Map<String, Object> likeInfo, Query query) {
+		BladeUser user = AuthUtil.getUser();
+		if (Func.isEmpty(user)) {
+			return R.fail("未登录");
+		}
+		QueryWrapper<LikeInfoEntity> qw = Condition.getQueryWrapper(likeInfo, LikeInfoEntity.class);
+		qw.eq("member_id", user.getUserId());
+		IPage<LikeInfoEntity> pages = likeInfoService.page(Condition.getPage(query), qw);
+		return R.data(LikeInfoWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 名菜名点名店收藏 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "新增", notes = "传入likeInfo")
+	public R save(@Valid @RequestBody LikeInfoEntity likeInfo) {
+		BladeUser user = AuthUtil.getUser();
+		if (Func.isEmpty(user)) {
+			return R.fail("未登录");
+		}
+		if (Func.isEmpty(likeInfo.getLikeId()) || Func.isEmpty(likeInfo.getLikeType())) {
+			return R.fail("收藏内容有误,请重新再试");
+		}
+		likeInfo.setMemberId(user.getUserId());
+		return R.status(likeInfoService.save(likeInfo));
+	}
+
+	/**
+	 * 名菜名点名店收藏 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "逻辑删除", notes = "id, 收藏类型")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam Long likeId, @ApiParam(value = "收藏类型", required = true) @RequestParam String likeType) {
+		BladeUser user = AuthUtil.getUser();
+		if (Func.isEmpty(user)) {
+			return R.fail("未登录");
+		}
+		LambdaQueryWrapper<LikeInfoEntity> lqw = new LambdaQueryWrapper();
+		lqw.eq(LikeInfoEntity::getMemberId, user.getUserId());
+		lqw.eq(LikeInfoEntity::getLikeId, likeId);
+		lqw.eq(LikeInfoEntity::getLikeType, likeType);
+		return R.status(likeInfoService.remove(lqw));
+	}
+
+}

+ 19 - 2
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXProfessionalStyleController.java

@@ -28,14 +28,20 @@ import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.constant.BladeConstant;
 import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.ProfessionalStyleEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.ProfessionalStyleExcel;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.service.IProfessionalStyleService;
+import org.springblade.modules.ycwh.vo.InformationInfoVO;
 import org.springblade.modules.ycwh.vo.ProfessionalStyleVO;
+import org.springblade.modules.ycwh.wrapper.InformationInfoWrapper;
 import org.springblade.modules.ycwh.wrapper.ProfessionalStyleWrapper;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
@@ -58,7 +64,8 @@ import java.util.Map;
 public class WXProfessionalStyleController extends BladeController {
 
 	private final IProfessionalStyleService professionalStyleService;
-
+	private final ICollectInfoService collectInfoService;
+	private final ILikeInfoService likeInfoService;
 	/**
 	 * 烹饪专业风采 详情
 	 */
@@ -66,11 +73,21 @@ public class WXProfessionalStyleController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入professionalStyle")
 	public R<ProfessionalStyleVO> detail(ProfessionalStyleEntity professionalStyle) {
+		Long memberId = AuthUtil.getUserId();
+		if (Func.isEmpty(memberId)) {
+			return R.fail("未登录");
+		}
 		ProfessionalStyleEntity detail = professionalStyleService.getOne(Condition.getQueryWrapper(professionalStyle));
 		/** 更新浏览量 */
 		detail.setViews(Func.toInt(detail.getViews(), 0) + 1);
 		professionalStyleService.updateById(detail);
-		return R.data(ProfessionalStyleWrapper.build().entityVO(detail));
+		//
+		ProfessionalStyleVO rs = ProfessionalStyleWrapper.build().entityVO(detail);
+		rs.setLiked(likeInfoService.checkHasLiked(memberId, ArticleTypeEnum.PROFESSIONAL_STYLE, detail.getId()));
+		rs.setCollected(collectInfoService.checkHasCollected(memberId, ArticleTypeEnum.PROFESSIONAL_STYLE, detail.getId()));
+		rs.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.PROFESSIONAL_STYLE, detail.getId()));
+		rs.setCollectNum(collectInfoService.countCollectionNum(ArticleTypeEnum.PROFESSIONAL_STYLE, detail.getId()));
+		return R.data(rs);
 	}
 
 	/**

+ 4 - 0
admin/src/main/java/org/springblade/modules/ycwh/entity/CollectInfoEntity.java

@@ -61,4 +61,8 @@ public class CollectInfoEntity extends BaseEntity {
 	@ApiModelProperty(value = "会员id")
 	private Long memberId;
 
+
+	@ApiModelProperty("是否已删除")
+	private Integer isDeleted;
+
 }

+ 0 - 3
admin/src/main/java/org/springblade/modules/ycwh/entity/FamousDishEntity.java

@@ -104,9 +104,6 @@ public class FamousDishEntity extends BaseEntity {
 	@ApiModelProperty(value = "置顶")
 	private Boolean top;
 
-	@ApiModelProperty(value = "点赞")
-	@JsonSerialize(nullsUsing = NullSerializer.class)
-	private Integer likeNum;
 	/**
 	 * 浏览量
 	 */

+ 1 - 3
admin/src/main/java/org/springblade/modules/ycwh/entity/FamousSnacksEntity.java

@@ -102,9 +102,7 @@ public class FamousSnacksEntity extends BaseEntity {
 	 */
 	@ApiModelProperty(value = "置顶")
 	private Boolean top;
-	@ApiModelProperty(value = "点赞")
-	@JsonSerialize(nullsUsing = NullSerializer.class)
-	private Integer likeNum;
+
 	/**
 	 * 浏览量
 	 */

+ 0 - 3
admin/src/main/java/org/springblade/modules/ycwh/entity/FamousStoreEntity.java

@@ -104,9 +104,6 @@ public class FamousStoreEntity extends BaseEntity {
 	@ApiModelProperty(value = "置顶")
 	private Boolean top;
 
-	@ApiModelProperty(value = "点赞")
-	@JsonSerialize(nullsUsing = NullSerializer.class)
-	private Integer likeNum;
 	/**
 	 * 浏览量
 	 */

+ 0 - 3
admin/src/main/java/org/springblade/modules/ycwh/entity/InformationInfoEntity.java

@@ -78,9 +78,6 @@ public class InformationInfoEntity extends BaseEntity {
 	@ApiModelProperty(value = "内容")
 	private String content;
 
-	@ApiModelProperty(value = "点赞")
-	private Integer likeNum;
-
 	@ApiModelProperty(value = "浏览量")
 	@JsonSerialize(nullsUsing = NullSerializer.class)
 	private Integer views;

+ 69 - 0
admin/src/main/java/org/springblade/modules/ycwh/entity/LikeInfoEntity.java

@@ -0,0 +1,69 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 名菜名点名店收藏 实体类
+ *
+ * @author BladeX
+ * @since 2023-08-29
+ */
+@Data
+@TableName("ycwh_like_info")
+@ApiModel(value = "like对象", description = "名菜名点名店点赞")
+@EqualsAndHashCode(callSuper = true)
+public class LikeInfoEntity extends BaseEntity {
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	/**
+	 * 顺序
+	 */
+	@ApiModelProperty(value = "顺序")
+	private Integer sort;
+	/**
+	 * 点赞类型(名菜、名点、名店)
+	 */
+	@ApiModelProperty(value = "点赞类型(名菜、名点、名店)")
+	private String likeType;
+	/**
+	 * 名菜、名点、名店id
+	 */
+	@ApiModelProperty(value = "名菜、名点、名店id")
+	private Long likeId;
+	/**
+	 * 会员id
+	 */
+	@ApiModelProperty(value = "会员id")
+	private Long memberId;
+	/**
+	 * 重写,点赞表不需要逻辑删除
+	 */
+	@ApiModelProperty("是否已删除")
+	private Integer isDeleted;
+
+}

+ 1 - 3
admin/src/main/java/org/springblade/modules/ycwh/entity/ProfessionalStyleEntity.java

@@ -99,9 +99,7 @@ public class ProfessionalStyleEntity extends BaseEntity {
 	 */
 	@ApiModelProperty(value = "置顶")
 	private Boolean top;
-	@ApiModelProperty(value = "点赞")
-	@JsonSerialize(nullsUsing = NullSerializer.class)
-	private Integer likeNum;
+
 	/**
 	 * 浏览量
 	 */

+ 16 - 5
admin/src/main/java/org/springblade/modules/ycwh/enums/CollectionTypeEnum.java

@@ -18,6 +18,7 @@ package org.springblade.modules.ycwh.enums;
 
 import lombok.AllArgsConstructor;
 import lombok.Getter;
+import org.springblade.core.tool.utils.Func;
 
 /**
  * 系统字典枚举类
@@ -26,16 +27,26 @@ import lombok.Getter;
  */
 @Getter
 @AllArgsConstructor
-public enum CollectionTypeEnum {
+public enum ArticleTypeEnum {
 
-	/**
-	 * 性别
-	 */
+	INFORMATION("information", "资讯"),
+	PROFESSIONAL_STYLE("professional_style", "风采"),
 	DISH("dish", "名菜"),
-	LOCATION("location", "名点"),
+	SNACKS("snacks", "名点"),
 	RESTAURANT("restaurant", "名店");
 
 	final String key;
 	final String label;
 
+	public static ArticleTypeEnum getEnum(String key) {
+		if (Func.isBlank(key)) {
+			return null;
+		}
+		for (ArticleTypeEnum e : ArticleTypeEnum.values()) {
+			if (e.getKey().equals(key)) {
+				return e;
+			}
+		}
+		return null;
+	}
 }

+ 41 - 0
admin/src/main/java/org/springblade/modules/ycwh/mapper/LikeInfoMapper.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+import org.springblade.modules.ycwh.vo.LikeInfoVO;
+
+import java.util.List;
+
+/**
+ * 名菜名点名店点赞
+ */
+public interface LikeInfoMapper extends BaseMapper<LikeInfoEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param likeInfo
+	 * @return
+	 */
+	List<LikeInfoVO> selectLikeInfoPage(IPage page, LikeInfoVO likeInfo);
+
+
+}

+ 27 - 0
admin/src/main/java/org/springblade/modules/ycwh/mapper/LikeInfoMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.ycwh.mapper.LikeInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="likeInfoResultMap" type="org.springblade.modules.ycwh.entity.LikeInfoEntity">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="remark" property="remark"/>
+        <result column="sort" property="sort"/>
+        <result column="like_type" property="likeType"/>
+        <result column="like_id" property="likeId"/>
+        <result column="member_id" property="memberId"/>
+    </resultMap>
+
+
+    <select id="selectLikeInfoPage" resultMap="likeInfoResultMap">
+        select * from ycwh_like_info where is_deleted = 0
+    </select>
+
+</mapper>

+ 18 - 0
admin/src/main/java/org/springblade/modules/ycwh/service/ICollectInfoService.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.modules.ycwh.entity.CollectInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.CollectInfoExcel;
 import org.springblade.modules.ycwh.vo.CollectInfoVO;
 
@@ -50,4 +51,21 @@ public interface ICollectInfoService extends BaseService<CollectInfoEntity> {
 	 */
 	List<CollectInfoExcel> exportCollectInfo(Wrapper<CollectInfoEntity> queryWrapper);
 
+	/**
+	 * 判断是否收藏
+	 *
+	 * @param memberId
+	 * @param articleType
+	 * @param articleId
+	 * @return
+	 */
+	Boolean checkHasCollected(Long memberId, ArticleTypeEnum articleType, Long articleId);
+
+	/***
+	 * 获取收藏数
+	 * @param articleType
+	 * @param articleId
+	 * @return
+	 */
+	Long countCollectionNum(ArticleTypeEnum articleType, Long articleId);
 }

+ 58 - 0
admin/src/main/java/org/springblade/modules/ycwh/service/ILikeInfoService.java

@@ -0,0 +1,58 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.vo.LikeInfoVO;
+
+import java.util.List;
+
+/**
+ * 名菜名点名店点赞
+ */
+public interface ILikeInfoService extends BaseService<LikeInfoEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param likeInfo
+	 * @return
+	 */
+	IPage<LikeInfoVO> selectLikeInfoPage(IPage<LikeInfoVO> page, LikeInfoVO likeInfo);
+
+	/**
+	 * 判断是否已点赞
+	 *
+	 * @param memberId
+	 * @param articleType
+	 * @param articleId
+	 * @return
+	 */
+	Boolean checkHasLiked(Long memberId, ArticleTypeEnum articleType, Long articleId);
+
+	/**
+	 * 获取点赞数
+	 *
+	 * @param articleType
+	 * @param id
+	 * @return
+	 */
+	Long countLikeNum(ArticleTypeEnum articleType, Long id);
+}

+ 22 - 0
admin/src/main/java/org/springblade/modules/ycwh/service/impl/CollectInfoServiceImpl.java

@@ -17,9 +17,13 @@
 package org.springblade.modules.ycwh.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.ycwh.entity.CollectInfoEntity;
+import org.springblade.modules.ycwh.entity.CollectInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
 import org.springblade.modules.ycwh.excel.CollectInfoExcel;
 import org.springblade.modules.ycwh.mapper.CollectInfoMapper;
 import org.springblade.modules.ycwh.service.ICollectInfoService;
@@ -52,4 +56,22 @@ public class CollectInfoServiceImpl extends BaseServiceImpl<CollectInfoMapper, C
 		return collectInfoList;
 	}
 
+	@Override
+	public Boolean checkHasCollected(Long memberId, ArticleTypeEnum articleType, Long articleId) {
+		LambdaQueryWrapper<CollectInfoEntity> lqw = new LambdaQueryWrapper();
+		lqw.eq(CollectInfoEntity::getMemberId, memberId);
+		lqw.eq(CollectInfoEntity::getCollectType, articleType.getKey());
+		lqw.eq(CollectInfoEntity::getCollectId, articleId);
+		lqw.last("LIMIT 1");
+		return Func.isNotEmpty(this.getOne(lqw));
+	}
+
+	@Override
+	public Long countCollectionNum(ArticleTypeEnum articleType, Long articleId) {
+		LambdaQueryWrapper<CollectInfoEntity> lqw = new LambdaQueryWrapper();
+		lqw.eq(CollectInfoEntity::getCollectType, articleType.getKey());
+		lqw.eq(CollectInfoEntity::getCollectId, articleId);
+		return this.count(lqw);
+	}
+
 }

+ 66 - 0
admin/src/main/java/org/springblade/modules/ycwh/service/impl/LikeInfoServiceImpl.java

@@ -0,0 +1,66 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.mapper.LikeInfoMapper;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
+import org.springblade.modules.ycwh.vo.LikeInfoVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 名菜名点名店收藏 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-08-29
+ */
+@Service
+public class LikeInfoServiceImpl extends BaseServiceImpl<LikeInfoMapper, LikeInfoEntity> implements ILikeInfoService {
+
+	@Override
+	public IPage<LikeInfoVO> selectLikeInfoPage(IPage<LikeInfoVO> page, LikeInfoVO likeInfo) {
+		return page.setRecords(baseMapper.selectLikeInfoPage(page, likeInfo));
+	}
+
+	@Override
+	public Boolean checkHasLiked(Long memberId, ArticleTypeEnum articleType, Long articleId) {
+		LambdaQueryWrapper<LikeInfoEntity> lqw = new LambdaQueryWrapper();
+		lqw.eq(LikeInfoEntity::getMemberId, memberId);
+		lqw.eq(LikeInfoEntity::getLikeType, articleType.getKey());
+		lqw.eq(LikeInfoEntity::getLikeId, articleId);
+		lqw.last("LIMIT 1");
+		return Func.isNotEmpty(this.getOne(lqw));
+	}
+
+	@Override
+	public Long countLikeNum(ArticleTypeEnum articleType, Long articleId) {
+		LambdaQueryWrapper<LikeInfoEntity> lqw = new LambdaQueryWrapper();
+		lqw.eq(LikeInfoEntity::getLikeType, articleType.getKey());
+		lqw.eq(LikeInfoEntity::getLikeId, articleId);
+		return this.count(lqw);
+	}
+
+
+}

+ 5 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/CollectInfoVO.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.CollectInfoEntity;
@@ -31,4 +32,8 @@ import org.springblade.modules.ycwh.entity.CollectInfoEntity;
 public class CollectInfoVO extends CollectInfoEntity {
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "封面")
+	private String cover;
+	@ApiModelProperty(value = "名称")
+	private String name;
 }

+ 16 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/FamousDishVO.java

@@ -16,6 +16,9 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.FamousDishEntity;
@@ -31,4 +34,17 @@ import org.springblade.modules.ycwh.entity.FamousDishEntity;
 public class FamousDishVO extends FamousDishEntity {
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "已点赞")
+	private Boolean liked;
+
+	@ApiModelProperty(value = "已收藏")
+	private Boolean collected;
+
+	@ApiModelProperty(value = "点赞")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long likeNum;
+
+	@ApiModelProperty(value = "收藏数")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long collectNum;
 }

+ 15 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/FamousSnacksVO.java

@@ -16,6 +16,9 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.FamousSnacksEntity;
@@ -30,5 +33,17 @@ import org.springblade.modules.ycwh.entity.FamousSnacksEntity;
 @EqualsAndHashCode(callSuper = true)
 public class FamousSnacksVO extends FamousSnacksEntity {
 	private static final long serialVersionUID = 1L;
+	@ApiModelProperty(value = "已点赞")
+	private Boolean liked;
 
+	@ApiModelProperty(value = "已收藏")
+	private Boolean collected;
+
+	@ApiModelProperty(value = "点赞")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long likeNum;
+
+	@ApiModelProperty(value = "收藏数")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long collectNum;
 }

+ 15 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/FamousStoreVO.java

@@ -16,6 +16,9 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.FamousStoreEntity;
@@ -30,5 +33,17 @@ import org.springblade.modules.ycwh.entity.FamousStoreEntity;
 @EqualsAndHashCode(callSuper = true)
 public class FamousStoreVO extends FamousStoreEntity {
 	private static final long serialVersionUID = 1L;
+	@ApiModelProperty(value = "已点赞")
+	private Boolean liked;
 
+	@ApiModelProperty(value = "已收藏")
+	private Boolean collected;
+
+	@ApiModelProperty(value = "点赞")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long likeNum;
+
+	@ApiModelProperty(value = "收藏数")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long collectNum;
 }

+ 17 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/InformationInfoVO.java

@@ -16,6 +16,10 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.InformationInfoEntity;
@@ -31,4 +35,17 @@ import org.springblade.modules.ycwh.entity.InformationInfoEntity;
 public class InformationInfoVO extends InformationInfoEntity {
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "已点赞")
+	private Boolean liked;
+
+	@ApiModelProperty(value = "已收藏")
+	private Boolean collected;
+
+	@ApiModelProperty(value = "点赞")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long likeNum;
+
+	@ApiModelProperty(value = "收藏数")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long collectNum;
 }

+ 31 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/LikeInfoVO.java

@@ -0,0 +1,31 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+
+/**
+ * 名菜名点名店点赞
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class LikeInfoVO extends LikeInfoEntity {
+	private static final long serialVersionUID = 1L;
+
+}

+ 16 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/ProfessionalStyleVO.java

@@ -16,6 +16,9 @@
  */
 package org.springblade.modules.ycwh.vo;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.modules.ycwh.entity.ProfessionalStyleEntity;
@@ -31,4 +34,17 @@ import org.springblade.modules.ycwh.entity.ProfessionalStyleEntity;
 public class ProfessionalStyleVO extends ProfessionalStyleEntity {
 	private static final long serialVersionUID = 1L;
 
+	@ApiModelProperty(value = "已点赞")
+	private Boolean liked;
+
+	@ApiModelProperty(value = "已收藏")
+	private Boolean collected;
+
+	@ApiModelProperty(value = "点赞")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long likeNum;
+
+	@ApiModelProperty(value = "收藏数")
+	@JsonSerialize(nullsUsing = NullSerializer.class)
+	private Long collectNum;
 }

+ 62 - 10
admin/src/main/java/org/springblade/modules/ycwh/wrapper/CollectInfoWrapper.java

@@ -18,7 +18,11 @@ package org.springblade.modules.ycwh.wrapper;
 
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.modules.ycwh.entity.CollectInfoEntity;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.ycwh.entity.*;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.*;
 import org.springblade.modules.ycwh.vo.CollectInfoVO;
 
 import java.util.Objects;
@@ -29,22 +33,70 @@ import java.util.Objects;
  * @author BladeX
  * @since 2023-08-29
  */
-public class CollectInfoWrapper extends BaseEntityWrapper<CollectInfoEntity, CollectInfoVO>  {
+public class CollectInfoWrapper extends BaseEntityWrapper<CollectInfoEntity, CollectInfoVO> {
+	private static IInformationInfoService informationInfoService;
+	private static IProfessionalStyleService professionalStyleService;
+	private static IFamousStoreService famousStoreService;
+	private static IFamousDishService famousDishService;
+	private static IFamousSnacksService famousSnacksService;
+
+	static {
+		informationInfoService = SpringUtil.getBean(IInformationInfoService.class);
+		professionalStyleService = SpringUtil.getBean(IProfessionalStyleService.class);
+		famousStoreService = SpringUtil.getBean(IFamousStoreService.class);
+		famousDishService = SpringUtil.getBean(IFamousDishService.class);
+		famousSnacksService = SpringUtil.getBean(IFamousSnacksService.class);
+	}
 
 	public static CollectInfoWrapper build() {
 		return new CollectInfoWrapper();
- 	}
+	}
 
 	@Override
 	public CollectInfoVO entityVO(CollectInfoEntity collectInfo) {
-		CollectInfoVO collectInfoVO = Objects.requireNonNull(BeanUtil.copy(collectInfo, CollectInfoVO.class));
-
-		//User createUser = UserCache.getUser(collectInfo.getCreateUser());
-		//User updateUser = UserCache.getUser(collectInfo.getUpdateUser());
-		//collectInfoVO.setCreateUserName(createUser.getName());
-		//collectInfoVO.setUpdateUserName(updateUser.getName());
+		CollectInfoVO vo = Objects.requireNonNull(BeanUtil.copy(collectInfo, CollectInfoVO.class));
 
-		return collectInfoVO;
+		ArticleTypeEnum articleType = ArticleTypeEnum.getEnum(vo.getCollectType());
+		switch (articleType) {
+			case INFORMATION:
+				InformationInfoEntity information = informationInfoService.getById(vo.getCollectId());
+				if (Func.isNotEmpty(information)) {
+					vo.setCover(information.getCover());
+					vo.setName(information.getTitle());
+				}
+				break;
+			case PROFESSIONAL_STYLE:
+				ProfessionalStyleEntity professionalStyle = professionalStyleService.getById(vo.getCollectId());
+				if (Func.isNotEmpty(professionalStyle)) {
+					vo.setCover(professionalStyle.getCover());
+					vo.setName(professionalStyle.getTitle());
+				}
+				break;
+			case RESTAURANT:
+				FamousStoreEntity famousStore = famousStoreService.getById(vo.getCollectId());
+				if (Func.isNotEmpty(famousStore)) {
+					vo.setCover(famousStore.getCover());
+					vo.setName(famousStore.getName());
+				}
+				break;
+			case DISH:
+				FamousDishEntity famousDish = famousDishService.getById(vo.getCollectId());
+				if (Func.isNotEmpty(famousDish)) {
+					vo.setCover(famousDish.getCover());
+					vo.setName(famousDish.getName());
+				}
+				break;
+			case SNACKS:
+				FamousSnacksEntity famousSnacks = famousSnacksService.getById(vo.getCollectId());
+				if (Func.isNotEmpty(famousSnacks)) {
+					vo.setCover(famousSnacks.getCover());
+					vo.setName(famousSnacks.getName());
+				}
+				break;
+			default:
+				break;
+		}
+		return vo;
 	}
 
 

+ 43 - 0
admin/src/main/java/org/springblade/modules/ycwh/wrapper/LikeInfoWrapper.java

@@ -0,0 +1,43 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ycwh.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.ycwh.entity.LikeInfoEntity;
+import org.springblade.modules.ycwh.vo.LikeInfoVO;
+
+import java.util.Objects;
+
+/**
+ * 名菜名点名店点赞
+ */
+public class LikeInfoWrapper extends BaseEntityWrapper<LikeInfoEntity, LikeInfoVO>  {
+
+	public static LikeInfoWrapper build() {
+		return new LikeInfoWrapper();
+ 	}
+
+	@Override
+	public LikeInfoVO entityVO(LikeInfoEntity likeInfo) {
+		LikeInfoVO likeInfoVO = Objects.requireNonNull(BeanUtil.copy(likeInfo, LikeInfoVO.class));
+
+		return likeInfoVO;
+	}
+
+
+}

+ 1 - 0
miniapp/api/biz/biz.js

@@ -1,6 +1,7 @@
 export const bizConst = {
 	basicPrefix: '/yuecai-wx',
   memberPrefix: '/yuecai-wx/member',
+  resourcePrefix: '/blade-resource',
 	pageSize: 10,//默认每页数据条数
 	superVip: '2099-12-31',//终身会员的日期
 }

+ 8 - 6
miniapp/api/collection.js

@@ -22,20 +22,21 @@ const getCollectionList = (current, size, vo) => {
   })
 }
 
-const addCollection = (collectionId, collectionType) => {
+const addCollection = (collectId, collectType) => {
   return http.request({
     url: bizConst.basicPrefix + '/collect_info/save',
     method: 'POST',
     header: {
       'Tenant-Id': tenantId
     },
-    params: {
-      collectionId, collectionType
+    data: {
+      collectId,
+      collectType
     },
   })
 }
 
-const deleteCollection = (collectionId) => {
+const cancelCollection = (collectId, collectType) => {
   return http.request({
     url: bizConst.basicPrefix + '/collect_info/remove',
     method: 'POST',
@@ -43,12 +44,13 @@ const deleteCollection = (collectionId) => {
       'Tenant-Id': tenantId
     },
     params: {
-      id: collectionId
+      collectId,
+      collectType
     },
   })
 }
 export default {
   getCollectionList,
   addCollection,
-  deleteCollection
+  cancelCollection
 }

+ 56 - 0
miniapp/api/like.js

@@ -0,0 +1,56 @@
+import http from '@/http/api.js'
+import {
+  bizConst
+} from './biz/biz.js'
+import {
+  clientId,
+  tenantId
+} from '@/common/setting'
+
+const getLikeList = (current, size, vo) => {
+  return http.request({
+    url: bizConst.basicPrefix + '/like_info/list',
+    method: 'GET',
+    header: {
+      'Tenant-Id': tenantId
+    },
+    params: {
+      current,
+      size,
+      ...vo
+    },
+  })
+}
+
+const addLike = (likeId, likeType) => {
+  return http.request({
+    url: bizConst.basicPrefix + '/like_info/save',
+    method: 'POST',
+    header: {
+      'Tenant-Id': tenantId
+    },
+    data: {
+      likeId,
+      likeType
+    },
+  })
+}
+
+const cancelLike = (likeId, likeType) => {
+  return http.request({
+    url: bizConst.basicPrefix + '/like_info/remove',
+    method: 'POST',
+    header: {
+      'Tenant-Id': tenantId
+    },
+    params: {
+      likeId,
+      likeType
+    },
+  })
+}
+export default {
+  getLikeList,
+  addLike,
+  cancelLike
+}

+ 1 - 1
miniapp/pages.json

@@ -38,7 +38,7 @@
     }, {
       "path": "pages/yuecai/dish/index",
       "style": {
-        "navigationBarTitleText": "菜",
+        "navigationBarTitleText": "菜",
         "enablePullDownRefresh": false
       }
     }, {

+ 137 - 0
miniapp/pages/components/detailbottom.vue

@@ -0,0 +1,137 @@
+<template>
+  <view class="dis-flex flex-x-between bottom-btns">
+    <view class="dis-flex flex-y-center btn-active">
+      <u-icon name="eye" color="#00aeec" size="18"></u-icon>
+      <view class="btn-title">{{views || 0}}人阅读</view>
+    </view>
+    <view class="dis-flex flex-y-center" :class="{'btn-active':liked}" @click="like">
+      <u-icon v-if="liked" name="thumb-up-fill" color="#00aeec" size="18"></u-icon>
+      <u-icon v-else name="thumb-up" color="#7f7f7f" size="18"></u-icon>
+      <view class="btn-title">{{likeNum || 0}}点赞</view>
+    </view>
+    <view class="dis-flex flex-y-center" :class="{'btn-active':collected}" @click="collection">
+      <u-icon v-if="collected" name="star-fill" color="#00aeec" size="18"></u-icon>
+      <u-icon v-else name="star" color="#7f7f7f" size="18"></u-icon>
+      <view class="btn-title">{{collectNum || 0}}收藏数</view>
+    </view>
+  </view>
+</template>
+
+<script>
+  export default {
+    props: {
+      liked: Boolean,
+      collected: Boolean,
+      views: Number,
+      likeNum: Number,
+      collectNum: Number,
+      articleId: String,
+      type: String,
+    },
+    data() {
+      return {
+        submitting: false,
+      }
+    },
+    methods: {
+      like() {
+        if (this.liked) {
+          this.cancelLike()
+        } else {
+          this.addLike()
+        }
+      },
+      collection() {
+        if (this.collected) {
+          this.cancelCollection()
+        } else {
+          this.addCollection()
+        }
+      },
+      addLike() {
+        if (this.submitting) {
+          return;
+        }
+        this.submitting = true;
+        uni.showLoading()
+        // 点赞
+        this.$u.api.addLike(this.articleId, this.type).then(res => {
+          this.submitting = false;
+          uni.hideLoading()
+          this.finishSave()
+        }).catch(e => {
+          this.submitting = false;
+          uni.hideLoading()
+        });
+      },
+      cancelLike() {
+        if (this.submitting) {
+          return;
+        }
+        this.submitting = true;
+        uni.showLoading()
+        // 取消点赞
+        this.$u.api.cancelLike(this.articleId, this.type).then(res => {
+          this.submitting = false;
+          uni.hideLoading()
+          this.finishSave()
+        }).catch(e => {
+          this.submitting = false;
+          uni.hideLoading()
+        });
+      },
+      addCollection() {
+        if (this.submitting) {
+          return;
+        }
+        this.submitting = true;
+        uni.showLoading()
+        // 收藏
+        this.$u.api.addCollection(this.articleId, this.type).then(res => {
+          this.submitting = false;
+          uni.hideLoading()
+          this.finishSave()
+        }).catch(e => {
+          this.submitting = false;
+          uni.hideLoading()
+        });
+      },
+      cancelCollection() {
+        if (this.submitting) {
+          return;
+        }
+        this.submitting = true;
+        uni.showLoading()
+        // 取消收藏
+        this.$u.api.cancelCollection(this.articleId, this.type).then(res => {
+          this.submitting = false;
+          uni.hideLoading()
+          this.finishSave()
+        }).catch(e => {
+          this.submitting = false;
+          uni.hideLoading()
+        });
+      },
+      finishSave() {
+        this.$emit("doRefresh")
+      }
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  .bottom-btns {
+    width: 100%;
+
+    .btn-title {
+      margin-left: 10rpx;
+      color: #7f7f7f;
+    }
+  }
+
+  .btn-active {
+    .btn-title {
+      color: #00aeec;
+    }
+  }
+</style>

+ 15 - 36
miniapp/pages/yuecai/collection/index.vue

@@ -4,7 +4,7 @@
       :activeStyle="{color:'#65371b'}" inactiveStyle="{color:'#65371b'}"></u-tabs>
     <u-list @scrolltolower="scrolltolower" height="calc(100% - 91px)" lowerThreshold="10">
       <view class="info-list">
-        <view class="info-item" v-for="(item, index) in list" :key="index" @click="toDetail(item.id)">
+        <view class="info-item" v-for="(item, index) in list" :key="index" @click="toDetail(item.collectId)">
           <view class="info-pic">
             <u-image width="96px" height="96px" mode="aspectFill" :src="item.cover"></u-image>
           </view>
@@ -72,6 +72,20 @@
     methods: {
       tabChange(e) {
         this.currentTab = e.index;
+        switch (e.index) {
+          case 0:
+            this.collectionType = 'restaurant';
+            break;
+          case 1:
+            this.collectionType = 'dish';
+            break;
+          case 2:
+            this.collectionType = 'snacks';
+            break;
+          default:
+            this.collectionType = 'restaurant';
+            break;
+        }
         this.doRefresh();
       },
       scrolltolower() {
@@ -146,41 +160,6 @@
     overflow: hidden;
   }
 
-  .info-list {
-    display: flex;
-    flex-wrap: wrap;
-
-    .info-item {
-      padding: 20rpx;
-      width: 33%;
-      box-sizing: border-box;
-
-      .info-pic {
-        margin: auto;
-        width: 175rpx;
-        height: 175rpx;
-        background: bisque;
-      }
-
-      .info-title {
-        word-break: break-all;
-        color: #65371b;
-        font-size: 24rpx;
-        font-weight: 300;
-        line-height: 47rpx;
-        word-spacing: 2rpx;
-        overflow: hidden;
-        text-overflow: -o-ellipsis-lastline;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        display: -webkit-box;
-        -webkit-line-clamp: 1;
-        line-clamp: 3;
-        -webkit-box-orient: vertical;
-      }
-    }
-  }
-
   .info-list {
     display: flex;
     flex-wrap: wrap;

+ 23 - 5
miniapp/pages/yuecai/dish/detail/index.vue

@@ -1,33 +1,44 @@
 <template>
   <view class="f-30 p-40 flex-dir-column flex-x-center">
     <view class="title">{{detailVO.name}}</view>
+    <view class="time">发布时间:{{detailVO.createTime?detailVO.createTime.substring(0,10) : ''}}</view>
     <view class="col-info-d t-c m-b-30">
       <u-parse :content="detailVO.content"></u-parse>
     </view>
+    <detailBottom type="dish" :articleId.sync="detailVO.id" :liked.sync="detailVO.liked" :collected.sync="detailVO.collected"
+      :views.sync="detailVO.views" :likeNum.sync="detailVO.likeNum" :collectNum.sync="detailVO.collectNum"
+      @doRefresh="getDetail"></detailBottom>
   </view>
 </template>
 
 <script>
-  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  import detailBottom from '@/pages/components/detailbottom.vue'
   export default {
-    mixins: [themeMixins],
+    components: {
+      detailBottom
+    },
     data() {
       return {
         detailVO: {},
       }
     },
     methods: {
-      getDetail(id) {
-        this.$u.api.getDishDetail(id).then(res => {
+      getDetail() {
+        this.$u.api.getDishDetail(this.detailVO.id).then(res => {
           if (res.data.content) {
             res.data.content = decodeURIComponent(res.data.content);
           }
           this.detailVO = res.data || {}
+          //
+          uni.setNavigationBarTitle({
+            title: res.data.name || ''
+          })
         })
       }
     },
     onLoad(options) {
-      this.getDetail(options.id);
+      this.detailVO.id = options.id || '';
+      this.getDetail();
     },
   }
 </script>
@@ -39,4 +50,11 @@
     color: #65371b;
     margin-bottom: 20px;
   }
+  .time {
+    font-size: 14px;
+    color: #787878;
+    font-weight: 300;
+    padding-bottom: 10px;
+  }
+  
 </style>

+ 32 - 0
miniapp/pages/yuecai/dish/index.vue

@@ -61,15 +61,27 @@
       switch (options.type) {
         case 'restaurant':
           this.currentTab = 0;
+          wx.setNavigationBarTitle({
+            title: '名店'
+          })
           break;
         case 'dish':
           this.currentTab = 1;
+          wx.setNavigationBarTitle({
+            title: '名菜'
+          })
           break;
         case 'snacks':
           this.currentTab = 2;
+          wx.setNavigationBarTitle({
+            title: '名点'
+          })
           break;
         default:
           this.currentTab = 0;
+          wx.setNavigationBarTitle({
+            title: '名店'
+          })
           break;
       }
 
@@ -79,6 +91,26 @@
     methods: {
       tabChange(e) {
         this.currentTab = e.index;
+        switch (this.currentTab) {
+          case 0:
+            uni.setNavigationBarTitle({
+              title: '名店'
+            })
+            break;
+          case 1:
+            uni.setNavigationBarTitle({
+              title: '名菜'
+            })
+            break;
+          case 2:
+            uni.setNavigationBarTitle({
+              title: '名点'
+            })
+            break;
+          default:
+            return;
+            break;
+        }
         this.doRefresh();
       },
       scrolltolower() {

+ 15 - 26
miniapp/pages/yuecai/information/detail/index.vue

@@ -5,50 +5,40 @@
     <view class="col-info-d t-c m-b-30">
       <u-parse :content="detailVO.content"></u-parse>
     </view>
-    <view class="dis-flex flex-x-between bottom-btns">
-      <view class="dis-flex flex-y-center">
-        <u-icon name="eye" color="#7f7f7f" size="18"></u-icon>
-        <view class="btn-title">{{detailVO.views || 0}}人阅读</view>
-      </view>
-      <view class="dis-flex flex-y-center">
-        <u-icon name="thumb-up" color="#7f7f7f" size="18"></u-icon>
-        <view class="btn-title">{{detailVO.likeNum || 0}}点赞</view>
-      </view>
-      <view class="dis-flex flex-y-center" @click="addCollection">
-        <u-icon name="star" color="#7f7f7f" size="18"></u-icon>
-        <view class="btn-title">{{detailVO.collectNum || 0}}收藏数</view>
-      </view>
-    </view>
+    <detailBottom type="information" :articleId.sync="detailVO.id" :liked.sync="detailVO.liked" :collected.sync="detailVO.collected"
+      :views.sync="detailVO.views" :likeNum.sync="detailVO.likeNum" :collectNum.sync="detailVO.collectNum"
+      @doRefresh="getDetail"></detailBottom>
   </view>
 </template>
 
 <script>
-  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  import detailBottom from '@/pages/components/detailbottom.vue'
   export default {
-    mixins: [themeMixins],
+    components: {
+      detailBottom
+    },
     data() {
       return {
         detailVO: {},
       }
     },
     methods: {
-      getInformationDetail(id) {
-        this.$u.api.getInformationDetail(id).then(res => {
+      getDetail() {
+        this.$u.api.getInformationDetail(this.detailVO.id).then(res => {
           if (res.data.content) {
             res.data.content = decodeURIComponent(res.data.content);
           }
           this.detailVO = res.data || {}
+          //
+          uni.setNavigationBarTitle({
+            title: res.data.title || ''
+          })
         })
       },
-      addCollection() {
-        this.detailVO.id
-      },
-      addLike() {
-        this.detailVO.id
-      }
     },
     onLoad(options) {
-      this.getInformationDetail(options.id);
+      this.detailVO.id = options.id || '';
+      this.getDetail();
     },
   }
 </script>
@@ -71,7 +61,6 @@
 
   .bottom-btns {
     width: 100%;
-    
 
     .btn-title {
       margin-left: 10rpx;

+ 23 - 5
miniapp/pages/yuecai/professional_style/detail/index.vue

@@ -1,33 +1,44 @@
 <template>
   <view class="page-view f-30 p-40 flex-dir-column flex-x-center">
     <view class="title">{{detailVO.title}}</view>
+    <view class="time">发布时间:{{detailVO.createTime?detailVO.createTime.substring(0,10) : ''}}</view>
     <view class="col-info-d t-c m-b-30">
       <u-parse :content="detailVO.content"></u-parse>
     </view>
+    <detailBottom type="professional_style" :articleId.sync="detailVO.id" :liked.sync="detailVO.liked" :collected.sync="detailVO.collected"
+      :views.sync="detailVO.views" :likeNum.sync="detailVO.likeNum" :collectNum.sync="detailVO.collectNum"
+      @doRefresh="getDetail"></detailBottom>
   </view>
 </template>
 
 <script>
-  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  import detailBottom from '@/pages/components/detailbottom.vue'
   export default {
-    mixins: [themeMixins],
+    components: {
+      detailBottom
+    },
     data() {
       return {
         detailVO: {},
       }
     },
     methods: {
-      getDetail(id) {
-        this.$u.api.getProfessionalStyleDetail(id).then(res => {
+      getDetail() {
+        this.$u.api.getProfessionalStyleDetail(this.detailVO.id).then(res => {
           if (res.data.content) {
             res.data.content = decodeURIComponent(res.data.content);
           }
           this.detailVO = res.data || {}
+          //
+          uni.setNavigationBarTitle({
+            title: res.data.title || ''
+          })
         })
       }
     },
     onLoad(options) {
-      this.getDetail(options.id);
+      this.detailVO.id = options.id || '';
+      this.getDetail();
     },
   }
 </script>
@@ -40,4 +51,11 @@
     color: #65371b;
     margin-bottom: 20px;
   }
+  .time {
+    font-size: 14px;
+    color: #787878;
+    font-weight: 300;
+    padding-bottom: 10px;
+  }
+  
 </style>

+ 23 - 5
miniapp/pages/yuecai/restaurant/detail/index.vue

@@ -1,33 +1,44 @@
 <template>
   <view class="page-view f-30 p-40 flex-dir-column flex-x-center">
     <view class="title">{{detailVO.name}}</view>
+    <view class="time">发布时间:{{detailVO.createTime?detailVO.createTime.substring(0,10) : ''}}</view>
     <view class="col-info-d t-c m-b-30">
       <u-parse :content="detailVO.content"></u-parse>
     </view>
+    <detailBottom type="restaurant" :articleId.sync="detailVO.id" :liked.sync="detailVO.liked" :collected.sync="detailVO.collected"
+      :views.sync="detailVO.views" :likeNum.sync="detailVO.likeNum" :collectNum.sync="detailVO.collectNum"
+      @doRefresh="getDetail"></detailBottom>
   </view>
 </template>
 
 <script>
-  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  import detailBottom from '@/pages/components/detailbottom.vue'
   export default {
-    mixins: [themeMixins],
+    components: {
+      detailBottom
+    },
     data() {
       return {
         detailVO: {},
       }
     },
     methods: {
-      getDetail(id) {
-        this.$u.api.getRestaurantDetail(id).then(res => {
+      getDetail() {
+        this.$u.api.getRestaurantDetail(this.detailVO.id).then(res => {
           if (res.data.content) {
             res.data.content = decodeURIComponent(res.data.content);
           }
           this.detailVO = res.data || {}
+          //
+          uni.setNavigationBarTitle({
+            title: res.data.name || ''
+          })
         })
       }
     },
     onLoad(options) {
-      this.getDetail(options.id);
+      this.detailVO.id = options.id || '';
+      this.getDetail();
     },
   }
 </script>
@@ -40,4 +51,11 @@
     color: #65371b;
     margin-bottom: 20px;
   }
+  .time {
+    font-size: 14px;
+    color: #787878;
+    font-weight: 300;
+    padding-bottom: 10px;
+  }
+  
 </style>

+ 23 - 5
miniapp/pages/yuecai/snacks/detail/index.vue

@@ -1,33 +1,44 @@
 <template>
   <view class="page-view f-30 p-40 flex-dir-column flex-x-center">
     <view class="title">{{detailVO.name}}</view>
+    <view class="time">发布时间:{{detailVO.createTime?detailVO.createTime.substring(0,10) : ''}}</view>
     <view class="col-info-d t-c m-b-30">
       <u-parse :content="detailVO.content"></u-parse>
     </view>
+    <detailBottom type="snacks" :articleId.sync="detailVO.id" :liked.sync="detailVO.liked" :collected.sync="detailVO.collected"
+      :views.sync="detailVO.views" :likeNum.sync="detailVO.likeNum" :collectNum.sync="detailVO.collectNum"
+      @doRefresh="getDetail"></detailBottom>
   </view>
 </template>
 
 <script>
-  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  import detailBottom from '@/pages/components/detailbottom.vue'
   export default {
-    mixins: [themeMixins],
+    components: {
+      detailBottom
+    },
     data() {
       return {
         detailVO: {},
       }
     },
     methods: {
-      getDetail(id) {
-        this.$u.api.getSnacksDetail(id).then(res => {
+      getDetail() {
+        this.$u.api.getSnacksDetail(this.detailVO.id).then(res => {
           if (res.data.content) {
             res.data.content = decodeURIComponent(res.data.content);
           }
           this.detailVO = res.data || {}
+          //
+          uni.setNavigationBarTitle({
+            title: res.data.name || ''
+          })
         })
       }
     },
     onLoad(options) {
-      this.getDetail(options.id);
+      this.detailVO.id = options.id || '';
+      this.getDetail();
     },
   }
 </script>
@@ -40,4 +51,11 @@
     color: #65371b;
     margin-bottom: 20px;
   }
+  .time {
+    font-size: 14px;
+    color: #787878;
+    font-weight: 300;
+    padding-bottom: 10px;
+  }
+  
 </style>