From cad09668266ec4bfdd6e5bc453ed1cd3dc882ace Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 9 Jun 2023 11:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=95=86=E5=93=81=E8=8C=83=E5=9B=B4=E5=88=97=E8=A1=A8?= =?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/pages/exchangecode/commodity/commodity.js | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/pages/exchangecode/commodity/commodity.js b/src/pages/exchangecode/commodity/commodity.js index dac695ed..dd5d3352 100644 --- a/src/pages/exchangecode/commodity/commodity.js +++ b/src/pages/exchangecode/commodity/commodity.js @@ -137,45 +137,49 @@ export default class commodityList extends React.Component { /* type 1为商品 2为立减金 3为红包 转译字符方便处理 */ if (item.type === 1) { item.upstream = '直连天下'; - item.product_id = item.goods_id; + item.product_id = item.entity.goods_id; resData.push(item); } else if (item.type === 2) { resData.push({ - product_id: item.goods_id, + product_id: item.entity.goods_id, product_type_text: '立减金', - upstream: String(item.channel) === '1' ? '支付宝' : '微信', + upstream: + String(item.entity.channel) === '1' ? '支付宝' : '微信', code_batch_id: item.code_batch_id, - contract_price: item.price, - create_time: item.create_time, - official_price: item.reduce_amount, - channel_activity_id: item.channel_activity_id, - product_name: item.batch_goods_name, + contract_price: item.entity.price, + create_time: item.entity.create_time, + official_price: item.entity.reduce_amount, + channel_activity_id: item.entity.channel_activity_id, + product_name: item.entity.batch_goods_name, quantity: item.stock, weight: item.weight, effectDate: - item.time_limit.effect_time.start_time + + item.entity.time_limit.effect_time.start_time + ' 至 ' + - item.time_limit.effect_time.end_time //有效时间 + item.entity.time_limit.effect_time.end_time //有效时间 }); } else { const price = - item.cash_amount_type === '1' - ? item.denomination - : item.total_contract_price / item.num; + item.entity.cash_amount_type === '1' + ? item.entity.denomination + : item.entity.total_contract_price / item.entity.num; resData.push({ - product_id: item.goods_id, + product_id: item.entity.goods_id, product_type_text: - item.cash_amount_type === '2' ? '随机红包' : '固额红包', - upstream: item.channel === 1 ? '支付宝' : '微信', + item.entity.cash_amount_type === '2' + ? '随机红包' + : '固额红包', + upstream: item.entity.channel === 1 ? '支付宝' : '微信', code_batch_id: item.code_batch_id, contract_price: price, - create_time: item.create_time, + create_time: item.entity.create_time, official_price: price, - channel_activity_id: item.cash_activity_id, - product_name: item.batch_goods_name, + channel_activity_id: item.entity.cash_activity_id, + product_name: item.entity.batch_goods_name, quantity: item.stock, weight: item.weight, - effectDate: item.begin_time + ' 至 ' + item.end_time //有效时间 + effectDate: + item.entity.begin_time + ' 至 ' + item.entity.end_time //有效时间 }); } });