Commit 4f013fac authored by 周宏民's avatar 周宏民

fix: 项目案例 地址取所属省份

parent eeebb60b
Pipeline #85476 waiting for manual action with stages
...@@ -88,21 +88,12 @@ const BottomItem = props => { ...@@ -88,21 +88,12 @@ const BottomItem = props => {
useEffect(() => { useEffect(() => {
const arr = []; const arr = [];
listData.forEach(i => { listData.forEach(i => {
let str = i['所属城市']; let str = i['所属省份'];
if (i['所属城市']) { if (i['所属省份']) {
const temp = i['所属城市'].split('/'); if (str[str.length - 1] === '省') {
// eslint-disable-next-line prefer-destructuring
str = temp[1];
if (str[str.length - 1] === '市') {
str = str.slice(0, str.length - 1); str = str.slice(0, str.length - 1);
} else {
// eslint-disable-next-line prefer-destructuring
str = temp[0];
} }
} }
if (str[str.length - 1] === '市') {
str = str.slice(0, str.length - 1);
}
i['城市'] = str; i['城市'] = str;
arr.push(i); arr.push(i);
}); });
......
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