From 94e644443a660b39521f08805b66c27ced736e40 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 17 Aug 2022 11:30:33 +0800
Subject: [PATCH] fix:普通商品不再10天结算,改为及时结算并不能退货

---
 src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
index a8daf2a..34f6e88 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
@@ -11,6 +11,7 @@
 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;
@@ -54,7 +55,11 @@
 //        if(mallNewsInfoDto.getType() == 2){
 //            mallNewsInfo.setTargetId(mallNewsInfoDto.getGoodsId());
 //        }
-
+        String content = mallNewsInfoDto.getContent();
+        if(StrUtil.isNotBlank(content)){
+            //正文图片样式居中
+            mallNewsInfoDto.setContent(content+"<style>img{max-width:100%!important;}</style>");
+        }
         MallNewsInfo mallNewsInfo = new MallNewsInfo();
         BeanUtil.copyProperties(mallNewsInfoDto, mallNewsInfo);
         this.baseMapper.insert(mallNewsInfo);
@@ -94,6 +99,11 @@
 //        this.baseMapper.insert(mallNewsInfo);
 //        this.baseMapper.deleteById(mallNewsInfoDto.getId());
 
+        String content = mallNewsInfoDto.getContent();
+        if(StrUtil.isNotBlank(content)){
+            //正文图片样式居中
+            mallNewsInfoDto.setContent(content+"<style>img{max-width:100%!important;}</style>");
+        }
         MallNewsInfo mallNewsInfo = new MallNewsInfo();
         BeanUtil.copyProperties(mallNewsInfoDto, mallNewsInfo);
         this.baseMapper.updateById(mallNewsInfo);

--
Gitblit v1.9.1