lijj 2 роки тому
батько
коміт
cef1d3b6dd

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

@@ -16,39 +16,30 @@
  */
 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.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.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 org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import java.util.List;
 import java.util.Map;
 
 /**

+ 74 - 0
admin/src/main/java/org/springblade/modules/ycwh/controller/wx/WXFeedbackController.java

@@ -0,0 +1,74 @@
+/*
+ *      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.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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.FamousStoreEntity;
+import org.springblade.modules.ycwh.entity.FeedbackEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
+import org.springblade.modules.ycwh.service.IFamousStoreService;
+import org.springblade.modules.ycwh.service.IFeedbackService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
+import org.springblade.modules.ycwh.vo.FamousStoreVO;
+import org.springblade.modules.ycwh.wrapper.FamousStoreWrapper;
+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/feedback")
+@Api(value = "名店", tags = "名店接口")
+public class WXFeedbackController extends BladeController {
+	private final IFeedbackService feedbackService;
+
+	/**
+	 * 反馈信息 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入feedback")
+	public R submit(@Valid @RequestBody FeedbackEntity feedback) {
+		BladeUser user = AuthUtil.getUser();
+		if (Func.isEmpty(user)) {
+			return R.fail("未登录");
+		}
+		feedback.setMemberId(user.getUserId());
+		return R.status(feedbackService.saveOrUpdate(feedback));
+	}
+
+}

+ 6 - 6
admin/src/main/java/org/springblade/modules/ycwh/entity/FeedbackEntity.java

@@ -54,12 +54,12 @@ public class FeedbackEntity extends BaseEntity {
 	 * 来源类型(名菜、名点、名店)
 	 */
 	@ApiModelProperty(value = "来源类型(名菜、名点、名店)")
-	private Long sourceType;
-	/**
-	 * 来源ID
-	 */
-	@ApiModelProperty(value = "来源ID")
-	private Long sourceId;
+	private String sourceType;
+//	/**
+//	 * 来源ID
+//	 */
+//	@ApiModelProperty(value = "来源ID")
+//	private Long sourceId;
 	/**
 	 * 反馈内容
 	 */

+ 1 - 0
admin/src/main/java/org/springblade/modules/ycwh/vo/FeedbackVO.java

@@ -31,4 +31,5 @@ import org.springblade.modules.ycwh.entity.FeedbackEntity;
 public class FeedbackVO extends FeedbackEntity {
 	private static final long serialVersionUID = 1L;
 
+	private String memberName;
 }

+ 9 - 1
admin/src/main/java/org/springblade/modules/ycwh/wrapper/FeedbackWrapper.java

@@ -18,6 +18,9 @@ package org.springblade.modules.ycwh.wrapper;
 
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.member.entity.MemberEntity;
+import org.springblade.modules.member.service.IMemberInfoService;
 import org.springblade.modules.ycwh.entity.FeedbackEntity;
 import org.springblade.modules.ycwh.vo.FeedbackVO;
 
@@ -31,6 +34,10 @@ import java.util.Objects;
  */
 public class FeedbackWrapper extends BaseEntityWrapper<FeedbackEntity, FeedbackVO>  {
 
+	private static IMemberInfoService memberInfoService;
+	static {
+		 memberInfoService = SpringUtil.getBean(IMemberInfoService.class);
+	}
 	public static FeedbackWrapper build() {
 		return new FeedbackWrapper();
  	}
@@ -43,7 +50,8 @@ public class FeedbackWrapper extends BaseEntityWrapper<FeedbackEntity, FeedbackV
 		//User updateUser = UserCache.getUser(feedback.getUpdateUser());
 		//feedbackVO.setCreateUserName(createUser.getName());
 		//feedbackVO.setUpdateUserName(updateUser.getName());
-
+		MemberEntity member = memberInfoService.getById(feedback.getMemberId());
+		feedbackVO.setMemberName(member.getNickName());
 		return feedbackVO;
 	}
 

+ 11 - 1
admin/src/main/java/org/springblade/modules/ycwh/wrapper/InformationInfoWrapper.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.core.tool.utils.SpringUtil;
 import org.springblade.modules.ycwh.entity.InformationInfoEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.InformationInfoVO;
 
 import java.util.Objects;
@@ -30,7 +34,12 @@ import java.util.Objects;
  * @since 2023-08-29
  */
 public class InformationInfoWrapper extends BaseEntityWrapper<InformationInfoEntity, InformationInfoVO>  {
-
+	private static ICollectInfoService collectInfoService;
+	private static ILikeInfoService likeInfoService;
+	static  {
+		collectInfoService = SpringUtil.getBean(ICollectInfoService.class);
+		likeInfoService = SpringUtil.getBean(ILikeInfoService.class);
+	}
 	public static InformationInfoWrapper build() {
 		return new InformationInfoWrapper();
  	}
@@ -43,6 +52,7 @@ public class InformationInfoWrapper extends BaseEntityWrapper<InformationInfoEnt
 		//User updateUser = UserCache.getUser(informationInfo.getUpdateUser());
 		//informationInfoVO.setCreateUserName(createUser.getName());
 		//informationInfoVO.setUpdateUserName(updateUser.getName());
+		informationInfoVO.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.INFORMATION, informationInfo.getId()));
 
 		return informationInfoVO;
 	}

+ 11 - 1
admin/src/main/java/org/springblade/modules/ycwh/wrapper/ProfessionalStyleWrapper.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.core.tool.utils.SpringUtil;
 import org.springblade.modules.ycwh.entity.ProfessionalStyleEntity;
+import org.springblade.modules.ycwh.enums.ArticleTypeEnum;
+import org.springblade.modules.ycwh.service.ICollectInfoService;
+import org.springblade.modules.ycwh.service.ILikeInfoService;
 import org.springblade.modules.ycwh.vo.ProfessionalStyleVO;
 
 import java.util.Objects;
@@ -30,7 +34,12 @@ import java.util.Objects;
  * @since 2023-08-29
  */
 public class ProfessionalStyleWrapper extends BaseEntityWrapper<ProfessionalStyleEntity, ProfessionalStyleVO>  {
-
+	private static ICollectInfoService collectInfoService;
+	private static ILikeInfoService likeInfoService;
+	static  {
+		collectInfoService = SpringUtil.getBean(ICollectInfoService.class);
+		likeInfoService = SpringUtil.getBean(ILikeInfoService.class);
+	}
 	public static ProfessionalStyleWrapper build() {
 		return new ProfessionalStyleWrapper();
  	}
@@ -43,6 +52,7 @@ public class ProfessionalStyleWrapper extends BaseEntityWrapper<ProfessionalStyl
 		//User updateUser = UserCache.getUser(professionalStyle.getUpdateUser());
 		//professionalStyleVO.setCreateUserName(createUser.getName());
 		//professionalStyleVO.setUpdateUserName(updateUser.getName());
+		professionalStyleVO.setLikeNum(likeInfoService.countLikeNum(ArticleTypeEnum.PROFESSIONAL_STYLE, professionalStyle.getId()));
 
 		return professionalStyleVO;
 	}

+ 7 - 3
admin_ui/src/option/ycwh/feedback.js

@@ -21,15 +21,19 @@ export default {
       viewDisplay: false,
       hide: true,
     },
