From 5e80c71cd450e6111f4eb86a68b7bef2f2b1a65e Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Sat, 24 Feb 2024 19:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AA=20optimize:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/combining/index.jsx | 32 +++++++++++-------- src/pages/exchangecode/combiningAdd/index.jsx | 32 +++++++++++-------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/components/combining/index.jsx b/src/components/combining/index.jsx index 5b1ec960..ccad7f9c 100644 --- a/src/components/combining/index.jsx +++ b/src/components/combining/index.jsx @@ -196,20 +196,24 @@ const Combining = forwardRef((props, ref) => { receive_mode, instruction, timer_type: time_limit.receive_time.start_time ? 2 : 1, - group_cover: [ - { - id: new Date().getTime(), - src: group_cover, - name: "商品展示" - } - ], - group_image: [ - { - id: new Date().getTime(), - src: group_image, - name: "商品描述" - } - ], + group_cover: group_cover + ? [ + { + id: new Date().getTime(), + src: group_cover, + name: "商品展示" + } + ] + : [], + group_image: group_image + ? [ + { + id: new Date().getTime(), + src: group_image, + name: "商品描述" + } + ] + : [], timer: [time_limit.receive_time.start_time, time_limit.receive_time.end_time] }) sessionStorage.setItem("knockGoldData", JSON.stringify(propsData.product.reduce)) diff --git a/src/pages/exchangecode/combiningAdd/index.jsx b/src/pages/exchangecode/combiningAdd/index.jsx index 5bfe28e7..7722fa1a 100644 --- a/src/pages/exchangecode/combiningAdd/index.jsx +++ b/src/pages/exchangecode/combiningAdd/index.jsx @@ -144,20 +144,24 @@ export default class combiningAdd extends React.Component { restrict: reqCopy.restrict, instruction, date_time: [reqCopy.begin_time, reqCopy.end_time], - group_cover: [ - { - id: new Date().getTime(), - src: group_cover, - name: "商品展示" - } - ], - group_image: [ - { - id: new Date().getTime(), - src: group_image, - name: "商品描述" - } - ], + group_cover: group_cover + ? [ + { + id: new Date().getTime(), + src: group_cover, + name: "商品展示" + } + ] + : [], + group_image: group_image + ? [ + { + id: new Date().getTime(), + src: group_image, + name: "商品描述" + } + ] + : [], timer: time_limit.receive_time.start_time ? [time_limit.receive_time.start_time, time_limit.receive_time.end_time] : [],