22 files added
8 files modified
| | |
| | | registration.excludePathPatterns("/api/happyCategory/indexCategory");
|
| | | registration.excludePathPatterns("/api/happyActivity/activityList");
|
| | | registration.excludePathPatterns("/api/happyActivity/activityInfo");
|
| | | registration.excludePathPatterns("/api/happyActivity/voteOptionInPage");
|
| | | registration.excludePathPatterns("/api/happyActivity/voteActivityHot");
|
| | | registration.excludePathPatterns("/api/socialCircle/allCategory");
|
| | | registration.excludePathPatterns("/api/socialCircle/indexCategory");
|
| | | registration.excludePathPatterns("/api/socialCircle/scList");
|
| | | }
|
| | | }
|
| | |
| | | import cc.mrbird.febs.common.annotation.Limit; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiActivityCommentDto; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiOperateValidRegisterActivityDto; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiVoteOptionInPageDto; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiVoteOptionRecordInPageDto; |
| | | import cc.mrbird.febs.mall.dto.activity.*; |
| | | import cc.mrbird.febs.mall.service.HappyActivityService; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiActivityCommentVo; |
| | |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiVoteActivityHotVo.class) |
| | | }) |
| | | @GetMapping(value = "/voteActivityHot/{id}") |
| | | public FebsResponse voteActivityHot(@PathVariable("id") Long id) { |
| | | |
| | | @PostMapping(value = "/voteActivityHot") |
| | | public FebsResponse voteActivityHot(@RequestBody @Validated ApiVoteOptionActivityHotDto dto) { |
| | | Long id = dto.getId(); |
| | | return happyActivityService.voteActivityHot(id); |
| | | } |
| | | |
New file |
| | |
| | | package cc.mrbird.febs.mall.controller.social; |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelSheetPO; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelUtil; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelVersion; |
| | | import cc.mrbird.febs.common.utils.excl.ResponseHeadUtil; |
| | | import cc.mrbird.febs.mall.dto.AdminHappyActivityCategoryDto; |
| | | import cc.mrbird.febs.mall.dto.activity.*; |
| | | import cc.mrbird.febs.mall.entity.HappyActivity; |
| | | import cc.mrbird.febs.mall.entity.HappyActivityOption; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircle; |
| | | import cc.mrbird.febs.mall.service.IAdminHappyActivityService; |
| | | import cc.mrbird.febs.mall.service.IAdminHappySocialCircleService; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/admin/socialCircle") |
| | | public class AdminHappySocialCircleController extends BaseController { |
| | | |
| | | private final IAdminHappySocialCircleService adminHappySocialCircleService; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | /** |
| | | * 分类列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("groupList") |
| | | public FebsResponse groupList(AdminHappyActivityCategoryDto dto, QueryRequest request) { |
| | | |
| | | Map<String, Object> data = getDataTable(adminHappySocialCircleService.getGroupList(dto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | /** |
| | | * 分类-新增 |
| | | */ |
| | | @PostMapping("addGroup") |
| | | @ControllerEndpoint(operation = "分类-新增", exceptionMessage = "操作失败") |
| | | public FebsResponse addGroup(@RequestBody @Valid AdminCategoryAddDto dto) { |
| | | |
| | | return adminHappySocialCircleService.addGroup(dto); |
| | | } |
| | | |
| | | /** |
| | | * 分类-删除 |
| | | */ |
| | | @GetMapping("groupDelete/{id}") |
| | | @ControllerEndpoint(operation = "选项-删除", exceptionMessage = "操作失败") |
| | | public FebsResponse groupDelete(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | |
| | | return adminHappySocialCircleService.groupDelete(id); |
| | | } |
| | | |
| | | /** |
| | | * 分类-更新 |
| | | */ |
| | | @PostMapping("groupUpdate") |
| | | @ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse groupUpdate(@RequestBody @Valid AdminCategoryUpdateDto dto) { |
| | | |
| | | return adminHappySocialCircleService.groupUpdate(dto); |
| | | } |
| | | /** |
| | | * 分类-开启 |
| | | */ |
| | | @GetMapping("groupState/{id}/{type}") |
| | | @ControllerEndpoint(operation = "分类-开启", exceptionMessage = "操作失败") |
| | | public FebsResponse groupState( |
| | | @NotNull(message = "{required}") @PathVariable Long id, |
| | | @NotNull(message = "{required}") @PathVariable Integer type) { |
| | | |
| | | return adminHappySocialCircleService.groupState(id,type); |
| | | } |
| | | |
| | | /** |
| | | * 获取分类 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/allGroup") |
| | | public FebsResponse allGroup() { |
| | | |
| | | return new FebsResponse().success().data(adminHappySocialCircleService.allGroup()); |
| | | } |
| | | |
| | | /** |
| | | * 获取分类 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/allMember") |
| | | public FebsResponse allMember() { |
| | | |
| | | return new FebsResponse().success().data(adminHappySocialCircleService.allMember()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 活动-列表 |
| | | */ |
| | | @GetMapping("list") |
| | | public FebsResponse getAdminSocialCircleListInPage(HappySocialCircle dto, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(adminHappySocialCircleService.getAdminSocialCircleListInPage(dto, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 活动-新增 |
| | | */ |
| | | @PostMapping("add") |
| | | @ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败") |
| | | public FebsResponse addActivity(@RequestBody HappySocialCircle dto) { |
| | | return adminHappySocialCircleService.addActivity(dto); |
| | | } |
| | | |
| | | /** |
| | | * 活动-删除 |
| | | */ |
| | | @GetMapping("delActivity/{id}") |
| | | @ControllerEndpoint(operation = "活动-删除", exceptionMessage = "删除失败") |
| | | public FebsResponse delActivity(@NotNull(message = "{required}") @PathVariable Long id) { |
| | | return adminHappySocialCircleService.delActivity(id); |
| | | } |
| | | /** |
| | | * 活动-开启 |
| | | */ |
| | | @GetMapping("changeState/{id}/{state}") |
| | | @ControllerEndpoint(operation = "活动-开启", exceptionMessage = "操作失败") |
| | | public FebsResponse changeState(@NotNull(message = "{required}") @PathVariable Long id |
| | | ,@NotNull(message = "{required}") @PathVariable Integer state) { |
| | | return adminHappySocialCircleService.changeState(id,state); |
| | | } |
| | | |
| | | /** |
| | | * 活动-更新 |
| | | */ |
| | | @PostMapping("activityUpdate") |
| | | @ControllerEndpoint(operation = "活动-更新", exceptionMessage = "操作失败") |
| | | public FebsResponse activityUpdate(@RequestBody HappySocialCircle dto) { |
| | | |
| | | return adminHappySocialCircleService.activityUpdate(dto); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.controller.social; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.ApiActivityInfoDto; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiScInfoDto; |
| | | import cc.mrbird.febs.mall.service.ApiHappySocialCircleService; |
| | | import cc.mrbird.febs.mall.service.HappyActivityCategoryService; |
| | | import cc.mrbird.febs.mall.vo.ApiActivityInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiCategoryInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiScCategoryInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiScInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiVoteActivityHotVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/api/socialCircle") |
| | | @Api(value = "ApiHappySocialCircleController", tags = "365社区管理") |
| | | public class ApiHappySocialCircleController { |
| | | |
| | | private final ApiHappySocialCircleService apiHappySocialCircleService; |
| | | |
| | | @ApiOperation(value = "全部分类", notes = "全部分类") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiScCategoryInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/allCategory") |
| | | public FebsResponse allCategory() { |
| | | |
| | | return apiHappySocialCircleService.allCategory(); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页分类", notes = "首页分类") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiScCategoryInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/indexCategory") |
| | | public FebsResponse indexCategory() { |
| | | |
| | | return apiHappySocialCircleService.indexCategory(); |
| | | } |
| | | |
| | | @ApiOperation(value = "内容列表", notes = "内容列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiScInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/scList") |
| | | public FebsResponse scList(@RequestBody @Validated ApiScInfoDto dto) { |
| | | |
| | | return apiHappySocialCircleService.scList(dto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "内容详情", notes = "内容详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiScInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/scInfo/{id}") |
| | | public FebsResponse scInfo(@PathVariable("id") Long id) { |
| | | |
| | | return apiHappySocialCircleService.scInfo(id); |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.controller.social; |
| | | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.HappyActivityCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.HappyActivityOptionMapper; |
| | | import cc.mrbird.febs.mall.mapper.HappySocialCircleCategoryMapper; |
| | | import cc.mrbird.febs.mall.service.IAdminHappyActivityService; |
| | | import cc.mrbird.febs.mall.service.IAdminHappySocialCircleService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | @Controller("socialCircleView") |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/socialCircle") |
| | | @RequiredArgsConstructor |
| | | public class ViewHappySocialCircleController extends BaseController { |
| | | |
| | | private final IAdminHappySocialCircleService adminHappySocialCircleService; |
| | | private final HappySocialCircleCategoryMapper happySocialCircleCategoryMapper; |
| | | /** |
| | | * 活动分类列表 |
| | | */ |
| | | @GetMapping("groupList") |
| | | @RequiresPermissions("groupList:view") |
| | | public String groupList() { |
| | | return FebsUtil.view("modules/socialCircle/groupList"); |
| | | } |
| | | |
| | | /** |
| | | * 活动分类新增 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/groupAdd") |
| | | @RequiresPermissions("groupAdd:add") |
| | | public String groupAdd() { |
| | | return FebsUtil.view("modules/socialCircle/groupAdd"); |
| | | } |
| | | |
| | | /** |
| | | * 活动分类编辑 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("groupInfo/{id}") |
| | | @RequiresPermissions("groupInfo:view") |
| | | public String groupInfo(@PathVariable long id, Model model) { |
| | | HappySocialCircleCategory happySocialCircleCategory = happySocialCircleCategoryMapper.selectById(id); |
| | | model.addAttribute("voteActivityGroup", happySocialCircleCategory); |
| | | return FebsUtil.view("modules/socialCircle/groupInfo"); |
| | | } |
| | | |
| | | /** |
| | | * 活动-列表 |
| | | */ |
| | | @GetMapping("list") |
| | | @RequiresPermissions("list:view") |
| | | public String activityList() { |
| | | return FebsUtil.view("modules/socialCircle/list"); |
| | | } |
| | | |
| | | /** |
| | | * 活动-新增 |
| | | */ |
| | | @GetMapping("add") |
| | | @RequiresPermissions("add:add") |
| | | public String activityAdd() { |
| | | return FebsUtil.view("modules/socialCircle/add"); |
| | | } |
| | | |
| | | /** |
| | | * 活动-修改 |
| | | */ |
| | | @GetMapping("discountUpdate/{id}") |
| | | @RequiresPermissions("discountUpdate:update") |
| | | public String votesActivityUpdate(@PathVariable long id, Model model) { |
| | | HappySocialCircle happySocialCircle = adminHappySocialCircleService.getBaseMapper().selectById(id); |
| | | model.addAttribute("activity", happySocialCircle); |
| | | |
| | | return FebsUtil.view("modules/socialCircle/discountUpdate"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto.activity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiScInfoDto", description = "参数") |
| | | public class ApiScInfoDto { |
| | | |
| | | |
| | | @NotNull(message = "页码不能为空") |
| | | @ApiModelProperty(value = "页码", example = "1") |
| | | private Integer pageNow; |
| | | |
| | | @NotNull(message = "每页数量不能为空") |
| | | @ApiModelProperty(value = "每页数量", example = "10") |
| | | private Integer pageSize; |
| | | |
| | | @NotNull(message = "分类ID不能为空") |
| | | @ApiModelProperty(value = "分类ID") |
| | | private Long categoryId; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto.activity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiVoteOptionActivityHotDto", description = "参数") |
| | | public class ApiVoteOptionActivityHotDto { |
| | | |
| | | @NotNull(message = "活动ID不能为空") |
| | | @ApiModelProperty(value = "活动ID") |
| | | private Long id; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("happy_social_circle") |
| | | public class HappySocialCircle extends BaseEntity { |
| | | /** |
| | | * |
| | | `member_id` bigint(20) DEFAULT NULL COMMENT '用户ID', |
| | | `name` varchar(500) DEFAULT NULL COMMENT '标题', |
| | | `content` text COMMENT '内容', |
| | | `index_file` varchar(500) DEFAULT NULL COMMENT '首页显示', |
| | | `category_id` bigint(20) DEFAULT NULL COMMENT '分类ID', |
| | | `DELETE_FLAG` int(11) DEFAULT '0' COMMENT '删除标识 0-未删除 1-已删除', |
| | | `state` int(11) DEFAULT '0' COMMENT '状态 0-未开启 1-已开启', |
| | | `hot_state` int(11) DEFAULT '0' COMMENT '是否推荐到首页 0-不推荐 1-推荐', |
| | | `order_cnt` int(11) DEFAULT '0' COMMENT '排序', |
| | | */ |
| | | private Long memberId; |
| | | @TableField(exist = false) |
| | | private String memberName; |
| | | private String name; |
| | | private String content; |
| | | private String indexFile; |
| | | private Long categoryId; |
| | | @TableField(exist = false) |
| | | private String categoryName; |
| | | private Integer deleteFlag; |
| | | private Integer state; |
| | | private Integer hotState; |
| | | private Integer orderCnt; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("happy_social_circle_category") |
| | | public class HappySocialCircleCategory extends BaseEntity { |
| | | /** |
| | | * |
| | | `name` varchar(500) DEFAULT NULL, |
| | | `order_cnt` int(11) DEFAULT '0' COMMENT '排序', |
| | | `hot_state` int(11) DEFAULT '0' COMMENT '是否推荐到首页 0-不推荐 1-推荐', |
| | | `state` int(11) DEFAULT NULL COMMENT '状态 0-未开启 1-已开启', |
| | | `DELETE_FLAG` int(11) DEFAULT '0' COMMENT '删除标识 0-未删除 1-已删除', |
| | | */ |
| | | private String name; |
| | | private Integer orderCnt; |
| | | private Integer hotState; |
| | | private Integer state; |
| | | private Integer deleteFlag; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircleCategory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | public interface HappySocialCircleCategoryMapper extends BaseMapper<HappySocialCircleCategory> { |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.activity.ApiScInfoDto; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircle; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiScInfoVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface HappySocialCircleMapper extends BaseMapper<HappySocialCircle> { |
| | | Page<ApiScInfoVo> selectListInPage(Page<ApiScInfoVo> page, @Param("record")ApiScInfoDto dto); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiScInfoDto; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircle; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface ApiHappySocialCircleService extends IService<HappySocialCircle> { |
| | | FebsResponse allCategory(); |
| | | |
| | | FebsResponse indexCategory(); |
| | | |
| | | FebsResponse scList(ApiScInfoDto dto); |
| | | |
| | | FebsResponse scInfo(Long id); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AdminHappyActivityCategoryDto; |
| | | import cc.mrbird.febs.mall.dto.activity.AdminCategoryAddDto; |
| | | import cc.mrbird.febs.mall.dto.activity.AdminCategoryUpdateDto; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircle; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircleCategory; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAdminHappySocialCircleService extends IService<HappySocialCircle> { |
| | | |
| | | IPage<HappySocialCircleCategory> getGroupList(AdminHappyActivityCategoryDto dto, QueryRequest request); |
| | | |
| | | FebsResponse addGroup(AdminCategoryAddDto dto); |
| | | |
| | | FebsResponse groupDelete(Long id); |
| | | |
| | | FebsResponse groupUpdate(AdminCategoryUpdateDto dto); |
| | | |
| | | FebsResponse groupState(Long id, Integer type); |
| | | |
| | | List<HappySocialCircleCategory> allGroup(); |
| | | |
| | | IPage<HappySocialCircle> getAdminSocialCircleListInPage(HappySocialCircle dto, QueryRequest request); |
| | | |
| | | FebsResponse addActivity(HappySocialCircle dto); |
| | | |
| | | FebsResponse delActivity(Long id); |
| | | |
| | | FebsResponse changeState(Long id, Integer state); |
| | | |
| | | FebsResponse activityUpdate(HappySocialCircle dto); |
| | | |
| | | List<MallMember> allMember(); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.StateUpDownEnum; |
| | | import cc.mrbird.febs.mall.dto.activity.ApiScInfoDto; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircle; |
| | | import cc.mrbird.febs.mall.entity.HappySocialCircleCategory; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.mapper.HappySocialCircleCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.HappySocialCircleMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.service.ApiHappySocialCircleService; |
| | | import cc.mrbird.febs.mall.vo.ApiActivityInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiScCategoryInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiScInfoVo; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ApiHappySocialCircleServiceImpl extends ServiceImpl<HappySocialCircleMapper, HappySocialCircle> implements ApiHappySocialCircleService { |
| | | |
| | | private final HappySocialCircleCategoryMapper happySocialCircleCategoryMapper; |
| | | private final MallMemberMapper mallMemberMapper; |
| | | @Override |
| | | public FebsResponse allCategory() { |
| | | ArrayList<ApiScCategoryInfoVo> objects = new ArrayList<>(); |
| | | List<HappySocialCircleCategory> happySocialCircleCategories = happySocialCircleCategoryMapper.selectList( |
| | | new LambdaQueryWrapper<HappySocialCircleCategory>() |
| | | .select(HappySocialCircleCategory::getId, HappySocialCircleCategory::getName) |
| | | .eq(HappySocialCircleCategory::getState, StateUpDownEnum.UP.getCode()) |
| | | .eq(HappySocialCircleCategory::getDeleteFlag, StateUpDownEnum.DOWN.getCode()) |
| | | .orderByAsc(HappySocialCircleCategory::getOrderCnt) |
| | | ); |
| | | if(CollUtil.isNotEmpty(happySocialCircleCategories)){ |
| | | for (HappySocialCircleCategory happySocialCircleCategory : happySocialCircleCategories) { |
| | | ApiScCategoryInfoVo apiScCategoryInfoVo = new ApiScCategoryInfoVo(); |
| | | apiScCategoryInfoVo.setId(happySocialCircleCategory.getId()); |
| | | apiScCategoryInfoVo.setName(happySocialCircleCategory.getName()); |
| | | objects.add(apiScCategoryInfoVo); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(objects); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse indexCategory() { |
| | | ArrayList<ApiScCategoryInfoVo> objects = new ArrayList<>(); |
| | | List<HappySocialCircleCategory> happySocialCircleCategories = happySocialCircleCategoryMapper.selectList( |
| | | new LambdaQueryWrapper<HappySocialCircleCategory>() |
| | | .select(HappySocialCircleCategory::getId, HappySocialCircleCategory::getName) |
| | | .eq(HappySocialCircleCategory::getState, StateUpDownEnum.UP.getCode()) |
| | | .eq(HappySocialCircleCategory::getHotState, StateUpDownEnum.UP.getCode()) |
| | | .eq(HappySocialCircleCategory::getDeleteFlag, StateUpDownEnum.DOWN.getCode()) |
| | | .orderByAsc(HappySocialCircleCategory::getOrderCnt) |
| | | ); |
| | | if(CollUtil.isNotEmpty(happySocialCircleCategories)){ |
| | | for (HappySocialCircleCategory happySocialCircleCategory : happySocialCircleCategories) { |
| | | ApiScCategoryInfoVo apiScCategoryInfoVo = new ApiScCategoryInfoVo(); |
| | | apiScCategoryInfoVo.setId(happySocialCircleCategory.getId()); |
| | | apiScCategoryInfoVo.setName(happySocialCircleCategory.getName()); |
| | | objects.add(apiScCategoryInfoVo); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(objects); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse scList(ApiScInfoDto dto) { |
| | | // 创建分页对象,传入当前页和每页大小 |
| | | Page<ApiScInfoVo> page = new Page<>(dto.getPageNow(), dto.getPageSize()); |
| | | // 调用Mapper方法获取活动分页数据 |
| | | Page<ApiScInfoVo> happyActivityPage = this.baseMapper.selectListInPage(page, dto); |
| | | return new FebsResponse().success().data(happyActivityPage); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse scInfo(Long id) { |
| | | ApiScInfoVo apiScInfoVo = new ApiScInfoVo(); |
| | | HappySocialCircle happySocialCircle = this.baseMapper.selectById(id); |
| | | if(happySocialCircle!=null){ |
| | | |
| | | MallMember mallMember = mallMemberMapper.selectById(happySocialCircle.getMemberId()); |
| | | |
| | | apiScInfoVo.setId(happySocialCircle.getId()); |
| | | apiScInfoVo.setAvatar(mallMember.getAvatar()); |
| | | apiScInfoVo.setMemberName(mallMember.getName()); |
| | | apiScInfoVo.setName(happySocialCircle.getName()); |
| | | apiScInfoVo.setIndexFile(happySocialCircle.getIndexFile()); |
| | | apiScInfoVo.setContent(happySocialCircle.getContent()); |
| | | apiScInfoVo.setCreatedTime(happySocialCircle.getCreatedTime()); |
| | | } |
| | | return new FebsResponse().success().data(apiScInfoVo); |
| | | } |
| | | } |
| | |
| | | happyActivityOrder.setNumCnt(dto.getNumCnt()); |
| | | happyActivityOrder.setAmount(amount); |
| | | happyActivityOrder.setPayState(StateUpDownEnum.PAY_STATE_NOT_PAY.getCode()); |
| | | happyActivityOrder.setPayType(StateUpDownEnum.PAY_METHOD_WECHAT.getCode()); |
| | | if(BigDecimal.ZERO.compareTo(amount) == 0){ |
| | | happyActivityOrder.setPayType(StateUpDownEnum.PAY_METHOD_NO_PAY.getCode()); |
| | | }else{ |
| | | happyActivityOrder.setPayType(StateUpDownEnum.PAY_METHOD_WECHAT.getCode()); |
| | | } |
| | | happyActivityOrder.setFailTime(failTime); |
| | | log.info("创建订单,订单号="+JSONUtil.parse(happyActivityOrder)); |
| | | happyActivityOrderMapper.insert(happyActivityOrder); |
| | |
| | | HashMap<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | stringObjectHashMap.put("orderId",happyActivityOrder.getId()); |
| | | stringObjectHashMap.put("amount",amount); |
| | | stringObjectHashMap.put("payType",happyActivityOrder.getPayType()); |
| | | stringObjectHashMap.put("failTime",failTime); |
| | | |
| | | return new FebsResponse().success().data(stringObjectHashMap); |
| | |
| | | try { |
| | | // 根据支付类型处理不同的支付逻辑 |
| | | if (StateUpDownEnum.PAY_METHOD_NO_PAY.getCode() == payType) { |
| | | // if (BigDecimal.ZERO.compareTo(happyActivityOrder.getAmount()) == 0) { |
| | | // 处理无需支付的订单逻辑 |
| | | processNoPayOrder(happyActivityOrder, orderId); |
| | | } else if (StateUpDownEnum.PAY_METHOD_WECHAT.getCode() == payType) { |
| | |
| | | .last("limit 1") |
| | | ); |
| | | if(happyActivityOrderItem == null){ |
| | | throw new FebsException("票号异常!"); |
| | | throw new FebsException("票号不存在!"); |
| | | } |
| | | |
| | | HappyActivity happyActivity = this.baseMapper.selectById(happyActivityOrderItem.getActivityId()); |
| | |
| | | .eq(HappyActivityOrderItem::getCode, orderItemCode) |
| | | .last("limit 1") |
| | | ); |
| | | if(happyActivityOrderItem != null){ |
| | | if(StateUpDownEnum.UP.getCode() == happyActivityOrderItem.getState()){ |
| | | throw new FebsException("票号已核销!"); |
| | | } |
| | | |
| | | happyActivityOrderItem.setState(StateUpDownEnum.UP.getCode()); |
| | | happyActivityOrderItem.setTransferItemId(memberId); |
| | | happyActivityOrderItemMapper.updateById(happyActivityOrderItem); |
| | | agentProducer.sendCheckActivityItem(happyActivityOrderItem.getOrderId()); |
| | | if(happyActivityOrderItem == null){ |
| | | throw new FebsException("票号不存在!"); |
| | | } |
| | | if(StateUpDownEnum.UP.getCode() == happyActivityOrderItem.getState()){ |
| | | throw new FebsException("票号已核销!"); |
| | | } |
| | | |
| | | happyActivityOrderItem.setState(StateUpDownEnum.UP.getCode()); |
| | | happyActivityOrderItem.setTransferItemId(memberId); |
| | | happyActivityOrderItemMapper.updateById(happyActivityOrderItem); |
| | | agentProducer.sendCheckActivityItem(happyActivityOrderItem.getOrderId()); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
New file |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.StateUpDownEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminHappyActivityCategoryDto; |
| | | import cc.mrbird.febs.mall.dto.activity.AdminCategoryAddDto; |
| | | import cc.mrbird.febs.mall.dto.activity.AdminCategoryUpdateDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.HappySocialCircleCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.HappySocialCircleMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.service.IAdminHappySocialCircleService; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class IAdminHappySocialCircleServiceImpl extends ServiceImpl<HappySocialCircleMapper, HappySocialCircle> implements IAdminHappySocialCircleService { |
| | | |
| | | private final HappySocialCircleCategoryMapper happySocialCircleCategoryMapper; |
| | | private final MallMemberMapper mallMemberMapper; |
| | | |
| | | @Override |
| | | public IPage<HappySocialCircleCategory> getGroupList(AdminHappyActivityCategoryDto dto, QueryRequest request) { |
| | | |
| | | Page<HappySocialCircleCategory> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<HappySocialCircleCategory> voteOptionLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(StrUtil.isNotEmpty(dto.getName())){ |
| | | voteOptionLambdaQueryWrapper.like(HappySocialCircleCategory::getName,dto.getName()); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(dto.getStatus())){ |
| | | voteOptionLambdaQueryWrapper.eq(HappySocialCircleCategory::getState,dto.getStatus()); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(dto.getHotState())){ |
| | | voteOptionLambdaQueryWrapper.eq(HappySocialCircleCategory::getHotState,dto.getHotState()); |
| | | } |
| | | voteOptionLambdaQueryWrapper.eq(HappySocialCircleCategory::getDeleteFlag, StateUpDownEnum.DOWN.getCode()); |
| | | voteOptionLambdaQueryWrapper.orderByAsc(HappySocialCircleCategory::getOrderCnt); |
| | | |
| | | Page<HappySocialCircleCategory> happySocialCirclePage = happySocialCircleCategoryMapper.selectPage(page, voteOptionLambdaQueryWrapper); |
| | | return happySocialCirclePage; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse addGroup(AdminCategoryAddDto dto) { |
| | | HappySocialCircleCategory happySocialCircleCategory = new HappySocialCircleCategory(); |
| | | happySocialCircleCategory.setName(dto.getName()); |
| | | happySocialCircleCategory.setOrderCnt(dto.getOrderCnt()); |
| | | happySocialCircleCategoryMapper.insert(happySocialCircleCategory); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse groupDelete(Long id) { |
| | | HappySocialCircleCategory happySocialCircleCategory = happySocialCircleCategoryMapper.selectById(id); |
| | | happySocialCircleCategory.setDeleteFlag(StateUpDownEnum.UP.getCode()); |
| | | happySocialCircleCategoryMapper.updateById(happySocialCircleCategory); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse groupUpdate(AdminCategoryUpdateDto dto) { |
| | | HappySocialCircleCategory happySocialCircleCategory = happySocialCircleCategoryMapper.selectById(dto.getId()); |
| | | happySocialCircleCategory.setName(dto.getName()); |
| | | happySocialCircleCategory.setOrderCnt(dto.getOrderCnt()); |
| | | happySocialCircleCategoryMapper.updateById(happySocialCircleCategory); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse groupState(Long id, Integer type) { |
| | | |
| | | HappySocialCircleCategory happySocialCircleCategory = happySocialCircleCategoryMapper.selectById(id); |
| | | if(StateUpDownEnum.UP.getCode() == happySocialCircleCategory.getDeleteFlag()){ |
| | | throw new RuntimeException("该分组已删除,无法操作"); |
| | | } |
| | | |
| | | if(type == 1){ |
| | | happySocialCircleCategory.setHotState(happySocialCircleCategory.getHotState() == StateUpDownEnum.UP.getCode() ? StateUpDownEnum.DOWN.getCode() : StateUpDownEnum.UP.getCode()); |
| | | } |
| | | |
| | | if(type == 2){ |
| | | happySocialCircleCategory.setState(happySocialCircleCategory.getState() == StateUpDownEnum.UP.getCode() ? StateUpDownEnum.DOWN.getCode() : StateUpDownEnum.UP.getCode()); |
| | | } |
| | | happySocialCircleCategoryMapper.updateById(happySocialCircleCategory); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public List<HappySocialCircleCategory> allGroup() { |
| | | List<HappySocialCircleCategory> happySocialCircleCategorys = |
| | | happySocialCircleCategoryMapper.selectList( |
| | | new LambdaQueryWrapper<HappySocialCircleCategory>() |
| | | .eq(HappySocialCircleCategory::getState, StateUpDownEnum.UP.getCode()) |
| | | .eq(HappySocialCircleCategory::getDeleteFlag, StateUpDownEnum.DOWN.getCode()) |
| | | .orderByDesc(HappySocialCircleCategory::getOrderCnt) |
| | | ); |
| | | if(CollUtil.isNotEmpty(happySocialCircleCategorys)){ |
| | | return happySocialCircleCategorys; |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<HappySocialCircle> getAdminSocialCircleListInPage(HappySocialCircle dto, QueryRequest request) { |
| | | |
| | | Page<HappySocialCircle> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | LambdaQueryWrapper<HappySocialCircle> voteActivityLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(StrUtil.isNotEmpty(dto.getName())){ |
| | | voteActivityLambdaQueryWrapper.like(HappySocialCircle::getName,dto.getName()); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(dto.getState())){ |
| | | voteActivityLambdaQueryWrapper.eq(HappySocialCircle::getState,dto.getState()); |
| | | } |
| | | |
| | | if(ObjectUtil.isNotEmpty(dto.getCategoryId())){ |
| | | voteActivityLambdaQueryWrapper.eq(HappySocialCircle::getCategoryId,dto.getCategoryId()); |
| | | } |
| | | voteActivityLambdaQueryWrapper.eq(HappySocialCircle::getDeleteFlag, StateUpDownEnum.DOWN.getCode()); |
| | | voteActivityLambdaQueryWrapper.orderByDesc(HappySocialCircle::getCreatedTime); |
| | | Page<HappySocialCircle> happySocialCirclePage = this.baseMapper.selectPage(page, voteActivityLambdaQueryWrapper); |
| | | |
| | | if(CollUtil.isNotEmpty(happySocialCirclePage.getRecords())){ |
| | | List<HappySocialCircle> records = happySocialCirclePage.getRecords(); |
| | | Set<Long> memberIds = records.stream().map(HappySocialCircle::getMemberId).collect(Collectors.toSet()); |
| | | Set<Long> categoryIds = records.stream().map(HappySocialCircle::getCategoryId).collect(Collectors.toSet()); |
| | | |
| | | List<MallMember> mallMembers = mallMemberMapper.selectList( |
| | | new LambdaQueryWrapper<MallMember>() |
| | | .select(MallMember::getId, MallMember::getName) |
| | | .in(MallMember::getId, memberIds) |
| | | ); |
| | | |
| | | Map<Long, MallMember> mallMemberMap = mallMembers.stream().collect(Collectors.toMap(MallMember::getId, mallMember -> mallMember)); |
| | | |
| | | List<HappySocialCircleCategory> happySocialCircleCategorys = happySocialCircleCategoryMapper.selectList( |
| | | new LambdaQueryWrapper<HappySocialCircleCategory>() |
| | | .select(HappySocialCircleCategory::getId, HappySocialCircleCategory::getName) |
| | | .in(HappySocialCircleCategory::getId, categoryIds) |
| | | ); |
| | | Map<Long, HappySocialCircleCategory> categoryMap = happySocialCircleCategorys.stream() |
| | | .collect(Collectors.toMap(HappySocialCircleCategory::getId, happySocialCircleCategory -> happySocialCircleCategory)); |
| | | for (HappySocialCircle happySocialCircle : records){ |
| | | happySocialCircle.setMemberName(mallMemberMap.get(happySocialCircle.getMemberId()).getName()); |
| | | happySocialCircle.setCategoryName(categoryMap.get(happySocialCircle.getCategoryId()).getName()); |
| | | } |
| | | } |
| | | return happySocialCirclePage; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse addActivity(HappySocialCircle dto) { |
| | | HappySocialCircle happySocialCircle = new HappySocialCircle(); |
| | | BeanUtil.copyProperties(dto, happySocialCircle); |
| | | this.baseMapper.insert(happySocialCircle); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse delActivity(Long id) { |
| | | HappySocialCircle happySocialCircle = this.baseMapper.selectById(id); |
| | | happySocialCircle.setDeleteFlag(StateUpDownEnum.UP.getCode()); |
| | | this.baseMapper.updateById(happySocialCircle); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse changeState(Long id, Integer state) { |
| | | HappySocialCircle happySocialCircle = this.baseMapper.selectById(id); |
| | | if(ObjectUtil.isNull(happySocialCircle)){ |
| | | throw new RuntimeException("该活动已删除,无法操作"); |
| | | } |
| | | happySocialCircle.setState(state); |
| | | this.baseMapper.updateById(happySocialCircle); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse activityUpdate(HappySocialCircle dto) { |
| | | HappySocialCircle happySocialCircle = this.baseMapper.selectById(dto.getId()); |
| | | if(ObjectUtil.isNull(happySocialCircle)){ |
| | | throw new RuntimeException("该活动已删除,无法操作"); |
| | | } |
| | | happySocialCircle.setCategoryId(dto.getCategoryId()); |
| | | happySocialCircle.setMemberId(dto.getMemberId()); |
| | | happySocialCircle.setName(dto.getName()); |
| | | happySocialCircle.setContent(dto.getContent()); |
| | | happySocialCircle.setIndexFile(dto.getIndexFile()); |
| | | happySocialCircle.setOrderCnt(dto.getOrderCnt()); |
| | | |
| | | this.baseMapper.updateById(happySocialCircle); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public List<MallMember> allMember() { |
| | | List<MallMember> mallMembers = mallMemberMapper.selectList( |
| | | new LambdaQueryWrapper<MallMember>() |
| | | .select(MallMember::getId, MallMember::getName) |
| | | .eq(MallMember::getCheckOrder, StateUpDownEnum.UP.getCode()) |
| | | .orderByDesc(MallMember::getCreatedTime) |
| | | ); |
| | | return mallMembers; |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo.activity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiScCategoryInfoVo", description = "参数") |
| | | public class ApiScCategoryInfoVo { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo.activity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiScInfoVo", description = "参数") |
| | | public class ApiScInfoVo { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "发布人") |
| | | private String memberName; |
| | | |
| | | @ApiModelProperty(value = "标题") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "封面") |
| | | private String indexFile; |
| | | |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createdTime; |
| | | |
| | | } |
| | |
| | | datasource: |
| | | # 数据源-1,名称为 base |
| | | base: |
| | | username: root |
| | | password: root |
| | | username: happy_community_365 |
| | | password: happy_community_365!@# |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/happy_community_365?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://8.155.56.10:3306/happy_community_365?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 |
| | | |
| | | redis: |
| | | # Redis数据库索引(默认为 0) |
| | |
| | | a.type, |
| | | a.name, |
| | | a.state, |
| | | (select count(z.id) from happy_follow z where z.source_id = a.id) as join_cnt, |
| | | (select count(z.id) from happy_follow z where z.source_id = a.id AND z.type IN (2, 3, 4)) as join_cnt, |
| | | a.start_time, |
| | | a.end_time |
| | | from happy_activity a |
| | |
| | | </if> |
| | | </where> |
| | | <if test="record.hotState != null"> |
| | | order by (select count(y.id) from happy_follow y where y.source_id = a.id and type in (2,3)) desc,a.order_cnt asc |
| | | order by (select count(y.id) from happy_follow y where y.source_id = a.id and type in (2, 3, 4)) desc,a.order_cnt asc |
| | | </if> |
| | | <if test="record.hotState == null"> |
| | | order by a.order_cnt asc,a.id desc |
New file |
| | |
| | | <?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="cc.mrbird.febs.mall.mapper.HappySocialCircleMapper"> |
| | | |
| | | <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.activity.ApiScInfoVo"> |
| | | select |
| | | a.id, |
| | | b.avatar, |
| | | b.name as memberName, |
| | | a.name as name, |
| | | a.CREATED_TIME as createdTime, |
| | | a.index_file as indexFile |
| | | from happy_social_circle a |
| | | left join mall_member b on a.member_id = b.id |
| | | where |
| | | a.state = 1 |
| | | and a.DELETE_FLAG = 0 |
| | | and a.category_id=#{record.categoryId} |
| | | order by a.order_cnt asc, a.created_time desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-sc-add" lay-title="内容新增"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-fluid" id="sc-add"> |
| | | <form class="layui-form" action="" lay-filter="sc-add-form"> |
| | | <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">基础信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <blockquote class="layui-elem-quote blue-border">基础信息</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">分类:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="sc-group"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">发布人:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="sc-member"></div> |
| | | <div class="layui-form-mid layui-word-aux">数据来源:会员管理-会员列表中设置成核销员</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">封面:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn" id="test1Max">上传</button> |
| | | <div class="layui-form-mid layui-word-aux"> |
| | | 上传图片、视频或者音频文件大小不超过100M。 |
| | | 图片:"bmp", "gif", "jpg", "jpeg", "png", |
| | | 视频格式:"mp4", "avi", |
| | | 音频:"mp3", "wav" , "ogg"。 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">封面链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="indexFile" lay-verify="required" name="indexFile" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">排序:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="orderCnt" lay-verify="required" |
| | | placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">标题:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="required" |
| | | placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">内容:</label> |
| | | <div class="layui-input-block"> |
| | | <div style="border: 1px solid #ccc;"> |
| | | <div id="toolbar-container" class="toolbar"></div> |
| | | <div id="text-container" class="text" style="height: 450px;"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="sc-add-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .blue-border { |
| | | border-left-color: #2db7f5; |
| | | font-size: 18px; |
| | | } |
| | | .layui-table-cell { |
| | | height:auto; |
| | | } |
| | | </style> |
| | | |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','dropdown', 'laydate', 'layedit', 'upload', 'element', 'table', 'xmSelect','jquery'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | table = layui.table, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | $view = $('#sc-add'), |
| | | layedit = layui.layedit, |
| | | upload = layui.upload, |
| | | validate = layui.validate, |
| | | element = layui.element; |
| | | |
| | | form.render(); |
| | | |
| | | const E = window.wangEditor; |
| | | const editor = new E('#toolbar-container', '#text-container'); // 传入两个元素 |
| | | editor.config.showLinkImg = false; |
| | | editor.config.uploadFileName = 'file'; |
| | | editor.config.customUploadImg = function (files, insertImgFn) { |
| | | // files 是 input 中选中的文件列表 |
| | | // insertImgFn 是获取图片 url 后,插入到编辑器的方法 |
| | | // 上传图片,返回结果,将图片插入到编辑器中 |
| | | for (let i = 0; i < files.length; i++){ |
| | | var form = new FormData(); |
| | | form.append("file", files[0]); |
| | | $.ajax({ |
| | | url:'/admin/goods/uploadFileBase64', |
| | | type: "post", |
| | | processData: false, |
| | | contentType: false, |
| | | data: form, |
| | | dataType: 'json', |
| | | success(res) { |
| | | // 上传代码返回结果之后,将图片插入到编辑器中 |
| | | insertImgFn(res.data.src, res.data.title, '') |
| | | } |
| | | }) |
| | | } |
| | | }; |
| | | editor.create(); |
| | | |
| | | formSelects.render(); |
| | | |
| | | let scGroup = xmSelect.render({ |
| | | el: '#sc-group', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | tips: '请选择', |
| | | filterable: true, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/socialCircle/allGroup', null, function(res) { |
| | | scGroup.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }) |
| | | |
| | | let scMember = xmSelect.render({ |
| | | el: '#sc-member', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | tips: '请选择', |
| | | filterable: true, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/socialCircle/allMember', null, function(res) { |
| | | scMember.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }) |
| | | |
| | | //图片上传 |
| | | upload.render({ |
| | | elem: '#test1Max' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,accept: 'file' //普通文件 |
| | | ,size: 10240 //限制文件大小,单位 KB |
| | | ,before: function(obj){ |
| | | } |
| | | ,done: function(res){ |
| | | $("#indexFile").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | form.on('submit(sc-add-form-submit)', function (data) { |
| | | data.field.categoryId = scGroup.getValue('valueStr'); |
| | | data.field.memberId = scMember.getValue('valueStr'); |
| | | data.field.content = editor.txt.html(); |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/socialCircle/add', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==200){ |
| | | layer.closeAll(); |
| | | febs.alert.success(data.message); |
| | | $('#febs-sc').find('#query').click(); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-sc-discount" lay-title="内容编辑"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-fluid" id="sc-discount-update"> |
| | | <form class="layui-form" action="" lay-filter="sc-discount-update-form"> |
| | | <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">基础信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <blockquote class="layui-elem-quote blue-border">基础信息</blockquote> |
| | | <!-- 隐藏的 ID 项 --> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label">ID:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">分类:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="sc-group"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">发布人:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="sc-member"></div> |
| | | <div class="layui-form-mid layui-word-aux">数据来源:会员管理-会员列表中设置成核销员</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">封面:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn" id="test1Max">上传</button> |
| | | <div class="layui-form-mid layui-word-aux"> |
| | | 上传图片、视频或者音频文件大小不超过100M。 |
| | | 图片:"bmp", "gif", "jpg", "jpeg", "png", |
| | | 视频格式:"mp4", "avi", |
| | | 音频:"mp3", "wav" , "ogg"。 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">封面链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="indexFile" lay-verify="required" name="indexFile" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">排序:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="orderCnt" lay-verify="required" |
| | | placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">标题:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="required" |
| | | placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">内容:</label> |
| | | <div class="layui-input-block"> |
| | | <div style="border: 1px solid #ccc;"> |
| | | <div id="toolbar-container" class="toolbar"></div> |
| | | <div id="text-container" class="text" style="height: 450px;"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="sc-discount-update-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .blue-border { |
| | | border-left-color: #2db7f5; |
| | | font-size: 18px; |
| | | } |
| | | </style> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-danger layui-btn-sm" type="button" lay-event="delSku">删除</button> |
| | | </div> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','dropdown', 'laydate', 'layedit', 'upload', 'element', 'table', 'xmSelect'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | table = layui.table, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | $view = $('#sc-discount-update'), |
| | | layedit = layui.layedit, |
| | | activity = [[${activity}]], |
| | | upload = layui.upload, |
| | | validate = layui.validate, |
| | | element = layui.element; |
| | | |
| | | |
| | | const E = window.wangEditor; |
| | | const editor = new E('#toolbar-container', '#text-container'); // 传入两个元素 |
| | | editor.config.showLinkImg = false; |
| | | editor.config.uploadFileName = 'file'; |
| | | editor.config.customUploadImg = function (files, insertImgFn) { |
| | | // files 是 input 中选中的文件列表 |
| | | // insertImgFn 是获取图片 url 后,插入到编辑器的方法 |
| | | // 上传图片,返回结果,将图片插入到编辑器中 |
| | | for (let i = 0; i < files.length; i++){ |
| | | var form = new FormData(); |
| | | form.append("file", files[0]); |
| | | $.ajax({ |
| | | url:'/admin/goods/uploadFileBase64', |
| | | type: "post", |
| | | processData: false, |
| | | contentType: false, |
| | | data: form, |
| | | dataType: 'json', |
| | | success(res) { |
| | | // 上传代码返回结果之后,将图片插入到编辑器中 |
| | | insertImgFn(res.data.src, res.data.title, '') |
| | | } |
| | | }) |
| | | } |
| | | }; |
| | | editor.create(); |
| | | |
| | | formSelects.render(); |
| | | |
| | | let scGroup = xmSelect.render({ |
| | | el: '#sc-group', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | tips: '请选择', |
| | | filterable: true, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }); |
| | | |
| | | febs.get(ctx + 'admin/socialCircle/allGroup', null, function(res) { |
| | | scGroup.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | let scMember = xmSelect.render({ |
| | | el: '#sc-member', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | tips: '请选择', |
| | | filterable: true, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }); |
| | | |
| | | febs.get(ctx + 'admin/socialCircle/allMember', null, function(res) { |
| | | scMember.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | setTimeout(() => { |
| | | initscValue(); |
| | | }, 500); |
| | | }); |
| | | |
| | | //图片上传 |
| | | upload.render({ |
| | | elem: '#test1Max' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,accept: 'file' //普通文件 |
| | | ,size: 10240 //限制文件大小,单位 KB |
| | | ,before: function(obj){ |
| | | } |
| | | ,done: function(res){ |
| | | $("#indexFile").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | function initscValue() { |
| | | if (!activity) { |
| | | console.warn("activity 数据为空,无法初始化表单!"); |
| | | return; |
| | | } |
| | | |
| | | form.val("sc-discount-update-form", { |
| | | "id": activity.id, |
| | | "name": activity.name, |
| | | "orderCnt": activity.orderCnt, |
| | | "hotState": activity.hotState, |
| | | "indexFile": activity.indexFile, |
| | | }); |
| | | var arr = []; |
| | | arr.push(activity.categoryId); |
| | | scGroup.setValue(arr); |
| | | |
| | | var scMemberList = []; |
| | | scMemberList.push(activity.memberId); |
| | | scMember.setValue(scMemberList); |
| | | |
| | | editor.txt.html(activity.content); |
| | | } |
| | | |
| | | |
| | | |
| | | form.on('submit(sc-discount-update-form-submit)', function (data) { |
| | | data.field.categoryId = scGroup.getValue('valueStr'); |
| | | data.field.memberId = scMember.getValue('valueStr'); |
| | | data.field.content = editor.txt.html(); |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/socialCircle/activityUpdate', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==200){ |
| | | layer.closeAll(); |
| | | febs.alert.success(data.message); |
| | | $('#febs-sc').find('#reset').click(); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-sc-add" lay-title="社区分类新增"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-fluid" id="groupSc-add"> |
| | | <form class="layui-form" action="" lay-filter="groupSc-add-form"> |
| | | <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">基础信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <blockquote class="layui-elem-quote blue-border">基础信息</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">排序:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="orderCnt" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="groupSc-add-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .blue-border { |
| | | border-left-color: #2db7f5; |
| | | font-size: 18px; |
| | | } |
| | | .layui-table-cell { |
| | | height:auto; |
| | | } |
| | | .layui-upload-list { |
| | | margin: 0 !important; |
| | | } |
| | | .multi-images { |
| | | margin: 0 5px !important; |
| | | } |
| | | </style> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'validate'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | form = layui.form, |
| | | $view = $('#groupSc-add'), |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | |
| | | |
| | | form.on('submit(groupSc-add-form-submit)', function (data) { |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/socialCircle/addGroup', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==200){ |
| | | layer.closeAll(); |
| | | febs.alert.success(data.message); |
| | | $('#febs-sc-group').find('#query').click(); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-scgroup-info" lay-title="社区分类编辑"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-fluid" id="group-info"> |
| | | <form class="layui-form" action="" lay-filter="group-info-form"> |
| | | <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">基础信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <input type="text" name="id" |
| | | placeholder="" autoComplete="off" class="layui-input febs-hide"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <blockquote class="layui-elem-quote blue-border">基础信息</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">排序:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="orderCnt" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="group-info-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .blue-border { |
| | | border-left-color: #2db7f5; |
| | | font-size: 18px; |
| | | } |
| | | .layui-table-cell { |
| | | height:auto; |
| | | } |
| | | .layui-upload-list { |
| | | margin: 0 !important; |
| | | } |
| | | .multi-images { |
| | | margin: 0 5px !important; |
| | | } |
| | | </style> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'validate','formSelects', 'table'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | table = layui.table, |
| | | form = layui.form, |
| | | formSelects = layui.formSelects, |
| | | $view = $('#group-info'), |
| | | voteActivityGroup = [[${voteActivityGroup}]], |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | initVoteActivityGroup(); |
| | | |
| | | formSelects.render(); |
| | | |
| | | function initVoteActivityGroup() { |
| | | console.log("voteActivityGroup:", voteActivityGroup); // 调试信息 |
| | | form.val("group-info-form", { |
| | | "id": voteActivityGroup.id, |
| | | "name": voteActivityGroup.name, |
| | | "orderCnt": voteActivityGroup.orderCnt, |
| | | }); |
| | | |
| | | } |
| | | |
| | | form.on('submit(group-info-form-submit)', function (data) { |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/socialCircle/groupUpdate', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==200){ |
| | | layer.closeAll(); |
| | | febs.alert.success(data.message); |
| | | $('#febs-sc-group').find('#query').click(); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-sc-group" lay-title="社区分类管理"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="sc-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="名称" name="name" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">审核状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="status"> |
| | | <option value="">请选择</option> |
| | | <option value="0">未开启</option> |
| | | <option value="1">开启</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">推荐首页</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="hotState"> |
| | | <option value="">请选择</option> |
| | | <option value="0">不推荐</option> |
| | | <option value="1">推荐</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="scGroupTable" lay-data="{id: 'scGroupTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="list:view,add:add,votesActivityUpdate:update"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="votesActivityUpdate:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <script type="text/html" id="hotStateSwitch"> |
| | | {{# if(d.hotState === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" checked lay-skin="switch" lay-filter="hotStateSwitch"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" lay-skin="switch" lay-filter="hotStateSwitch"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="groupStatusSwitch"> |
| | | {{# if(d.state === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="groupStatusSwitch"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="groupStatusSwitch"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="scGroupToolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="groupAdd:add" lay-event="addScGroup">新增分类</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="scGroupOption"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="groupInfo:view" lay-event="groupInfo">编辑</button> |
| | | <button class="layui-btn layui-btn-danger layui-btn-sm" type="button" shiro:hasPermission="groupDelete:delete" lay-event="groupDelete">删除</button> |
| | | </script> |
| | | <script type="text/html" id="deleteFlag"> |
| | | {{# |
| | | var deleteFlag = { |
| | | 0: {title: '生效中', color: 'green'}, |
| | | 1: {title: '已删除', color: 'red'}, |
| | | }[d.deleteFlag]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{deleteFlag.color}}">{{ deleteFlag.title }}</span> |
| | | </script> |
| | | |
| | | <style> |
| | | .layui-form-onswitch { |
| | | background-color: #5FB878 !important; |
| | | } |
| | | </style> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-sc-group'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initscGroupTable(); |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(scGroupTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'groupDelete') { |
| | | febs.modal.confirm('删除', '确认删除?', function () { |
| | | groupDelete(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'groupInfo') { |
| | | febs.modal.open('编辑','modules/socialCircle/groupInfo/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | area: ['100%', '100%'], |
| | | yes: function (index, layero) { |
| | | $('#febs-scgroup-info').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | function groupDelete(id) { |
| | | febs.get(ctx + 'admin/socialCircle/groupDelete/' + id, null, function (data) { |
| | | febs.alert.success(data.message); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('toolbar(scGroupTable)', function (obj) { |
| | | let data = obj.data, |
| | | layEvent = obj.event; |
| | | console.log("触发事件:", obj.event); // 调试信息 |
| | | if(layEvent === 'addScGroup'){ |
| | | febs.modal.open('新增','modules/socialCircle/groupAdd/', { |
| | | btn: ['提交', '取消'], |
| | | area: ['100%', '100%'], |
| | | yes: function (index, layero) { |
| | | $('#febs-sc-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | function initscGroupTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'scGroupTable', |
| | | url: ctx + 'admin/socialCircle/groupList', |
| | | toolbar:"#scGroupToolbar", |
| | | defaultToolbar:[], |
| | | cols: [[ |
| | | {type: 'numbers', title: '', width: 80}, |
| | | {title: '操作', toolbar: '#scGroupOption', minWidth: 200, align: 'center'}, |
| | | {field: 'orderCnt', title: '排序', minWidth: 100,align:'center'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'center'}, |
| | | {title: '推荐首页', templet: '#hotStateSwitch', minWidth: 100,align:'center'}, |
| | | {title: '状态', templet: '#groupStatusSwitch', minWidth: 100,align:'center'}, |
| | | {title: '是否删除', templet: '#deleteFlag', minWidth: 100,align:'center'}, |
| | | {field: 'createdTime', title: '创建时间', minWidth: 150,align:'left'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(hotStateSwitch)', function (data) { |
| | | if (data.elem.checked) { |
| | | groupState(data.value,1); |
| | | } else { |
| | | groupState(data.value,1); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(groupStatusSwitch)', function (data) { |
| | | if (data.elem.checked) { |
| | | groupState(data.value,2); |
| | | } else { |
| | | groupState(data.value,2); |
| | | } |
| | | }) |
| | | function groupState(id,type) { |
| | | febs.get(ctx + 'admin/socialCircle/groupState/' + id+'/' + type, null, function (data) { |
| | | febs.alert.success(data.message); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | status: $searchForm.find("select[name='status']").val(), |
| | | hotState: $searchForm.find("select[name='hotState']").val(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-sc" lay-title="社区内容列表"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="activity-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">标题</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="标题" name="name" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">分类</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="categoryId" class="sc-type"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="state"> |
| | | <option value="">请选择</option> |
| | | <option value="0">隐藏</option> |
| | | <option value="1">展示</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="scTable" lay-data="{id: 'scTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="list:view,add:add,votesActivityUpdate:update"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="votesActivityUpdate:update"><i |
| | | class="layui-icon febs-edit-area febs-blue"></i></a> |
| | | </script> |
| | | <script type="text/html" id="scStateSwitch"> |
| | | {{# if(d.state === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="展示|隐藏" checked lay-skin="switch" lay-filter="scStateSwitch"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="展示|隐藏" lay-skin="switch" lay-filter="scStateSwitch"> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/html" id="scToolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="add:add" lay-event="scAdd">新增内容</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="activityOption"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="votesActivityUpdate:update" lay-event="scUpdateEvent">编辑</button> |
| | | <button class="layui-btn layui-btn-danger layui-btn-sm" type="button" shiro:hasPermission="votesActivityUpdate:update" lay-event="scDeleteEvent">删除</button> |
| | | </script> |
| | | |
| | | <style> |
| | | .layui-form-onswitch { |
| | | background-color: #5FB878 !important; |
| | | } |
| | | </style> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-sc'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'phone', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/socialCircle/allGroup', function (res) { |
| | | var data = res.data; |
| | | for (let k in data) |
| | | { |
| | | $(".sc-type").append("<option value='" + data[k].id + "'>" + data[k].name + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | // 表格初始化 |
| | | initscTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(scTable)', function (obj) { |
| | | console.log("触发事件:", obj.event); // 调试信息 |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'scDeleteEvent') { |
| | | febs.modal.confirm('删除', '确认删除该内容?', function () { |
| | | delAct(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'seeImgThumb') { |
| | | var t = $view.find('#seeImgThumb'+data.id+''); |
| | | //页面层 |
| | | layer.open({ |
| | | type: 1, |
| | | title: "图片", |
| | | skin: 'layui-layer-rim', //加上边框 |
| | | area: ['100%', '100%'], //宽高 |
| | | shadeClose: true, //开启遮罩关闭 |
| | | end: function (index, layero) { |
| | | return false; |
| | | }, |
| | | content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' |
| | | }); |
| | | } |
| | | if (layEvent === 'scUpdateEvent') { |
| | | febs.modal.open('编辑','modules/socialCircle/discountUpdate/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | area: ['100%', '100%'], |
| | | yes: function (index, layero) { |
| | | $('#febs-sc-discount').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | form.on('switch(scStateSwitch)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeState(data.value,1); |
| | | } else { |
| | | changeState(data.value,0); |
| | | } |
| | | }) |
| | | function changeState(id,state) { |
| | | febs.get(ctx + 'admin/socialCircle/changeState/' + id+'/' + state, null, function (data) { |
| | | febs.alert.success(data.message); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function delAct(id) { |
| | | febs.get(ctx + 'admin/socialCircle/delActivity/' + id, null, function (data) { |
| | | febs.alert.success(data.message); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('toolbar(scTable)', function (obj) { |
| | | let data = obj.data, |
| | | layEvent = obj.event; |
| | | console.log("触发事件:", obj.event); // 调试信息 |
| | | if(layEvent === 'scAdd'){ |
| | | febs.modal.open('新增', 'modules/socialCircle/add/', { |
| | | btn: ['提交', '取消'], |
| | | area:['100%','100%'], |
| | | yes: function (index, layero) { |
| | | $('#febs-sc-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function initscTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'scTable', |
| | | url: ctx + 'admin/socialCircle/list', |
| | | toolbar:"#scToolbar", |
| | | defaultToolbar:[], |
| | | cols: [[ |
| | | |
| | | {type: 'numbers', title: '', width: 80}, |
| | | {title: '操作', toolbar: '#activityOption', minWidth: 200, align: 'center'}, |
| | | {field: 'name', title: '名称', minWidth: 150,align:'left'}, |
| | | {field: 'memberName', title: '发布人', minWidth: 150,align:'left'}, |
| | | {field: 'categoryName', title: '分类', minWidth: 150,align:'left'}, |
| | | {field: 'name', title: '标题', minWidth: 150,align:'left'}, |
| | | {field: 'state', title: '状态', templet: '#scStateSwitch', minWidth: 130,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | state: $searchForm.find("select[name='state']").val(), |
| | | categoryId: $searchForm.find("select[name='categoryId']").val(), |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
| | |
| | | <option value="0">关闭</option> |
| | | <option value="1">开启</option> |
| | | </select> |
| | | <div class="layui-form-mid layui-word-aux">关闭的情况下,门票总数,门票价格,请填写0</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="payAmount" lay-verify="required" |
| | | placeholder="" autocomplete="off" class="layui-input"> |
| | | <div class="layui-form-mid layui-word-aux">门票价格(关闭众筹,或者免费参与,请填写0)</div> |
| | | <div class="layui-form-mid layui-word-aux">门票价格(免费参与,请填写0)</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <option value="0">关闭</option> |
| | | <option value="1">开启</option> |
| | | </select> |
| | | <div class="layui-form-mid layui-word-aux">关闭的情况下,门票总数,门票价格,请填写0</div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | |
| | | 1: {title: '余额', color: 'blue'}, |
| | | 2: {title: '微信', color: 'green'}, |
| | | 3: {title: '积分', color: 'orange'}, |
| | | 4: {title: '免费', color: 'red'}, |
| | | 0: {title: '免费', color: 'red'}, |
| | | }[d.payType]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{payType.color}}">{{ payType.title }}</span> |