Commit 51112fdd authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复询价商品阶梯价格为空{}报错的问题

parent 21cef20b
...@@ -97,7 +97,7 @@ const ApplicableGoods: React.FC<IProps> = (props) => { ...@@ -97,7 +97,7 @@ const ApplicableGoods: React.FC<IProps> = (props) => {
render: (text) => { render: (text) => {
const unitPrice = normalizeUnitPrice(text); const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price; const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price; const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`; return start !== end ? ${start}~${end}` : ${start}`;
}, },
}, },
......
...@@ -71,7 +71,7 @@ const ApplicableGoodsFormItem = (props) => { ...@@ -71,7 +71,7 @@ const ApplicableGoodsFormItem = (props) => {
render: (text) => { render: (text) => {
const unitPrice = normalizeUnitPrice(text); const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price; const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price; const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`; return start !== end ? ${start}~${end}` : ${start}`;
}, },
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-06-24 16:11:55 * @Date: 2021-06-24 16:11:55
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-08 19:29:00 * @LastEditTime: 2021-09-24 14:05:33
* @Description: 商品选择抽屉 * @Description: 商品选择抽屉
*/ */
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
...@@ -181,7 +181,7 @@ const GoodsDrawer: React.FC<IProps> = (props) => { ...@@ -181,7 +181,7 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
render: (text) => { render: (text) => {
const unitPrice = normalizeUnitPrice(text); const unitPrice = normalizeUnitPrice(text);
const start = unitPrice[0]?.price; const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price; const end = unitPrice[unitPrice.length - 1]?.price;
return start !== end ? ${start}~${end}` : ${start}`; return start !== end ? ${start}~${end}` : ${start}`;
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment