|
@ -82,8 +82,15 @@ Page({ |
|
|
async getInfo(code){ |
|
|
async getInfo(code){ |
|
|
const res = await getHouseInfo({roomCode:code}) |
|
|
const res = await getHouseInfo({roomCode:code}) |
|
|
if(res.msg === 'success' && res.code === 0){ |
|
|
if(res.msg === 'success' && res.code === 0){ |
|
|
|
|
|
let str = res.data.gridName; |
|
|
|
|
|
let startStr = '社区'; |
|
|
|
|
|
let endStr = '格'; |
|
|
|
|
|
let startIndex = str.indexOf(startStr); // 获取 "社区" 的起始索引
|
|
|
|
|
|
let endIndex = str.indexOf(endStr) + endStr.length; // 获取 "格" 的结束索引
|
|
|
|
|
|
let result = str.slice(0, startIndex + startStr.length) + str.slice(endIndex); |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
'familyInfo':res.data, |
|
|
'familyInfo':res.data, |
|
|
|
|
|
'familyInfo.gridName':result, |
|
|
'roomCode':res.data.members |
|
|
'roomCode':res.data.members |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|