zjs_project 10 mesi fa
parent
commit
79e1c52ea9

+ 9 - 8
src/pages/webgl_rxdz_recognizer_houseList/webgl_rxdz_recognizer_houseList.vue

@@ -288,20 +288,21 @@
                 // text = pinyin;
                 //全匹配轮一遍
                 text = this.convertChineseToArabic(text);
-                let houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
-                if(!houseIndex){
-                    houseIndex = this.backwardNumber(text);//获取倒数的个数
+                let houseIndex = this.backwardNumber(text);//获取文字里面的数字 倒数第三个 类似这样的
+                if(houseIndex){
                     houseIndex = this.houseList.length - houseIndex;
                     if(houseIndex < 0){//越界了
                         Toast({
                             message: '数据不合法,请再说一次',
                         });
-                        return false; 
+                    }else{
+                        this.changeHouse(houseIndex);
                     }
-                }
-                // let curSpace = this.houseList.find(space => {
-                //     return text.includes(space.houseType)
-                // })
+                    return false;
+                }else{
+                    houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
+                }                
+
                 if (!houseIndex) {
                     let list = this.houseList.map((space, index) => {
                         let comStr = this.findSubStr(text, space.houseType + ' ' + space.houseArea + "㎡ " +