-
+//  {
+//    label: "用户",
+//    prop: "memberId",
+//    type: "input",
+//  },
     {
       label: "用户",
-      prop: "memberId",
+      prop: "memberName",
       type: "input",
     },
     {
       //    (名菜、名点、名店)
-      label: "来源类型",
+      label: "反馈类型",
       prop: "sourceType",
       type: "select",
       dicData: informationTypeOptions,

+ 18 - 13
admin_ui/src/views/ycwh/common/constants.js

@@ -5,19 +5,24 @@ export const startPickTime = (new Date(todayStr)).getTime();
 // 发布时间可选择的结束日期
 export const endPickTime = startPickTime + 8 * 8.64e7 - 1;
 
-export const informationTypeOptions = [{
-  value: 'famous_dish',
-  label: '名菜'
-}, {
-  value: 'famous_location',
-  label: '名点'
-}, {
-  value: 'famous_store',
-  label: '名店'
-}, {
-  value: 'famous_store',
-  label: '专业风采'
-}]
+export const informationTypeOptions = [
+  {
+    value: 'information',
+    label: '资讯'
+  }, {
+    value: 'professional_style',
+    label: '专业风采'
+  }, {
+    value: 'dish',
+    label: '名菜'
+  }, {
+    value: 'snacks',
+    label: '名点'
+  }, {
+    value: 'restaurant',
+    label: '名店'
+  }
+]
 
 export const professionalStyleOptions = [{
   value: 'professional_teacher',

+ 27 - 0
miniapp/api/feedback.js

@@ -0,0 +1,27 @@
+import http from '@/http/api.js'
+import {
+  bizConst
+} from './biz/biz.js'
+import {
+  clientId,
+  tenantId
+} from '@/common/setting'
+
+const submitFeedback = (sourceType, content) => {
+  return http.request({
+    url: bizConst.basicPrefix + '/feedback/submit',
+    method: 'POST',
+    header: {
+      'Tenant-Id': tenantId
+    },
+    data: {
+      sourceType,
+      content
+    },
+  })
+}
+
+
+export default {
+  submitFeedback
+}

+ 9 - 1
miniapp/pages.json

@@ -83,7 +83,15 @@
         "navigationBarTitleText": "资讯",
         "enablePullDownRefresh": false
       }
-    }, {
+    }, 
+    {
+      "path": "pages/yuecai/usercenter/feedback/index",
+      "style": {
+        "navigationBarTitleText": "反馈",
+        "enablePullDownRefresh": false
+      }
+    },
+    {
       "path": "pages/yuecai/usercenter/aboutus/index",
       "style": {
         "navigationBarTitleText": "关于我们",

+ 14 - 4
miniapp/pages/yuecai/collection/index.vue

@@ -39,6 +39,10 @@
         keyword: '',
         list: [],
         tabList: [{
+          name: '资讯'
+        }, {
+          name: '专业风采'
+        }, {
           name: '名店'
         }, {
           name: '名菜',
@@ -49,17 +53,23 @@
       }
     },
     onLoad(options) {
-      this.collectionType = options.type || 'restaurant'
+      this.collectionType = options.type || 'information'
       switch (options.type) {
-        case 'restaurant':
+        case 'information':
           this.currentTab = 0;
           break;
-        case 'dish':
+        case 'professional_style':
           this.currentTab = 1;
           break;
-        case 'snacks':
+        case 'restaurant':
           this.currentTab = 2;
           break;
+        case 'dish':
+          this.currentTab = 3;
+          break;
+        case 'snacks':
+          this.currentTab = 4;
+          break;
         default:
           this.currentTab = 0;
           break;

+ 107 - 0
miniapp/pages/yuecai/usercenter/feedback/index.vue

@@ -0,0 +1,107 @@
+<template>
+  <view class="p-l-r-30 p-b-t-40 k-parse height-100 width-100" style="box-sizing: border-box;">
+    <u-button @click="show = true">{{feedbackTitle?feedbackTitle:'请选择反馈类型'}}</u-button>
+    <u-picker :show="show" :columns="columns" @confirm="confirm"></u-picker>
+    <textarea class="feedback-content" v-model="feedback" auto-focus maxlength="500"
+      placeholder="请输入您需要反馈的内容"></textarea>
+    <view class="submit-btn" @click="submit">提交反馈</view>
+  </view>
+</template>
+
+<script>
+  export default {
+    mixins: [],
+    data() {
+      return {
+        show: false,
+        columns: [
+          ['资讯', '专业风采', '名店', '名点', '名菜']
+        ],
+        feedbackTitle: '',
+        feedbackType: '',
+        feedback: '',
+        submitting: false,
+      }
+    },
+    computed: {},
+    methods: {
+      confirm(e) {
+        // INFORMATION("information", "资讯"),
+        // PROFESSIONAL_STYLE("professional_style", "风采"),
+        // DISH("dish", "名菜"),
+        // SNACKS("snacks", "名点"),
+        // RESTAURANT("restaurant", "名店");
+        switch (e.indexs[0]) {
+          case 0:
+            this.feedbackType = 'information';
+            break;
+          case 1:
+            this.feedbackType = 'professional_style';
+            break;
+          case 2:
+            this.feedbackType = 'famous_restaurant';
+            break;
+          case 3:
+            this.feedbackType = 'famous_dish';
+            break;
+          case 4:
+            this.feedbackType = 'famous_snacks';
+            break;
+          case 0:
+            this.feedbackType = e.indexs[0];
+            break;
+        }
+
+        //
+        this.feedbackTitle = '反馈类型:' + e.value[0]
+        this.show = false
+      },
+      submit() {
+        if (!this.feedbackType || !this.feedback) {
+          uni.showToast({
+            icon: "none",
+            title: "请完善反馈内容后再试"
+          })
+          return;
+        }
+        if (this.submitting) {
+          return;
+        }
+        this.submitting = true;
+        wx.showLoading();
+
+        this.$u.api.submitFeedback(this.feedbackType, this.feedback).then(res => {
+          uni.showToast({
+            icon: "none",
+            title: "反馈成功"
+          })
+          uni.navigateBack({
+            delta: -1
+          })
+        }).catch(e=> {
+          wx.hideLoading();
+          this.submitting = false;
+        })
+      }
+    },
+  }
+</script>
+
+<style scoped>
+  .feedback-content {
+    border: 1px solid #999999;
+    padding: 10px;
+    width: 100%;
+    height: calc(100% - 100px);
+    box-sizing: border-box;
+  }
+
+  .submit-btn {
+    text-align: center;
+    width: 80%;
+    line-height: 40px;
+    color: white;
+    background-color: #65371b;
+    margin: 10px auto auto auto;
+  }
+</style>

+ 39 - 25
miniapp/pages/yuecai/usercenter/index.vue

@@ -50,31 +50,45 @@
         version: version,
         allCells: [
           [{
-            icon: '',
-            text: '名店收藏',
-            url: '/pages/yuecai/collection/index?type=restaurant',
-          }, {
-            icon: '',
-            text: '名菜收藏',
-            url: '/pages/yuecai/collection/index?type=dish',
-          }, {
-            icon: '',
-            text: '名点收藏',
-            url: '/pages/yuecai/collection/index?type=snacks',
-          },
-          {
-            icon: '',
-            text: '用户协议',
-            url: '/pages/yuecai/usercenter/protocol/index',
-          }, {
-            icon: '',
-            text: '了解隐私保护政策',
-            url: '/pages/yuecai/usercenter/privacy/index',
-          }, {
-            icon: '',
-            text: '关于我们',
-            url: '/pages/yuecai/usercenter/aboutus/index',
-          }],
+              icon: '',
+              text: '资讯收藏',
+              url: '/pages/yuecai/collection/index?type=information',
+            }, {
+              icon: '',
+              text: '专业风采收藏',
+              url: '/pages/yuecai/collection/index?type=professional_style',
+            }, {
+              icon: '',
+              text: '名店收藏',
+              url: '/pages/yuecai/collection/index?type=restaurant',
+            }, {
+              icon: '',
+              text: '名菜收藏',
+              url: '/pages/yuecai/collection/index?type=dish',
+            }, {
+              icon: '',
+              text: '名点收藏',
+              url: '/pages/yuecai/collection/index?type=snacks',
+            },
+            {
+              icon: '',
+              text: '反馈',
+              url: '/pages/yuecai/usercenter/feedback/index',
+            },
+            {
+              icon: '',
+              text: '用户协议',
+              url: '/pages/yuecai/usercenter/protocol/index',
+            }, {
+              icon: '',
+              text: '了解隐私保护政策',
+              url: '/pages/yuecai/usercenter/privacy/index',
+            }, {
+              icon: '',
+              text: '关于我们',
+              url: '/pages/yuecai/usercenter/aboutus/index',
+            }
+          ],
         ],
       }
     },