1 files deleted
8 files modified
3 files added
| | |
| | | //微信订阅模板ID, |
| | | // 微信订单通知 |
| | | // WX_TEMPLATE_ID_ONE("WX_TEMPLATE", "WX_TEMPLATE_ID_ONE"), |
| | | // 首页视屏链接 |
| | | VIDEO_URL_INDEX("VIDEO_URL_INDEX", "VIDEO_URL_INDEX"), |
| | | // 充值金额 |
| | | CHARGE_AMOUNT("CHARGE_SET", "CHARGE_AMOUNT"), |
| | | // 赠送金额 |
| | |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminAgentAmountDto; |
| | | import cc.mrbird.febs.mall.dto.AdminAgentDetailDto; |
| | | import cc.mrbird.febs.mall.dto.AdminIndexVideoDto; |
| | | import cc.mrbird.febs.mall.dto.CashOutSettingDto; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/indexVideoSet") |
| | | public FebsResponse indexVideoSet(AdminIndexVideoDto adminIndexVideoDto) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getType(), |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getCode() |
| | | ); |
| | | if(ObjectUtil.isEmpty(dic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | dic.setValue(adminIndexVideoDto.getVideoUrl()); |
| | | dataDictionaryCustomMapper.updateById(dic); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // List<Integer> lines = Arrays.asList(new Integer[]{1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0}); |
| | | // //数字连续出现的计数 |
| | |
| | | public FebsResponse findPlatformBannerList() { |
| | | return newsService.findAllBanner(); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页视频", notes = "首页视频") |
| | | @GetMapping(value = "/indexVideo") |
| | | public FebsResponse indexVideo() { |
| | | return newsService.indexVideo(); |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.mall.dto.AdminAgentAmountDto; |
| | | import cc.mrbird.febs.mall.dto.AdminAgentDetailDto; |
| | | import cc.mrbird.febs.mall.dto.CashOutSettingDto; |
| | | import cc.mrbird.febs.mall.dto.ScoreSettingDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | } |
| | | return FebsUtil.view("modules/system/agentDetail"); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("indexVideo") |
| | | @RequiresPermissions("indexVideo:update") |
| | | public String indexVideoSet(Model model) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getType(), |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getCode()); |
| | | AdminIndexVideoDto adminIndexVideoDto = new AdminIndexVideoDto(); |
| | | if (ObjectUtil.isNotEmpty(dic)) { |
| | | adminIndexVideoDto.setVideoUrl(dic.getValue()); |
| | | } |
| | | model.addAttribute("indexVideoSet", adminIndexVideoDto); |
| | | return FebsUtil.view("modules/system/indexVideo"); |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AdminIndexVideoDto { |
| | | private String videoUrl; |
| | | } |
| | |
| | | List<NewsListVo> findTopNews(); |
| | | |
| | | FebsResponse findAllBanner(); |
| | | |
| | | FebsResponse indexVideo(); |
| | | } |
| | |
| | | MallNewsCategory findNewsCategoryById(Long id); |
| | | |
| | | List<MallNewsCategory> findAllCategory(); |
| | | |
| | | FebsResponse addVideoInfo(MallNewsInfoDto mallNewsInfoDto); |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.mall.dto.NewsListDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.entity.PlatformBanner; |
| | | import cc.mrbird.febs.mall.mapper.MallGoodsMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.PlatformBannerMapper; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallNewsService; |
| | | import cc.mrbird.febs.mall.vo.NewsListVo; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | private final MallNewsCategoryMapper mallNewsCategoryMapper; |
| | | private final PlatformBannerMapper platformBannerMapper; |
| | | private final MallGoodsMapper mallGoodsMapper; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Override |
| | | public List<MallNewsCategory> findNewsCategoryList() { |
| | |
| | | } |
| | | return new FebsResponse().success().data(paymentMethodList); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse indexVideo() { |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getType(), |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getCode() |
| | | ); |
| | | return new FebsResponse().success().data(dataDictionaryCustom.getValue()); |
| | | } |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.mall.dto.MallNewsInfoDto; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsInfoMapper; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | public class MallNewsInfoServiceImpl extends ServiceImpl<MallNewsInfoMapper, MallNewsInfo> implements IMallNewsInfoService { |
| | | |
| | | private final MallNewsCategoryMapper mallNewsCategoryMapper; |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Override |
| | | public IPage<AdminMallNewsInfoVo> getNewInfoList(MallNewsInfo mallNewsInfo, QueryRequest request) { |
| | | Page<AdminMallNewsInfoVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | public List<MallNewsCategory> findAllCategory() { |
| | | return mallNewsCategoryMapper.selectList(null); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse addVideoInfo(MallNewsInfoDto mallNewsInfoDto) { |
| | | DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getType(), |
| | | DataDictionaryEnum.VIDEO_URL_INDEX.getCode() |
| | | ); |
| | | if(StrUtil.isNotEmpty(mallNewsInfoDto.getVideoUrl())){ |
| | | dataDictionaryCustom.setValue(mallNewsInfoDto.getVideoUrl()); |
| | | dataDictionaryCustomMapper.updateById(dataDictionaryCustom); |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="index-video-setting" lay-title="首页视频设置"> |
| | | <div class="layui-row layui-col-space8 febs-container"> |
| | | <form class="layui-form" action="" lay-filter="index-video-setting-form"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label ">视频链接:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input id="videoUrl" type="text" name="videoUrl" lay-verify="" autocomplete="off" class="layui-input" >--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">视频:</label> |
| | | <div class="layui-input-block"> |
| | | <button type="button" class="layui-btn upload" id="upload" style="background-color: #009688; margin-bottom: 2px">上传文件</button> |
| | | <input type="text" name="videoUrl" autocomplete="off" value="" id="videoUrl" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-card-footer"> |
| | | <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="index-video-setting-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .layui-form-label { |
| | | width: 120px; |
| | | } |
| | | |
| | | .layui-form-item .layui-input-block { |
| | | margin-left: 150px; |
| | | } |
| | | |
| | | .layui-table-form .layui-form-item { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | </style> |
| | | <script data-th-inline="javascript" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'validate', 'febs', 'form', 'eleTree'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | validate = layui.validate, |
| | | $view = $('#index-video-setting'); |
| | | |
| | | form.verify(validate); |
| | | |
| | | // const client = new OSS({ |
| | | // // yourRegion填写Bucket所在地域。以华东1(杭州)为例,yourRegion填写为oss-cn-hangzhou。 |
| | | // region: "yourRegion", |
| | | // // 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。 |
| | | // accessKeyId: "yourAccessKeyId", |
| | | // accessKeySecret: "yourAccessKeySecret", |
| | | // // 从STS服务获取的安全令牌(SecurityToken)。 |
| | | // stsToken: "yourSecurityToken", |
| | | // // 填写Bucket名称。 |
| | | // bucket: "examplebucket", |
| | | // }); |
| | | |
| | | form.render(); |
| | | |
| | | |
| | | form.on('submit(index-video-setting-form-submit)', function (data) { |
| | | console.log(data); |
| | | febs.post(ctx + 'admin/news/addVideoInfo', data.field, function (res) { |
| | | if (res.code == 200) { |
| | | febs.alert.success(res.message); |
| | | } else { |
| | | febs.alert.warn(res.message); |
| | | } |
| | | }); |
| | | // window.location.reload(); |
| | | return false; |
| | | }); |
| | | |
| | | bindUpload(); |
| | | function bindUpload() { |
| | | upload.render({ |
| | | elem: '.upload' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,accept: 'file' |
| | | ,before: function(obj){ |
| | | layer.msg('上传中', {icon: 16, time: 0}); |
| | | } |
| | | ,done: function(res){ |
| | | var item = this.item; |
| | | //如果上传失败 |
| | | if(res.code !== 0){ |
| | | return layer.msg('上传失败'); |
| | | } |
| | | |
| | | // $(item).parent().prev().find('input').val(res.data[0]); |
| | | $("#videoUrl").val(res.data.src); |
| | | layer.msg('上传完毕', {icon: 1}); |
| | | } |
| | | ,error: function(err){ |
| | | return layer.msg('上传失败'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="index-video-set" lay-title="充值设置"> |
| | | <div class="layui-row layui-col-space8 febs-container"> |
| | | <form class="layui-form" action="" lay-filter="index-video-set-form"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">视频:</label> |
| | | <div class="layui-input-block"> |
| | | <button type="button" class="layui-btn upload" id="upload" style="background-color: #009688; margin-bottom: 2px">上传文件</button> |
| | | <input type="text" name="videoUrl" autocomplete="off" value="" id="videoUrl" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-card-footer"> |
| | | <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="index-video-set-form-submit" id="submit">保存</button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | <style> |
| | | .layui-form-label { |
| | | width: 120px; |
| | | } |
| | | |
| | | .layui-form-item .layui-input-block { |
| | | margin-left: 150px; |
| | | } |
| | | |
| | | .layui-table-form .layui-form-item { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | </style> |
| | | <script data-th-inline="javascript" type="text/javascript"> |
| | | layui.use(['dropdown', 'jquery', 'validate', 'febs', 'form', 'eleTree', 'upload'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | indexVideoSet = [[${indexVideoSet}]], |
| | | validate = layui.validate, |
| | | upload = layui.upload, |
| | | $view = $('#index-video-set'); |
| | | |
| | | form.verify(validate); |
| | | |
| | | initIndexVideoValue(); |
| | | |
| | | form.render(); |
| | | |
| | | function initIndexVideoValue() { |
| | | form.val("index-video-set-form", { |
| | | "videoUrl": indexVideoSet.videoUrl, |
| | | }); |
| | | } |
| | | |
| | | form.on('submit(index-video-set-form-submit)', function (data) { |
| | | console.log(data); |
| | | febs.post(ctx + 'admin/system/indexVideoSet', data.field, function (res) { |
| | | if (res.code == 200) { |
| | | febs.alert.success("操作成功"); |
| | | } else { |
| | | febs.alert.warn(res.message); |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | bindUpload(); |
| | | function bindUpload() { |
| | | upload.render({ |
| | | elem: '.upload' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,accept: 'file' |
| | | ,before: function(obj){ |
| | | layer.msg('上传中', {icon: 16, time: 0}); |
| | | } |
| | | ,done: function(res){ |
| | | var item = this.item; |
| | | //如果上传失败 |
| | | if(res.code !== 0){ |
| | | return layer.msg('上传失败'); |
| | | } |
| | | |
| | | // $(item).parent().prev().find('input').val(res.data[0]); |
| | | $("#videoUrl").val(res.data.src); |
| | | layer.msg('上传完毕', {icon: 1}); |
| | | } |
| | | ,error: function(err){ |
| | | return layer.msg('上传失败'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | </script> |