12 files added
9 files modified
| | |
| | | import com.matrix.system.activity.dto.AddSignAwardSetDto; |
| | | import com.matrix.system.activity.dto.BeCloseDto; |
| | | import com.matrix.system.activity.dto.BeReadyDto; |
| | | import com.matrix.system.activity.dto.CouponDto; |
| | | import com.matrix.system.activity.dto.DelRowDto; |
| | | import com.matrix.system.activity.dto.GoodsDto; |
| | | import com.matrix.system.activity.dto.SignForUpdateDto; |
| | | import com.matrix.system.activity.dto.SignReceiveListDto; |
| | | import com.matrix.system.activity.dto.UpdateSignAwardSetDto; |
| | | import com.matrix.system.activity.service.ActivitySignAwardSetService; |
| | | import com.matrix.system.activity.vo.ActivitiesListVo; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | public @ResponseBody |
| | | AjaxResult addSignAwardSet(@RequestBody AddSignAwardSetDto addSignAwardSetDto) { |
| | | return activitySignAwardSetService.activitySignAwardSetService(addSignAwardSetDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询优惠券 |
| | | */ |
| | | @ApiOperation(value = "查询优惠券") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = CouponVo.class) |
| | | }) |
| | | @PostMapping(value = "/selectCouponList") |
| | | public @ResponseBody |
| | | AjaxResult selectCouponList(@RequestBody CouponDto couponDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(couponDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(couponDto.getSort())){ |
| | | couponDto.setSort("create_time"); |
| | | couponDto.setOrder("desc"); |
| | | } |
| | | Page<CouponVo> page = new Page(couponDto.getPageNum(), couponDto.getPageSize()); |
| | | IPage<CouponVo> rows = activitySignAwardSetService.selectCouponList(page,couponDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 查询商品 |
| | | */ |
| | | @ApiOperation(value = "查询商品") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = GoodsVo.class) |
| | | }) |
| | | @PostMapping(value = "/selectGoodsList") |
| | | public @ResponseBody |
| | | AjaxResult selectGoodsList(@RequestBody GoodsDto goodsDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(goodsDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(goodsDto.getSort())){ |
| | | goodsDto.setSort("create_time"); |
| | | goodsDto.setOrder("desc"); |
| | | } |
| | | Page<GoodsVo> page = new Page(goodsDto.getPageNum(), goodsDto.getPageSize()); |
| | | IPage<GoodsVo> rows = activitySignAwardSetService.selectGoodsList(page,goodsDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | return activitySignAwardSetService.beClose(beCloseDto); |
| | | } |
| | | |
| | | /** |
| | | * 活动统计 |
| | | */ |
| | | @ApiOperation(value = "活动统计") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = SignReceiveListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findSignReceiveList") |
| | | public @ResponseBody |
| | | AjaxResult findSignReceiveList(@RequestBody SignReceiveListDto signReceiveListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signReceiveListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(signReceiveListDto.getSort())){ |
| | | signReceiveListDto.setSort("create_time"); |
| | | signReceiveListDto.setOrder("desc"); |
| | | } |
| | | Page<SignReceiveListVo> page = new Page(signReceiveListDto.getPageNum(), signReceiveListDto.getPageSize()); |
| | | IPage<SignReceiveListVo> rows = activitySignAwardSetService.findSignReceiveList(page,signReceiveListDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *进入修改 |
| | | */ |
| | | @ApiOperation(value = "进入修改") |
| | | @PostMapping(value = "/findSignForUpdate") |
| | | public @ResponseBody |
| | | AjaxResult findSignForUpdate(@RequestBody SignForUpdateDto signForUpdateDto) { |
| | | return activitySignAwardSetService.findSignForUpdate(signForUpdateDto); |
| | | } |
| | | |
| | | /** |
| | | * 保存 |
| | | */ |
| | | @PostMapping(value = "/updateSignAwardSet") |
| | | public @ResponseBody |
| | | AjaxResult updateSignAwardSet(@RequestBody UpdateSignAwardSetDto updateSignAwardSetDto) { |
| | | return activitySignAwardSetService.updateSignAwardSet(updateSignAwardSetDto); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.activity.dto.CouponDto; |
| | | import com.matrix.system.activity.dto.GoodsDto; |
| | | import com.matrix.system.activity.dto.SignReceiveListDto; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | |
| | | /** |
| | | * @description 领 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | public interface ActivitySignReceiveRecordDao extends BaseMapper<ActivitySignReceiveRecord>{ |
| | | |
| | | IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, |
| | | @Param("record")SignReceiveListDto signReceiveListDto); |
| | | |
| | | IPage<CouponVo> selectCouponList(Page<CouponVo> page, @Param("record")CouponDto couponDto); |
| | | |
| | | IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, @Param("record")GoodsDto goodsDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "CouponDto", description = "查询参数") |
| | | public class CouponDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String yhjmc; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GoodsDto", description = "查询参数") |
| | | public class GoodsDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="商品名称") |
| | | private String cpmc; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignForUpdateDto", description = "参数") |
| | | public class SignForUpdateDto { |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignReceiveListDto", description = "参数") |
| | | public class SignReceiveListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String yhmc; |
| | | |
| | | @ApiModelProperty(value ="签到开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="签到结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateSignAwardSetDto", description = "查询参数") |
| | | public class UpdateSignAwardSetDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | |
| | | private SignSetBasicJsonDto signSetBasicJsonDto; |
| | | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
| | |
| | | */ |
| | | |
| | | |
| | | private Integer awardType; |
| | | private int awardType; |
| | | |
| | | /** |
| | | * 奖项规则(1:每日奖励(默认)2:累计签到天数) |
| | | */ |
| | | |
| | | |
| | | private Integer awardRule; |
| | | private int awardRule; |
| | | |
| | | /** |
| | | * 签到累计天数 |
| | | */ |
| | | |
| | | |
| | | private Integer cumulativeDay; |
| | | private int cumulativeDay; |
| | | |
| | | /** |
| | | * 奖项名称 |
| | |
| | | */ |
| | | |
| | | |
| | | private Integer awardInventoryCnt; |
| | | private int awardInventoryCnt; |
| | | |
| | | /** |
| | | * 已派发数量 |
| | | */ |
| | | |
| | | |
| | | private Integer awardDistributeCnt; |
| | | private int awardDistributeCnt; |
| | | |
| | | /** |
| | | * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) |
| | | */ |
| | | |
| | | |
| | | private Integer awardWay; |
| | | private int awardWay; |
| | | |
| | | /** |
| | | * 奖品是否有效(1:有效 2:无效) |
| | | */ |
| | | private int awardState; |
| | | public static final int AWARDSTATE_WORK = 1; |
| | | public static final int AWARDSTATE_UNWORK = 2; |
| | | |
| | | /** |
| | | * 操作提示 |
| | |
| | | */ |
| | | |
| | | |
| | | private Integer scoreCnt; |
| | | private int scoreCnt; |
| | | |
| | | /** |
| | | * 优惠券ID |
| | | */ |
| | | |
| | | |
| | | private String couponName; |
| | | |
| | | private String couponId; |
| | | |
| | |
| | | * 商品ID |
| | | */ |
| | | |
| | | private String goodsName; |
| | | |
| | | private String goodsId; |
| | | |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dto.ActivitiesListDto; |
| | | import com.matrix.system.activity.dto.AddSignAwardSetDto; |
| | | import com.matrix.system.activity.dto.BeCloseDto; |
| | | import com.matrix.system.activity.dto.BeReadyDto; |
| | | import com.matrix.system.activity.dto.DelRowDto; |
| | | import com.matrix.system.activity.dto.SignSetBasicJsonDto; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dto.*; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.vo.ActivitiesListVo; |
| | | import com.matrix.system.activity.vo.AddSignAwardSetVo; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | import com.matrix.system.activity.vo.SignSetBasicJsonVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | @Autowired |
| | | private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | |
| | | @Transactional |
| | | public AjaxResult activitySignAwardSetService(AddSignAwardSetDto addSignAwardSetDto) { |
| | |
| | | activitySignAwardSet.setUpdateBy(user.getSuName()); |
| | | activitySignAwardSet.setCompanyId(companyId); |
| | | activitySignAwardSet.setActivityId(shopActivities.getId()); |
| | | activitySignAwardSet.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); |
| | | activitySignAwardSetDao.insert(activitySignAwardSet); |
| | | } |
| | | } |
| | |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | public IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, |
| | | SignReceiveListDto signReceiveListDto) { |
| | | return activitySignReceiveRecordDao.findSignReceiveList(page,signReceiveListDto); |
| | | } |
| | | |
| | | public AjaxResult findSignForUpdate(SignForUpdateDto signForUpdateDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signForUpdateDto); |
| | | Long actId = signForUpdateDto.getActId(); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //获取对应的活动主表信息和对应的奖品设置信息 |
| | | AddSignAwardSetVo addSignAwardSetVo = new AddSignAwardSetVo(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | if(ObjectUtil.isNotEmpty(shopActivity)) { |
| | | addSignAwardSetVo.setId(actId); |
| | | addSignAwardSetVo.setActName(shopActivity.getActName()); |
| | | addSignAwardSetVo.setActCode(shopActivity.getActCode()); |
| | | addSignAwardSetVo.setBeginTime(shopActivity.getActBeginTime()); |
| | | addSignAwardSetVo.setEndTime(shopActivity.getActEndTime()); |
| | | |
| | | String actContent = shopActivity.getActContent(); |
| | | SignSetBasicJsonVo signSetBasicJsonVo = JSON.parseObject(actContent, SignSetBasicJsonVo.class); |
| | | addSignAwardSetVo.setSignSetBasicJsonDto(signSetBasicJsonVo); |
| | | |
| | | Map<String, Object> columnMap = new HashMap<String, Object>(); |
| | | columnMap.put("activity_id", actId); |
| | | columnMap.put("company_id", signForUpdateDto.getCompanyId()); |
| | | List<ActivitySignAwardSet> activitySignAwardSets = activitySignAwardSetDao.selectByMap(columnMap); |
| | | addSignAwardSetVo.setActivitySignAwardSets(activitySignAwardSets); |
| | | } |
| | | result.putInMap("addSignAwardSetVo", addSignAwardSetVo); |
| | | return result; |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult updateSignAwardSet(UpdateSignAwardSetDto updateSignAwardSetDto) { |
| | | //获取当前登录人员信息 |
| | | QueryUtil.setQueryLimitCom(updateSignAwardSetDto); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long actId = updateSignAwardSetDto.getActId(); |
| | | Long companyId = user.getCompanyId(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | //更新活动主表信息 |
| | | shopActivity.setActName(updateSignAwardSetDto.getActName()); |
| | | shopActivity.setActCode(updateSignAwardSetDto.getActCode()); |
| | | shopActivity.setActBeginTime(updateSignAwardSetDto.getBeginTime()); |
| | | shopActivity.setActEndTime(updateSignAwardSetDto.getEndTime()); |
| | | shopActivity.setCompanyId(companyId); |
| | | shopActivity.setCreateBy(user.getSuName()); |
| | | shopActivity.setUpdateBy(user.getSuName()); |
| | | //将基本信息转换成JSON字符串存储到活动主表的act_content字段 |
| | | SignSetBasicJsonDto signSetBasicJsonDto = updateSignAwardSetDto.getSignSetBasicJsonDto(); |
| | | String json=JSON.toJSONString(signSetBasicJsonDto); |
| | | shopActivity.setActContent(json); |
| | | shopActivitiesDao.updateByModel(shopActivity); |
| | | /** |
| | | * 比较两个奖品名单,多的新增,减少的更新为已失效,不变的更新 |
| | | */ |
| | | //原有的奖品 |
| | | ArrayList<Long> arrayListOld = new ArrayList<>(); |
| | | Map<String, Object> columnMap = new HashMap<String, Object>(); |
| | | columnMap.put("activity_id", actId); |
| | | columnMap.put("company_id", updateSignAwardSetDto.getCompanyId()); |
| | | List<ActivitySignAwardSet> activitySignAwardSetOld = activitySignAwardSetDao.selectByMap(columnMap); |
| | | if(CollUtil.isNotEmpty(activitySignAwardSetOld)) { |
| | | for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetOld) { |
| | | Long actSubid = activitySignAwardSetUpdate.getId(); |
| | | arrayListOld.add(actSubid); |
| | | } |
| | | } |
| | | //修改后的奖品 |
| | | List<ActivitySignAwardSet> activitySignAwardSetsUpdate = updateSignAwardSetDto.getActivitySignAwardSets(); |
| | | ArrayList<Long> arrayListUpdate = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(activitySignAwardSetsUpdate)) { |
| | | for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetsUpdate) { |
| | | Long actSubid = activitySignAwardSetUpdate.getId(); |
| | | //如果ID为空则新增,不为空则修改 |
| | | if(ObjectUtil.isEmpty(actSubid)) { |
| | | activitySignAwardSetUpdate.setCreateBy(user.getSuName()); |
| | | activitySignAwardSetUpdate.setCreateTime(new Date()); |
| | | activitySignAwardSetUpdate.setUpdateTime(new Date()); |
| | | activitySignAwardSetUpdate.setUpdateBy(user.getSuName()); |
| | | activitySignAwardSetUpdate.setCompanyId(companyId); |
| | | activitySignAwardSetUpdate.setActivityId(actId); |
| | | activitySignAwardSetDao.insert(activitySignAwardSetUpdate); |
| | | }else { |
| | | activitySignAwardSetDao.updateById(activitySignAwardSetUpdate); |
| | | arrayListUpdate.add(actSubid); |
| | | } |
| | | } |
| | | } |
| | | //比较获取原来的比现在多出来的奖品,修改状态为失效 |
| | | boolean removeAll = arrayListOld.removeAll(arrayListUpdate); |
| | | if(removeAll && CollUtil.isNotEmpty(arrayListOld)) { |
| | | for(long id : arrayListOld) { |
| | | ActivitySignAwardSet activitySignAwardSetDel = activitySignAwardSetDao.selectById(id); |
| | | activitySignAwardSetDel.setAwardState(ActivitySignAwardSet.AWARDSTATE_UNWORK); |
| | | activitySignAwardSetDao.updateById(activitySignAwardSetDel); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | | public IPage<CouponVo> selectCouponList(Page<CouponVo> page, CouponDto couponDto) { |
| | | return activitySignReceiveRecordDao.selectCouponList(page,couponDto); |
| | | } |
| | | |
| | | public IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, GoodsDto goodsDto) { |
| | | return activitySignReceiveRecordDao.selectGoodsList(page,goodsDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddSignAwardSetVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | |
| | | private SignSetBasicJsonVo signSetBasicJsonDto; |
| | | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | |
| | | |
| | | /** |
| | | * 优惠券名称 |
| | | */ |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String cName; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GoodsVo { |
| | | |
| | | private Long id; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 商品分类 组合商品/家居产品/项目/充值卡/综合卡 |
| | | */ |
| | | private String goodType; |
| | | |
| | | /** |
| | | * 产品编码 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 售价/本金 |
| | | */ |
| | | private Double sealPice; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SignReceiveListVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "签到时间") |
| | | private Date reciveTime; |
| | | |
| | | @ApiModelProperty(value = "连续签到天数") |
| | | private Integer cumulativeDay; |
| | | |
| | | @ApiModelProperty(value = "奖励类型") |
| | | private String awardType; |
| | | |
| | | @ApiModelProperty(value = "获得奖励") |
| | | private String awardName; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SignSetBasicJsonVo { |
| | | |
| | | @ApiModelProperty(value ="标题图片") |
| | | private String imageUrlTitle; |
| | | @ApiModelProperty(value ="头部图片") |
| | | private String imageUrlHead; |
| | | @ApiModelProperty(value ="按钮图片") |
| | | private String imageUrlButton; |
| | | @ApiModelProperty(value ="状态图片") |
| | | private String imageUrlState; |
| | | |
| | | @ApiModelProperty(value ="规则内容") |
| | | private String ruleExplain; |
| | | @ApiModelProperty(value ="字体颜色") |
| | | private String typographyColor; |
| | | @ApiModelProperty(value ="背景颜色") |
| | | private String backgroundColor; |
| | | @ApiModelProperty(value ="字体大小") |
| | | private Integer typographyNum; |
| | | @ApiModelProperty(value ="字体透明度") |
| | | private Integer typographyLight; |
| | | |
| | | } |
| | |
| | | ALTER TABLE `shop_activities` |
| | | ADD COLUMN `act_code` varchar(200) NULL COMMENT '活动编码' AFTER `id`; |
| | | |
| | | ALTER TABLE `activity_sign_award_set` |
| | | ADD COLUMN `award_state` int(4) NULL COMMENT '奖品是否有效(1:有效 2:无效)' AFTER `company_id`; |
| | | |
| | | ALTER TABLE `activity_sign_award_set` |
| | | ADD COLUMN `goods_name` varchar(200) NULL COMMENT '产品名称' AFTER `coupon_id`; |
| | | |
| | | ALTER TABLE `activity_sign_award_set` |
| | | ADD COLUMN `coupon_name` varchar(200) NULL COMMENT '优惠券名' AFTER `score_cnt`; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | <select id="findSignReceiveList" resultType="com.matrix.system.activity.vo.SignReceiveListVo"> |
| | | SELECT |
| | | a.id id, |
| | | b.nick_name nickName, |
| | | a.receive_time reciveTime, |
| | | c.cumulative_day cumulativeDay, |
| | | c.award_type awardType, |
| | | c.award_name awardName |
| | | FROM |
| | | activity_sign_receive_record a |
| | | LEFT JOIN biz_user b ON a.open_id = b.open_id |
| | | LEFT JOIN activity_sign_award_set c ON a.award_id = c.id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | and a.activity_id = #{record.actId} |
| | | <if test="record.yhmc != null and record.yhmc != ''"> |
| | | and b.nick_name like concat('%',#{record.yhmc},'%') |
| | | </if> |
| | | <if test="record.startTime != null "> |
| | | and a.receive_time >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null"> |
| | | and #{record.endTime} >= a.receive_time |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectCouponList" resultType="com.matrix.system.activity.vo.CouponVo"> |
| | | SELECT |
| | | a.id id, |
| | | a.c_name cName, |
| | | a.end_time endTime |
| | | FROM |
| | | shop_coupon a |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | <if test="record.yhjmc != null and record.yhjmc != ''"> |
| | | and a.c_name like concat('%',#{record.yhjmc},'%') |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectGoodsList" resultType="com.matrix.system.activity.vo.GoodsVo"> |
| | | SELECT |
| | | a.id id, |
| | | a.name name, |
| | | a.good_type goodType, |
| | | a.code code, |
| | | a.seal_pice sealPice |
| | | FROM |
| | | shopping_goods a |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | <if test="record.cpmc != null and record.cpmc != ''"> |
| | | and a.name like concat('%',#{record.cpmc},'%') |
| | | </if> |
| | | </where> |
| | | <if test="record.sort !=null"> |
| | | order by |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | update_time, |
| | | id, |
| | | act_name, |
| | | act_code, |
| | | act_type, |
| | | act_begin_time, |
| | | act_end_time, |
| | |
| | | now(), |
| | | #{item.id}, |
| | | #{item.actName}, |
| | | #{item.actCode}, |
| | | #{item.actType}, |
| | | #{item.actBeginTime}, |
| | | #{item.actEndTime}, |
| | |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .box-card { |
| | | width: 240px; |
| | | border-radius: 5px; |
| | | color: #ffffff; |
| | | padding: 2px 0px; |
| | | margin-right: 20px; |
| | | cursor: pointer; |
| | | float: left; |
| | | text-align: center; |
| | | } |
| | | .el-card__body { |
| | | padding: 0px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="400"> |
| | | <template slot-scope="scope"> |
| | | <el-row style="display:flex;"> |
| | | <el-row style="display:flex;" v-if="scope.row.actType == 4"> |
| | | <el-button type="primary" v-if="scope.row.actStatus == 1" size="mini" @click="beReady(scope.row)">发布</el-button> |
| | | <el-button type="primary" v-if="[1,2,3].includes(scope.row.actStatus)" size="mini">修改</el-button> |
| | | <el-button type="primary" v-if="[1,2,3].includes(scope.row.actStatus)" @click="beUpdate(scope.row)" size="mini">修改</el-button> |
| | | <el-button type="primary" v-if="scope.row.actStatus == 3" size="mini">推广</el-button> |
| | | <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" size="mini">活动统计</el-button> |
| | | <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openSignReceive(scope.row)" size="mini">活动统计</el-button> |
| | | <el-button type="primary" v-if="scope.row.actStatus == 3" @click="beClose(scope.row)" size="mini">关闭</el-button> |
| | | <el-button type="danger" v-if="scope.row.actStatus != 5" size="mini" @click="delRow(scope.row)">删除</el-button> |
| | | </el-row> |
| | |
| | | let _this = this; |
| | | _this.loadActivitysList(); |
| | | }, |
| | | //修改 |
| | | beUpdate(row){ |
| | | layer.full(layer.open({ |
| | | type: 2, |
| | | title: "修改", |
| | | maxmin: true, |
| | | area: [MUI.SIZE_L, '500px'], |
| | | content : [ basePath + '/admin/redirect/activity/activity-sign-update?actId=' + row.id] |
| | | })); |
| | | }, |
| | | //活动统计 |
| | | openSignReceive(row){ |
| | | layer.full(layer.open({ |
| | | type: 2, |
| | | title: "活动统计", |
| | | maxmin: true, |
| | | area: [MUI.SIZE_L, '500px'], |
| | | content : [ basePath + '/admin/redirect/activity/activity-sign-receive?actId=' + row.id] |
| | | })); |
| | | }, |
| | | //发布 |
| | | beReady(row){ |
| | | let _this = this; |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | |
| | | <!-- 富文本编辑器 --> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.config.js}"></script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.all.js}"> |
| | | </script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> |
| | | <style> |
| | | .panel-body{ |
| | | overflow: hidden; |
| | | } |
| | | .paginationStyle{ |
| | | background: #ffffff; |
| | | padding: 10px 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="panel-body" id="app" v-cloak> |
| | | <el-row> |
| | | <el-row justify="space-between" type="flex"> |
| | | <el-col> |
| | | <el-form ref="form" :model="form" inline > |
| | | <el-form-item label="用户名称" prop="yhmc" > |
| | | <el-input v-model="form.yhmc" placeholder="用户名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="qdsj" label="签到时间"> |
| | | <el-date-picker |
| | | v-model="form.qdsj" |
| | | type="datetimerange" |
| | | :picker-options="pickerOptions" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | align="right"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button> |
| | | <el-button @click="resetFormSignReceive('form')">重置</el-button> |
| | | </el-form> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | <el-table ref="multipleTable" |
| | | :data="signReceiveList.rows" |
| | | :height="height" |
| | | stripe:true |
| | | @sort-change="sortChange" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column |
| | | type="selection"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="nickName" |
| | | label="用户" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="reciveTime" |
| | | label="签到时间" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="cumulativeDay" |
| | | label="连续签到天数" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="奖励类型"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.awardType == 1">自定义礼品</span> |
| | | <span v-if="scope.row.awardType == 2">积分</span> |
| | | <span v-if="scope.row.awardType == 3">优惠券</span> |
| | | <span v-if="scope.row.awardType == 4">店铺商品</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="awardName" |
| | | label="获得奖励" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSignReceive" |
| | | @current-change="changeCurrentPageSignReceive" |
| | | :current-page="signReceiveList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="signReceiveList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="signReceiveList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-row> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | |
| | | <script> |
| | | //获取传输的活动对象 |
| | | var actId = $.query.get("actId"); |
| | | |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | height:'calc(100vh - 200px)', |
| | | //--时间选择 |
| | | pickerOptions: { |
| | | shortcuts: [{ |
| | | text: '最近一周', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近一个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }, { |
| | | text: '最近三个月', |
| | | onClick(picker) { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); |
| | | picker.$emit('pick', [start, end]); |
| | | } |
| | | }] |
| | | }, |
| | | // 条件查询 |
| | | form:{ |
| | | yhmc:'', |
| | | qdsj:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | //活动列表 |
| | | signReceiveList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | | methods: { |
| | | //加载分类 |
| | | loadInfo() { |
| | | let _this = this; |
| | | _this.loadSignReceiveList(); |
| | | }, |
| | | //--列表 |
| | | loadSignReceiveList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParamSignReceive(); |
| | | data.pageSize=_this.signReceiveList.pageSize; |
| | | data.pageNum=_this.signReceiveList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/activitySignAwardSet/findSignReceiveList', |
| | | callback: function (data) { |
| | | _this.signReceiveList.rows = data.rows; |
| | | _this.signReceiveList.total = data.total; |
| | | } |
| | | }); |
| | | },//查询参数 |
| | | getRequestParamSignReceive(){ |
| | | let _this = this; |
| | | let startTime = ''; |
| | | let endTime = ''; |
| | | if(_this.form.qdsj.length > 0){ |
| | | startTime = _this.form.qdsj[0]; |
| | | endTime = _this.form.qdsj[1]; |
| | | } |
| | | return { |
| | | yhmc:_this.form.yhmc, |
| | | startTime:startTime, |
| | | endTime:endTime, |
| | | actId:actId, |
| | | order:_this.form.order, |
| | | sort:_this.form.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | searchFormSignReceive:function(){ |
| | | this.signReceiveList.currentPage=1; |
| | | this.loadSignReceiveList(); |
| | | }, |
| | | //重置 |
| | | resetFormSignReceive(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | changePageSignReceive(val) { |
| | | this.signReceiveList.pageSize = val; |
| | | this.loadSignReceiveList(); |
| | | }, |
| | | changeCurrentPageSignReceive(val) { |
| | | this.signReceiveList.currentPage = val; |
| | | this.loadSignReceiveList(); |
| | | }, |
| | | //排序 |
| | | sortChange:function (column){ |
| | | if(column.order){ |
| | | if(column.order.indexOf("desc")){ |
| | | this.form.order="desc"; |
| | | }else{ |
| | | this.form.order="asc"; |
| | | } |
| | | this.form.sort=column.prop; |
| | | this.loadInfo(); |
| | | } |
| | | }, |
| | | //选择 |
| | | handleSelectionChange(val) { |
| | | let _this = this; |
| | | _this.multipleSelection = val; |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE HTML> |
| | | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> |
| | | <meta name="renderer" content="webkit|ie-comp|ie-stand"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> |
| | | <meta http-equiv="Cache-Control" content="no-siteapp"/> |
| | | <!-- 本框架基本脚本和样式 --> |
| | | <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> |
| | | <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> |
| | | <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}"> |
| | | <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> |
| | | |
| | | <!-- 富文本编辑器 --> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.config.js}"></script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/ueditor.all.js}"> |
| | | </script> |
| | | <script type="text/javascript" charset="utf-8" |
| | | th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> |
| | | <style> |
| | | |
| | | .el-aside { |
| | | background-color: #D3DCE6; |
| | | color: #333; |
| | | text-align: center; |
| | | } |
| | | .el-main { |
| | | background-color: #E9EEF3; |
| | | color: #333; |
| | | } |
| | | body > .el-container { |
| | | margin-bottom: 1000px; |
| | | } |
| | | .button { |
| | | padding: 5px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .imageOne { |
| | | display: block; |
| | | height: 50px; |
| | | padding: 5px 5px; |
| | | text-align: center; |
| | | } |
| | | .imageTwo { |
| | | display: block; |
| | | height: 50px; |
| | | padding: 5px 5px; |
| | | text-align: center; |
| | | } |
| | | .imageThree { |
| | | display: block; |
| | | height: 50px; |
| | | padding: 5px 5px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .box-card { |
| | | padding: 5px 5px; |
| | | } |
| | | |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="panel-body" id="app" v-cloak> |
| | | <el-form :model="ruleForm" :rules="rules" class="form-horizontal" id="dataform" ref="ruleForm" label-width="120px"> |
| | | |
| | | <el-container> |
| | | <el-aside width="30%"> |
| | | <el-card class="box-card" :body-style="{ padding: '10px 10px'}"> |
| | | <div @click="uploadImg()" class="imageOne"> |
| | | <img v-if="imageUrlTitle" :src="imageUrlTitle" style="width: 100%;"> |
| | | <el-button type="primary" v-show="imageUrlTitle == ''" round><span style="font-size: 20px;">标题</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> |
| | | </div> |
| | | <div @click="uploadImg()" class="imageTwo" > |
| | | <img v-if="imageUrlHead" :src="imageUrlHead" style="width: 100%;"> |
| | | <el-button type="primary" v-show="imageUrlHead == ''" round><span style="font-size: 20px;">头部</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> |
| | | </div> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <div style="padding:5px;font-size: 15px;text-align: left;"><span>您已累计签到<span style="color: red;">3</span>天</span></div> |
| | | </el-col> |
| | | <el-col> |
| | | <div style="padding:5px;font-size: 15px;text-align: right;"><span>签到提醒</span></div> |
| | | </el-col> |
| | | </el-row> |
| | | <div @click="uploadImg()"> |
| | | <el-calendar :range="['2019-03-04', '2019-03-24']"></el-calendar> |
| | | <img v-if="imageUrlState" :src="imageUrlState" style="width: 100%;"> |
| | | <el-button type="primary" v-show="imageUrlState == ''" round><span style="font-size: 20px;">日历签到背景</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> |
| | | </div> |
| | | <div @click="uploadImg()" class="imageThree" > |
| | | <el-button type="primary" v-show="imageUrlButton == ''" round><span style="font-size: 20px;">签到按钮</span><span style="padding:5px;font-size: 15px;color: red;">(上传图片)</span></span></el-button> |
| | | <img v-if="imageUrlButton" :src="imageUrlButton" style="width: 100%;"> |
| | | </div> |
| | | |
| | | <div style="text-align: center;padding: 5px;" @click="gzsmSet()"> |
| | | <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> |
| | | <span style="padding:5px;font-size: 30px;">-- 规则说明--</span> |
| | | </div> |
| | | <div class="el-col-sm-24" style="text-align: center;"> |
| | | <span style="padding:5px;font-size: 15px;color: red;">(点击,编辑规则内容,背景颜色,字体颜色、大小、透明度)</span> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> |
| | | <span style="padding:5px;font-size: 15px;">1、每天参与签到可获得积分</span> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> |
| | | <span style="padding:5px;font-size: 15px;">2、连续签到7天将获得赠送大礼包</span> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-2" style="text-align: left;"> |
| | | <span style="padding:5px;font-size: 15px;">3、每7天重新开始计算</span> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </el-aside> |
| | | |
| | | <el-main width="70%"> |
| | | <div> |
| | | <el-tabs v-model="activeName" > |
| | | <el-tab-pane label="活动设置" name="first"> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="活动名称" prop="actName"> |
| | | <el-input v-model="ruleForm.actName" placeholder="请输入活动名称"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="活动编码" prop="actCode"> |
| | | <el-input v-model.number="ruleForm.actCode" placeholder="请输入最大开团数量"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="col-sm-4 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="活动时间" prop="actTime"> |
| | | <div class="block"> |
| | | <el-date-picker |
| | | v-model="ruleForm.actTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | </el-form-item> |
| | | </div> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="奖品设置" name="second"> |
| | | <el-row style="display:flex;"> |
| | | <el-col :span="20"> |
| | | <el-tabs v-model="editableTabsValue" type="card" closable @tab-remove="removeTab"> |
| | | <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title" :name="item.name"> |
| | | <el-row v-show="editableTabsValue !== '1'"> |
| | | <el-form-item label="签到累计天数"> |
| | | <el-input v-model.number="item.content.cumulativeDay" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row> |
| | | <el-form-item label="奖项类型"> |
| | | <el-col> |
| | | <el-radio-group v-model="item.content.awardType" @change="jxlxChange"> |
| | | <el-radio :label="1">自定义奖品</el-radio> |
| | | <el-radio :label="2">积分</el-radio> |
| | | <el-radio :label="3">优惠券</el-radio> |
| | | <el-radio :label="4">商品</el-radio> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </el-row> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="奖项名称"> |
| | | <el-input v-model="item.content.awardName" placeholder="奖项名称"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="图片介绍"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="introduceImgSuccess"> |
| | | <img v-if="item.content.introduceImg" :src="item.content.introduceImg" style="max-width: 200px;"> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <div v-show="item.content.awardType !== 2"> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="奖项库存"> |
| | | <el-input v-model="item.content.awardInventoryCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="已派发"> |
| | | <el-input v-model="item.content.awardDistributeCnt"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="item.content.awardType === 1"> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="文字介绍"> |
| | | <el-input type="textarea" v-model="item.content.introduceTip"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="兑奖方式"> |
| | | <el-col> |
| | | <el-radio-group v-model="item.content.awardWay" @change="awardWayChange"> |
| | | <el-radio :label="1">线下兑换</el-radio> |
| | | <el-radio :label="2">物流配送</el-radio> |
| | | <el-radio :label="3">客服兑换</el-radio> |
| | | </el-radio-group> |
| | | </el-col> |
| | | </el-form-item > |
| | | </el-col> |
| | | </el-row> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="操作提示"> |
| | | <el-input v-model="item.content.operationTip"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-show="item.content.awardWay === 1"> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="兑奖地址"> |
| | | <el-input v-model="item.content.prizeAddress"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <div v-show="item.content.awardWay === 3"> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="客服微信"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="wechatImgSuccess"> |
| | | <img v-if="item.content.wechatImg" :src="item.content.wechatImg" style="max-width: 200px;"> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="item.content.awardWay !== 2"> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="兑奖期限"> |
| | | <div class="block"> |
| | | <el-date-picker |
| | | v-model="item.content.prizeTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <div v-show="item.content.awardType === 2"> |
| | | <el-row > |
| | | <el-col> |
| | | <el-form-item label="积分数量"> |
| | | <el-input v-model="item.content.scoreCnt" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="item.content.awardType === 3"> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="优惠券名称"> |
| | | <el-input v-model="item.content.couponName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="优惠券"> |
| | | <el-input v-model="item.content.couponId"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-button type="primary"> |
| | | 选择优惠券 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div v-show="item.content.awardType === 4"> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="品项名称"> |
| | | <el-input v-model="item.content.goodsName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="品项"> |
| | | <el-input v-model="item.content.goodsId"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-button type="primary"> |
| | | 选择品项 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-button type="primary" @click="addTab(editableTabsValue)"> |
| | | 新增奖品 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="背景图片上传" name="third"> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="标题"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="imageUrlTitleSuccess"> |
| | | <img v-if="imageUrlTitle" :src="imageUrlTitle" style="max-width: 300px;"> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="头部"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="imageUrlHeadSuccess"> |
| | | <img v-if="imageUrlHead" :src="imageUrlHead" style="max-width: 300px;"> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="日历签到背景"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="imageUrlStateSuccess"> |
| | | <img v-if="imageUrlState" :src="imageUrlState" style="max-width: 300px;"> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="col-sm-8 col-sm-offset-1" style="padding: 10px"> |
| | | <el-form-item label="签到按钮"> |
| | | <el-upload |
| | | action="/admin/multipleUploadFile/doUpload" |
| | | :show-file-list="false" |
| | | :on-success="imageUrlButtonSuccess"> |
| | | <img v-if="imageUrlButton" :src="imageUrlButton" style="max-width: 300px;"> |
| | | <i v-else></i> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </div> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="规则说明" name="fourth"> |
| | | <div class="col-sm-8 col-sm-offset-1"> |
| | | <el-form-item label="规则内容" prop="ruleExplain" style="padding: 10px"> |
| | | <el-input type="textarea" v-model="ruleForm.ruleExplain"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="背景颜色" style="padding: 10px"> |
| | | <el-color-picker v-model="backgroundColor"></el-color-picker> |
| | | </el-form-item> |
| | | <el-form-item label="字体颜色" style="padding: 10px"> |
| | | <el-color-picker v-model="typographyColor"></el-color-picker> |
| | | </el-form-item> |
| | | <el-form-item label="字体大小" style="padding: 10px"> |
| | | <el-input-number v-model="typographyNum" :min="10" :max="20" label="描述文字"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="字体透明度" style="padding: 10px"> |
| | | <el-input-number v-model="typographyLight" :min="1" :max="100" label="描述文字">%</el-input-number> |
| | | </el-form-item> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | |
| | | <div class="form-group "> |
| | | <div class="col-sm-12 text-center"> |
| | | <el-button type="primary" @click="updateSignAwardSet('ruleForm')">保存</el-button> |
| | | <el-button type="danger" @click="cancelSubmit">关闭</el-button> |
| | | </div> |
| | | </div> |
| | | </el-main> |
| | | |
| | | </el-container> |
| | | |
| | | </el-form> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> |
| | | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script> |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | |
| | | <script> |
| | | //获取传输的活动对象 |
| | | var actId = $.query.get("actId"); |
| | | const prize = { |
| | | //奖品基本信息 |
| | | id:'', |
| | | cumulativeDay:'', |
| | | awardType:1, |
| | | awardName:'', |
| | | introduceImg:'', |
| | | introduceTip:'', |
| | | awardInventoryCnt:'', |
| | | awardDistributeCnt:'', |
| | | awardWay:1, |
| | | operationTip:'', |
| | | prizeAddress:'', |
| | | prizeTime: '', |
| | | wechatImg:'', |
| | | scoreCnt:'', |
| | | couponId:'', |
| | | goodsId:'', |
| | | couponName:'', |
| | | goodsName:'', |
| | | } |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | activeName: 'first', |
| | | formLabelWidth: '120px', |
| | | //标题图片 |
| | | imageUrlTitle: '', |
| | | imageUrlHead: '', |
| | | imageUrlButton: '', |
| | | imageUrlState: '', |
| | | |
| | | //字体颜色 |
| | | typographyColor: '#409EFF', |
| | | //背景颜色 |
| | | backgroundColor: '#409EFF', |
| | | //字体大小 |
| | | typographyNum: '5', |
| | | //字体透明度 |
| | | typographyLight: '50', |
| | | //奖品设置 |
| | | prize:JSON.parse(JSON.stringify(prize)), |
| | | editableTabsValue: '1', |
| | | editableTabs: [{ |
| | | title: '签到日常奖励', |
| | | name: '1', |
| | | content: JSON.parse(JSON.stringify(prize)) |
| | | }], |
| | | tabIndex: 1, |
| | | |
| | | ruleForm : { |
| | | //商品基本信息 |
| | | actName : '', |
| | | actCode : '', |
| | | actTime : '', |
| | | //规则说明 |
| | | ruleExplain : '', |
| | | }, |
| | | rules : { |
| | | //商品基本信息 |
| | | actName : [ |
| | | { required: true, message: '请输入活动名称', trigger: 'blur' } |
| | | ], |
| | | actCode : [ |
| | | { required: true, message: '请输入活动编码', trigger: 'blur' } |
| | | ], |
| | | actTime : [ |
| | | { required: true, message: '请选择日期', trigger: 'change' } |
| | | ], |
| | | ruleExplain : [ |
| | | { required: true, message: '请输入规则内容', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | }, |
| | | created: function () { |
| | | this.loadInfo(); |
| | | }, |
| | | methods: { |
| | | //加载活动详情 |
| | | loadInfo() { |
| | | let _this = this; |
| | | _this.loadSign(); |
| | | }, |
| | | loadSign() { |
| | | let _this = this; |
| | | let data={ |
| | | actId:actId, |
| | | }; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/activitySignAwardSet/findSignForUpdate', |
| | | callback: function (data) { |
| | | _this.ruleForm.actName = data.mapInfo.addSignAwardSetVo.actName; |
| | | _this.ruleForm.actCode = data.mapInfo.addSignAwardSetVo.actCode; |
| | | let arrayObj = new Array(); |
| | | arrayObj.push(new Date(data.mapInfo.addSignAwardSetVo.beginTime)); |
| | | arrayObj.push(new Date(data.mapInfo.addSignAwardSetVo.endTime)); |
| | | _this.ruleForm.actTime = arrayObj; |
| | | //字体颜色 |
| | | _this.ruleForm.ruleExplain = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.ruleExplain; |
| | | _this.typographyColor = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyColor; |
| | | _this.backgroundColor = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.backgroundColor; |
| | | _this.typographyNum = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyNum; |
| | | _this.typographyLight = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.typographyLight; |
| | | _this.imageUrlTitle = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlTitle; |
| | | _this.imageUrlHead = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlHead; |
| | | _this.imageUrlButton = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlButton; |
| | | _this.imageUrlState = data.mapInfo.addSignAwardSetVo.signSetBasicJsonDto.imageUrlState; |
| | | |
| | | for (let i = 0; i < data.mapInfo.addSignAwardSetVo.activitySignAwardSets.length; i++) { |
| | | _this.tabIndex = data.mapInfo.addSignAwardSetVo.activitySignAwardSets.length; |
| | | let prizeVo = data.mapInfo.addSignAwardSetVo.activitySignAwardSets[i]; |
| | | let arrayObjs = new Array(); |
| | | arrayObjs.push(new Date(prizeVo.prizeStartTime)); |
| | | arrayObjs.push(new Date(prizeVo.prizeEndTime)); |
| | | let content = JSON.parse(JSON.stringify(prize)); |
| | | content = { |
| | | id: prizeVo.id, |
| | | cumulativeDay: prizeVo.cumulativeDay, |
| | | awardType: parseInt(prizeVo.awardType), |
| | | awardName: prizeVo.awardName, |
| | | introduceImg: prizeVo.introduceImg, |
| | | introduceTip: prizeVo.introduceTip, |
| | | awardInventoryCnt: prizeVo.awardInventoryCnt, |
| | | awardDistributeCnt: prizeVo.awardDistributeCnt, |
| | | awardWay: parseInt(prizeVo.awardWay), |
| | | operationTip: prizeVo.operationTip, |
| | | prizeAddress: prizeVo.prizeAddress, |
| | | wechatImg: prizeVo.wechatImg, |
| | | scoreCnt: prizeVo.scoreCnt, |
| | | couponId: prizeVo.couponId, |
| | | goodsId: prizeVo.goodsId, |
| | | couponName: prizeVo.couponName, |
| | | goodsName: prizeVo.goodsName, |
| | | prizeTime: arrayObjs, |
| | | } |
| | | if(i === 0){ |
| | | _this.editableTabs[0].content = content; |
| | | }else{ |
| | | let newTabName = i+1 +''; |
| | | _this.editableTabs.push({ |
| | | title: "商品奖励"+"("+newTabName+")", |
| | | name: newTabName, |
| | | content: content, |
| | | }); |
| | | this.editableTabsValue = newTabName; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | //保存 |
| | | updateSignAwardSet : function(formName) { |
| | | const _this = this; |
| | | let flag = false; |
| | | _this.$refs[formName].validate((valid) => { |
| | | if (!valid) { |
| | | _this.$notify({ |
| | | title: '提示', |
| | | message: '请完善签到活动信息', |
| | | type: 'warning' |
| | | }); |
| | | flag = true; |
| | | return; |
| | | } |
| | | }); |
| | | if (flag) { |
| | | return; |
| | | } |
| | | //活动基本信息 |
| | | let signSetBasicJsonDto = { |
| | | ruleExplain: _this.ruleForm.ruleExplain, |
| | | //字体颜色 |
| | | typographyColor: _this.typographyColor, |
| | | //背景颜色 |
| | | backgroundColor: _this.backgroundColor, |
| | | //字体大小 |
| | | typographyNum: _this.typographyNum, |
| | | //字体透明度 |
| | | typographyLight: _this.typographyNum, |
| | | //标题图片 |
| | | imageUrlTitle: _this.imageUrlTitle, |
| | | imageUrlHead: _this.imageUrlHead, |
| | | imageUrlButton: _this.imageUrlButton, |
| | | imageUrlState: _this.imageUrlState, |
| | | } |
| | | //奖品信息 |
| | | let activitySignAwardSets = []; |
| | | for (let i = 0; i < _this.editableTabs.length; i++) { |
| | | let prize = _this.editableTabs[i].content; |
| | | let activitySignAwardSet = { |
| | | id: prize.id, |
| | | cumulativeDay: prize.cumulativeDay, |
| | | awardType: prize.awardType, |
| | | awardName: prize.awardName, |
| | | introduceImg: prize.introduceImg, |
| | | introduceTip: prize.introduceTip, |
| | | awardInventoryCnt: prize.awardInventoryCnt, |
| | | awardDistributeCnt: prize.awardDistributeCnt, |
| | | awardWay: prize.awardWay, |
| | | operationTip: prize.operationTip, |
| | | prizeAddress: prize.prizeAddress, |
| | | wechatImg: prize.wechatImg, |
| | | scoreCnt: prize.scoreCnt, |
| | | couponId: prize.couponId, |
| | | goodsId: prize.goodsId, |
| | | couponName: prize.couponName, |
| | | goodsName: prize.goodsName, |
| | | prizeStartTime: prize.prizeTime[0], |
| | | prizeEndTime: prize.prizeTime[1], |
| | | } |
| | | activitySignAwardSets.push(activitySignAwardSet); |
| | | } |
| | | let resultData = { |
| | | actMainId: actId, |
| | | actName: _this.ruleForm.actName, |
| | | actCode: _this.ruleForm.actCode, |
| | | beginTime : _this.ruleForm.actTime[0], |
| | | endTime : _this.ruleForm.actTime[1], |
| | | signSetBasicJsonDto, |
| | | activitySignAwardSets, |
| | | } |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data: resultData, |
| | | url: basePath + '/admin/activitySignAwardSet/updateSignAwardSet', |
| | | callback: function (data) { |
| | | _this.$message({ |
| | | message: data.info, |
| | | type: 'success', |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | //奖品设置 |
| | | addTab(targetName) { |
| | | let newTabName = ++this.tabIndex + ''; |
| | | this.editableTabs.push({ |
| | | title: "商品奖励"+"("+newTabName+")", |
| | | name: newTabName, |
| | | content: JSON.parse(JSON.stringify(prize)), |
| | | }); |
| | | this.editableTabsValue = newTabName; |
| | | }, |
| | | removeTab(targetName) { |
| | | let tabs = this.editableTabs; |
| | | let activeName = this.editableTabsValue; |
| | | if(activeName === '1' || targetName === '1'){ |
| | | this.$notify({ |
| | | title: '提示', |
| | | message: '【签到日常奖励】不能删除', |
| | | type: 'warning' |
| | | }); |
| | | }else{ |
| | | if (activeName === targetName) { |
| | | tabs.forEach((tab, index) => { |
| | | if (tab.name === targetName && tab.title !== "签到日常奖励") { |
| | | let nextTab = tabs[index + 1] || tabs[index - 1]; |
| | | if (nextTab) { |
| | | activeName = nextTab.name; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | this.editableTabsValue = activeName; |
| | | this.editableTabs = tabs.filter(tab => tab.name !== targetName); |
| | | this.tabIndex = this.editableTabs.length; |
| | | } |
| | | }, |
| | | //切换奖项类型,显示不同内容 |
| | | jxlxChange(val){ |
| | | let _this = this; |
| | | _this.isShow=val; |
| | | }, |
| | | //切换兑奖方式,显示不同内容 |
| | | awardWayChange(val){ |
| | | let _this = this; |
| | | _this.isShow=val; |
| | | }, |
| | | //跳转到图片上传 |
| | | uploadImg(){ |
| | | this.activeName = 'third'; |
| | | }, |
| | | //跳转到规则说明 |
| | | gzsmSet(){ |
| | | this.activeName = 'fourth'; |
| | | }, |
| | | //标题图片 |
| | | imageUrlTitleSuccess(res, file) { |
| | | this.imageUrlTitle = res.path; |
| | | }, |
| | | imageUrlHeadSuccess(res, file) { |
| | | this.imageUrlHead = res.path; |
| | | }, |
| | | imageUrlButtonSuccess(res, file) { |
| | | this.imageUrlButton = res.path; |
| | | }, |
| | | imageUrlStateSuccess(res, file) { |
| | | this.imageUrlState = res.path; |
| | | }, |
| | | //奖品设置的图片介绍 |
| | | introduceImgSuccess(res, file) { |
| | | this.editableTabs[this.tabIndex-1].content.introduceImg = res.path; |
| | | }, |
| | | //奖品设置的客服微信 |
| | | wechatImgSuccess(res, file) { |
| | | this.editableTabs[this.tabIndex-1].content.wechatImg = res.path; |
| | | }, |
| | | cancelSubmit() { |
| | | this.closeFrame(); |
| | | }, |
| | | closeFrame() { |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script> |
| | | <style> |
| | | |
| | | .paginationStyle{ |
| | | background: #ffffff; |
| | | padding: 10px 10px; |
| | | margin: 0px 0px 10px 0px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .el-aside { |
| | | background-color: #D3DCE6; |
| | | color: #333; |
| | |
| | | <div v-show="item.content.awardType === '3'"> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="优惠券名称"> |
| | | <el-input v-model="item.content.couponName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="优惠券"> |
| | | <el-input v-model="item.content.couponId"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-button type="primary"> |
| | | <el-button type="primary" @click="chooseCoupon(item.content.couponName)"> |
| | | 选择优惠券 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-drawer |
| | | title="选择商城优惠券" |
| | | :visible.sync="drawerCoupon" |
| | | :direction="directionCoupon" |
| | | size="90%"> |
| | | <el-row style="margin-left: 50px;"> |
| | | <el-col :span="24"> |
| | | <el-row> |
| | | <el-form ref="formCoupon" :model="formCoupon" inline > |
| | | <el-form-item prop="yhjmc"> |
| | | <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="searchFormCoupon" >搜索</el-button> |
| | | <el-button @click="resetFormCoupon('formCoupon')">重置</el-button> |
| | | </el-form> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | <el-table ref="multipleTable" |
| | | :data="couponList.rows" |
| | | :height="tableHeightCoupon" |
| | | stripe:true |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="cname" |
| | | label="优惠券名称" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="endTime" |
| | | label="截止日期" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="mini" |
| | | @click="chooseOneCoupon(scope.row)">选择 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSizeCoupon" |
| | | @current-change="changeCurrentPageCoupon" |
| | | :current-page="couponList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="couponList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="couponList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | </el-drawer> |
| | | </div> |
| | | <div v-show="item.content.awardType === '4'"> |
| | | <el-row style="display:flex;"> |
| | | <el-col> |
| | | <el-form-item label="品项名称"> |
| | | <el-input v-model="item.content.goodsName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-form-item label="品项"> |
| | | <el-input v-model="item.content.goodsId"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col> |
| | | <el-button type="primary"> |
| | | <el-button type="primary" @click="chooseGoods(item.content.goodsName)"> |
| | | 选择品项 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-drawer |
| | | title="选择ERP产品" |
| | | :visible.sync="drawerGoods" |
| | | :direction="directionGoods" |
| | | size="90%"> |
| | | <el-row style="margin-left: 50px;"> |
| | | <el-col :span="24"> |
| | | <el-row> |
| | | <el-form ref="formGoods" :model="formGoods" inline > |
| | | <el-form-item prop="cpmc"> |
| | | <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input> |
| | | </el-form-item> |
| | | <el-button type="primary" @click="searchFormGoods" >搜索</el-button> |
| | | <el-button @click="resetFormGoods('formGoods')">重置</el-button> |
| | | </el-form> |
| | | </el-row> |
| | | |
| | | <el-row class="table-style" > |
| | | <el-table ref="multipleTable" |
| | | :data="goodsList.rows" |
| | | :height="tableHeightGoods" |
| | | stripe:true |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="cname" |
| | | label="优惠券名称" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="endTime" |
| | | label="截止日期" |
| | | show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="address" |
| | | label="操作"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="mini" |
| | | @click="chooseOneGoods(scope.row)">选择 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row class="paginationStyle" > |
| | | <el-pagination background |
| | | @size-change="changePageSizeGoods" |
| | | @current-change="changeCurrentPageGoods" |
| | | :current-page="goodsList.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="goodsList.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="goodsList.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | </el-drawer> |
| | | |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | |
| | | <div class="form-group "> |
| | | <div class="col-sm-12 text-center"> |
| | | <el-button type="primary" @click="dataSubmit('ruleForm')">保存</el-button> |
| | | <el-button type="danger" >关闭</el-button> |
| | | <el-button type="danger" @click="cancelSubmit">关闭</el-button> |
| | | </div> |
| | | </div> |
| | | </el-main> |
| | |
| | | <script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script> |
| | | |
| | | <script> |
| | | //获取传输的活动对象 |
| | | var actId = $.query.get("actId"); |
| | | const prize = { |
| | | //奖品基本信息 |
| | | cumulativeDay:'', |
| | |
| | | awardInventoryCnt:'', |
| | | awardDistributeCnt:'', |
| | | awardWay:'1', |
| | | awardWayoperationTip:'', |
| | | operationTip:'', |
| | | prizeAddress:'', |
| | | prizeTime: '', |
| | | wechatImg:'', |
| | | scoreCnt:'', |
| | | couponId:'', |
| | | goodsId:'', |
| | | couponName:'', |
| | | goodsName:'', |
| | | } |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | activeName: 'first', |
| | | formLabelWidth: '120px', |
| | | //优惠券搜索弹出 |
| | | drawerCoupon: false, |
| | | directionCoupon: 'rtl', |
| | | tableHeightCoupon: 500, |
| | | //--优惠券 |
| | | formCoupon:{ |
| | | yhjmc:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | couponList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | |
| | | //品项搜索弹出 |
| | | drawerGoods: false, |
| | | directionGoods: 'rtl', |
| | | tableHeightGoods: 500, |
| | | //--品项 |
| | | formGoods:{ |
| | | cpmc:'', |
| | | order:'', |
| | | sort:'' |
| | | }, |
| | | goodsList:{ |
| | | rows:[], |
| | | total:0, |
| | | pageSize:10, |
| | | currentPage:1, |
| | | }, |
| | | |
| | | //标题图片 |
| | | imageUrlTitle: '', |
| | | imageUrlHead: '', |
| | |
| | | created: function () { |
| | | }, |
| | | methods: { |
| | | //选择优惠券 |
| | | chooseCoupon(val){ |
| | | let _this = this; |
| | | _this.drawerCoupon = true; |
| | | _this.formCoupon.yhjmc = val; |
| | | _this.loadCouponList(); |
| | | }, |
| | | //--优惠券 |
| | | loadCouponList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParamCoupon(); |
| | | data.pageSize=_this.couponList.pageSize; |
| | | data.pageNum=_this.couponList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/activitySignAwardSet/selectCouponList', |
| | | callback: function (data) { |
| | | _this.couponList.rows = data.rows; |
| | | _this.couponList.total = data.total; |
| | | } |
| | | }); |
| | | }, |
| | | //查询参数 |
| | | getRequestParamCoupon(){ |
| | | let _this = this; |
| | | return { |
| | | yhjmc:_this.formCoupon.yhjmc, |
| | | order:_this.formCoupon.order, |
| | | sort:_this.formCoupon.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | searchFormCoupon:function(){ |
| | | this.couponList.currentPage=1; |
| | | this.loadCouponList(); |
| | | }, |
| | | //重置 |
| | | resetFormCoupon(formName) { |
| | | // this.formCoupon.yhjmc = '' |
| | | // console.log(this.$refs[formName].resetFields) |
| | | (this.$refs[formName])[0].resetFields(); |
| | | }, |
| | | changePageSizeCoupon(val) { |
| | | this.couponList.pageSize = val; |
| | | this.loadCouponList(); |
| | | }, |
| | | changeCurrentPageCoupon(val) { |
| | | this.couponList.currentPage = val; |
| | | this.loadCouponList(); |
| | | }, |
| | | //选择 |
| | | chooseOneCoupon(row) { |
| | | let _this = this; |
| | | _this.editableTabs[_this.tabIndex-1].content.couponId = row.id; |
| | | _this.editableTabs[_this.tabIndex-1].content.couponName = row.cname; |
| | | _this.drawerCoupon = false; |
| | | }, |
| | | |
| | | //选择品项 |
| | | chooseGoods(val){ |
| | | let _this = this; |
| | | _this.drawerGoods = true; |
| | | _this.formGoods.cpmc = val; |
| | | _this.loadGoodsList(); |
| | | }, |
| | | //--品项 |
| | | loadGoodsList() { |
| | | let _this = this; |
| | | let data=_this.getRequestParamGoods(); |
| | | data.pageSize=_this.goodsList.pageSize; |
| | | data.pageNum=_this.goodsList.currentPage; |
| | | AjaxProxy.requst({ |
| | | app: _this, |
| | | data:data, |
| | | url: basePath + '/admin/activitySignAwardSet/selectGoodsList', |
| | | callback: function (data) { |
| | | _this.goodsList.rows = data.rows; |
| | | _this.goodsList.total = data.total; |
| | | } |
| | | }); |
| | | }, |
| | | //查询参数 |
| | | getRequestParamGoods(){ |
| | | let _this = this; |
| | | return { |
| | | cpmc:_this.formCoupon.cpmc, |
| | | order:_this.formCoupon.order, |
| | | sort:_this.formCoupon.sort, |
| | | } |
| | | }, |
| | | //查询 |
| | | searchFormGoods:function(){ |
| | | this.goodsList.currentPage=1; |
| | | this.loadGoodsList(); |
| | | }, |
| | | //重置 |
| | | resetFormGoods(formName) { |
| | | (this.$refs[formName])[0].resetFields(); |
| | | }, |
| | | changePageSizeGoods(val) { |
| | | this.goodsList.pageSize = val; |
| | | this.loadGoodsList(); |
| | | }, |
| | | changeCurrentPageGoods(val) { |
| | | this.goodsList.currentPage = val; |
| | | this.loadGoodsList(); |
| | | }, |
| | | //选择 |
| | | chooseOneGoods(row) { |
| | | let _this = this; |
| | | _this.editableTabs[_this.tabIndex-1].content.goodsId = row.id; |
| | | _this.editableTabs[_this.tabIndex-1].content.goodsName = row.name; |
| | | _this.drawerCoupon = false; |
| | | }, |
| | | |
| | | //保存 |
| | | dataSubmit : function(formName) { |
| | | const _this = this; |
| | | let flag = false; |
| | |
| | | awardInventoryCnt: prize.awardInventoryCnt, |
| | | awardDistributeCnt: prize.awardDistributeCnt, |
| | | awardWay: prize.awardWay, |
| | | awardWayoperationTip: prize.awardWayoperationTip, |
| | | operationTip: prize.operationTip, |
| | | prizeAddress: prize.prizeAddress, |
| | | wechatImg: prize.wechatImg, |
| | | scoreCnt: prize.scoreCnt, |
| | | couponId: prize.couponId, |
| | | goodsId: prize.goodsId, |
| | | couponName: prize.couponName, |
| | | goodsName: prize.goodsName, |
| | | prizeStartTime: prize.prizeTime[0], |
| | | prizeEndTime: prize.prizeTime[1], |
| | | } |
| | |
| | | wechatImgSuccess(res, file) { |
| | | this.editableTabs[this.tabIndex-1].content.wechatImg = res.path; |
| | | }, |
| | | cancelSubmit() { |
| | | this.closeFrame(); |
| | | }, |
| | | closeFrame() { |
| | | parent.layer.close(parent.layer.getFrameIndex(window.name)); |
| | | }, |
| | | } |
| | | }) |
| | | </script> |