|
@@ -206,6 +206,7 @@
|
|
item.houseJson = JSON.stringify(spaceList);
|
|
item.houseJson = JSON.stringify(spaceList);
|
|
console.log("户型详情列表: ", spaceList);
|
|
console.log("户型详情列表: ", spaceList);
|
|
}
|
|
}
|
|
|
|
+ item.mateStr = item.houseType + ' ' + item.houseArea + "㎡ " + item.note;
|
|
})
|
|
})
|
|
this.houseList = res.pageModel.resultSet || [];
|
|
this.houseList = res.pageModel.resultSet || [];
|
|
}
|
|
}
|
|
@@ -302,23 +303,23 @@
|
|
}else{
|
|
}else{
|
|
houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
|
|
houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (!houseIndex) {
|
|
|
|
- //全匹配轮一遍
|
|
|
|
- // let curSpace = this.houseList.find(space => {
|
|
|
|
- // return text.includes(space.namePY)
|
|
|
|
- // })
|
|
|
|
|
|
+ //全匹配轮一遍
|
|
|
|
+ houseIndex = this.houseList.findIndex(space => {
|
|
|
|
+ return space.mateStr.includes(text);
|
|
|
|
+ })
|
|
|
|
+ if (houseIndex==null || houseIndex < 0) {
|
|
let list = this.houseList.map((space, index) => {
|
|
let list = this.houseList.map((space, index) => {
|
|
- let comStr = this.findSubStr(text, space.houseType + ' ' + space.houseArea + "㎡ " + space.note);
|
|
|
|
|
|
+ let comStr = this.findSubStr(text, space.mateStr);
|
|
return {
|
|
return {
|
|
spaceId: space.spaceId,
|
|
spaceId: space.spaceId,
|
|
namePY: space.namePY,
|
|
namePY: space.namePY,
|
|
name: space.name,
|
|
name: space.name,
|
|
- str:space.houseType + ' ' + space.houseArea + "㎡ " + space.note,
|
|
|
|
|
|
+ str:space.mateStr,
|
|
comStr,
|
|
comStr,
|
|
index,
|
|
index,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ console.warn("***list***",list)
|
|
//寻找5个字符串以上的
|
|
//寻找5个字符串以上的
|
|
let tmpList = list.filter(it => {
|
|
let tmpList = list.filter(it => {
|
|
return it.comStr.length > 2;
|
|
return it.comStr.length > 2;
|
|
@@ -330,7 +331,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//没有找到语音操作对象
|
|
//没有找到语音操作对象
|
|
- if (houseIndex==null || houseIndex<0) {
|
|
|
|
|
|
+ if (houseIndex==null || houseIndex < 0) {
|
|
Toast({
|
|
Toast({
|
|
message: '请再说一次',
|
|
message: '请再说一次',
|
|
});
|
|
});
|
|
@@ -344,8 +345,6 @@
|
|
}
|
|
}
|
|
this.changeHouse(houseIndex);
|
|
this.changeHouse(houseIndex);
|
|
console.log("textChange:", houseIndex);
|
|
console.log("textChange:", houseIndex);
|
|
-
|
|
|
|
-
|
|
|
|
// this.$emit("curSpaceChange", data); //通知父组件-当前已经选中了户型大类
|
|
// this.$emit("curSpaceChange", data); //通知父组件-当前已经选中了户型大类
|
|
},
|
|
},
|
|
//用户语音为空
|
|
//用户语音为空
|