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] : [],