From 6cbed863ac8859f84f5f63a2e5db990acdd35ec6 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 27 Dec 2019 11:08:51 +0800 Subject: [PATCH] optimize image --- .../src/common/components/comment/CommentItem.js | 8 +++++--- public/react/src/common/components/comment/index.scss | 11 +++++++++-- public/react/src/common/quillForEditor/ImageBlot.js | 4 ++-- public/react/src/redux/actions/comment.js | 4 ++-- public/react/src/redux/actions/ojForUser.js | 4 ++-- public/react/src/services/ojService.js | 4 ++-- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/public/react/src/common/components/comment/CommentItem.js b/public/react/src/common/components/comment/CommentItem.js index 5cd39b8e0..c0a911dab 100644 --- a/public/react/src/common/components/comment/CommentItem.js +++ b/public/react/src/common/components/comment/CommentItem.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-17 17:35:17 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 20:00:56 + * @LastEditTime : 2019-12-27 11:05:17 */ import './index.scss'; import 'quill/dist/quill.core.css'; // 核心样式 @@ -88,7 +88,7 @@ function CommentItem ({ }; const handleShowUploadImage = (url) => { - console.log('==============>>>>>>>>>>>>',url); + // console.log('==============>>>>>>>>>>>>',url); setUrl(url); } // 评论内容 @@ -245,7 +245,9 @@ function CommentItem ({ {/* 显示上传的图片信息 */}
- +
+ +
diff --git a/public/react/src/common/components/comment/index.scss b/public/react/src/common/components/comment/index.scss index db327c82f..87ea08557 100644 --- a/public/react/src/common/components/comment/index.scss +++ b/public/react/src/common/components/comment/index.scss @@ -100,16 +100,23 @@ $ml: 20px; width:100%; content: ''; background: #000; - opacity: .5; + opacity: .7; } .image_info{ + display: flex; position: absolute; width: 80%; height: 80%; left: 10%; top: 10%; - background: green; + justify-content: center; + align-items: center; + // background: green; + .image{ + display: block; + width: 100%; + } } .image_close{ diff --git a/public/react/src/common/quillForEditor/ImageBlot.js b/public/react/src/common/quillForEditor/ImageBlot.js index 0316b1325..85f176aff 100644 --- a/public/react/src/common/quillForEditor/ImageBlot.js +++ b/public/react/src/common/quillForEditor/ImageBlot.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-16 15:50:45 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-27 08:57:37 + * @LastEditTime : 2019-12-27 11:04:43 */ import Quill from "quill"; @@ -17,7 +17,7 @@ export default class ImageBlot extends BlockEmbed { const node = super.create(); node.setAttribute('alt', value.alt); node.setAttribute('src', value.url); - console.log('~~~~~~~~~~~', node, value); + // console.log('~~~~~~~~~~~', node, value); node.addEventListener('click', function () { value.onclick(value.url); }, false); diff --git a/public/react/src/redux/actions/comment.js b/public/react/src/redux/actions/comment.js index f12001f99..d7b765ea8 100644 --- a/public/react/src/redux/actions/comment.js +++ b/public/react/src/redux/actions/comment.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-23 10:53:25 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-25 17:06:57 + * @LastEditTime : 2019-12-27 11:07:02 */ import types from "./actionTypes"; @@ -42,7 +42,7 @@ export const getCommentLists = (identifier) => { limit, page }).then(res => { - console.log('获取评论列表: ====>>>>', res); + // console.log('获取评论列表: ====>>>>', res); if (res.status === 200) { const {data} = res; dispatch({ diff --git a/public/react/src/redux/actions/ojForUser.js b/public/react/src/redux/actions/ojForUser.js index 5cd0cea3a..45594631f 100644 --- a/public/react/src/redux/actions/ojForUser.js +++ b/public/react/src/redux/actions/ojForUser.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 13:42:11 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-27 09:28:38 + * @LastEditTime : 2019-12-27 11:06:09 */ import types from "./actionTypes"; import { Base64 } from 'js-base64'; @@ -114,7 +114,7 @@ export const saveUserCodeForInterval = (identifier, code) => { type: types.AUTO_UPDATE_CODE, payload: true }); - console.log('+++', userCode); + // console.log('+++', userCode); fetchUpdateCode(identifier, { code: userCode }).then(res => { diff --git a/public/react/src/services/ojService.js b/public/react/src/services/ojService.js index a1a507b40..04fde2224 100644 --- a/public/react/src/services/ojService.js +++ b/public/react/src/services/ojService.js @@ -4,13 +4,13 @@ * @Github: * @Date: 2019-11-20 10:55:38 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 17:37:38 + * @LastEditTime : 2019-12-27 11:06:27 */ import axios from 'axios'; export async function fetchOJList (params) { - console.log('传递的参数: ', params); + // console.log('传递的参数: ', params); const obj = {}; Object.keys(params).forEach(key => { if (params[key]) {