Showing
1 changed file
with
2 additions
and
13 deletions
| @@ -31,7 +31,6 @@ export struct SearchComponent { | @@ -31,7 +31,6 @@ export struct SearchComponent { | ||
| 31 | scroller: Scroller = new Scroller() | 31 | scroller: Scroller = new Scroller() |
| 32 | @State count:string[] = [] | 32 | @State count:string[] = [] |
| 33 | @State isGetRequest:boolean = false; | 33 | @State isGetRequest:boolean = false; |
| 34 | - @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 35 | 34 | ||
| 36 | aboutToAppear() { | 35 | aboutToAppear() { |
| 37 | //获取提示滚动 | 36 | //获取提示滚动 |
| @@ -129,16 +128,8 @@ export struct SearchComponent { | @@ -129,16 +128,8 @@ export struct SearchComponent { | ||
| 129 | .padding({ left: '31lpx', right: '31lpx' }) | 128 | .padding({ left: '31lpx', right: '31lpx' }) |
| 130 | } else { | 129 | } else { |
| 131 | if (this.hasChooseSearch) { | 130 | if (this.hasChooseSearch) { |
| 132 | - if(!this.isConnectNetwork){ | ||
| 133 | - EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 134 | - this.getSearchInputResData(this.searchText) | ||
| 135 | - }}) | ||
| 136 | - .layoutWeight(1) | ||
| 137 | - .width('100%') | ||
| 138 | - }else{ | ||
| 139 | - //搜索结果 | ||
| 140 | - SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) | ||
| 141 | - } | 131 | + //搜索结果 |
| 132 | + SearchResultComponent({count:this.count,searchText:this.searchText,isGetRequest:this.isGetRequest}) | ||
| 142 | } else { | 133 | } else { |
| 143 | //联想搜索 | 134 | //联想搜索 |
| 144 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) | 135 | SearchRelatedComponent({relatedSearchContentData:$relatedSearchContentsData,onGetSearchRes: (item): void => this.getSearchRelatedResData(item),searchText:this.searchText}) |
| @@ -339,12 +330,10 @@ export struct SearchComponent { | @@ -339,12 +330,10 @@ export struct SearchComponent { | ||
| 339 | } | 330 | } |
| 340 | this.isGetRequest = true | 331 | this.isGetRequest = true |
| 341 | this.resetSearch() | 332 | this.resetSearch() |
| 342 | - this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 343 | }).catch((err: Error) => { | 333 | }).catch((err: Error) => { |
| 344 | console.log(TAG, JSON.stringify(err)) | 334 | console.log(TAG, JSON.stringify(err)) |
| 345 | this.isGetRequest = true | 335 | this.isGetRequest = true |
| 346 | this.resetSearch() | 336 | this.resetSearch() |
| 347 | - this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 348 | }) | 337 | }) |
| 349 | } | 338 | } |
| 350 | 339 |
-
Please register or login to post a comment