Skip to content

Commit

Permalink
1.添加解析请求等待时间 2.订阅源搜书跳转搜书界面。
Browse files Browse the repository at this point in the history
1.添加解析请求等待时间
2.订阅源搜书跳转搜索界面。
  • Loading branch information
MaoXiaoone committed Aug 21, 2024
1 parent 3a421f6 commit 4ffe3d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions entry/src/main/ets/common/model/XmlAnalysis.ets
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class XmlAnalysis {
rule: this.source,
searchUrl: this.searchUrl
}
axios.defaults.timeout = 5000
let response: AxiosResponse<object> = await axios.post('http://legado.wisdoms.xin/analysisBook', data)
if (response.data){
bookList = (response.data as SearchBook[]).map(item => {
Expand Down
4 changes: 3 additions & 1 deletion entry/src/main/ets/componets/search/SearchHead.ets
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export struct SearchHead{
.height(25)
.onClick(()=>{
router.back()
taskSearchBooks.cancelAllTasks()
if (this.isSearch) {
taskSearchBooks.cancelAllTasks()
}
})
Search({ value: this.SearchValue, placeholder: '搜索书名或作者', icon: "/common/images/search.svg" })
.width("70%")
Expand Down
5 changes: 4 additions & 1 deletion entry/src/main/ets/pages/view/Subscription/rssWebView.ets
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ struct RssWebView {
.textAlign(TextAlign.Center)
.onClick(()=>{
router.pushUrl({
url: 'pages/view/search/SearchBook'
url: 'pages/view/search/SearchBook',
params:{
searchValue:this.webTitle
}
});
})
}
Expand Down
18 changes: 15 additions & 3 deletions entry/src/main/ets/pages/view/search/SearchBook.ets
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@ import { SearchHistory } from '../../../componets/search/SearchHistory'
import { SearchDetails } from '../../../componets/search/SearchDetails'
import { SearchRefresh } from '../../../componets/search/SearchRefresh'
import taskSearchBooks from '../../../common/model/taskSearchBook'
import { router } from '@kit.ArkUI'
import { showMessage } from '../../../componets/common/promptShow'

interface routeParams {
searchValue: string,

}
@Entry
@Component
struct SearchBook {
@Provide SearchValue: string ="遮天"
@Provide SearchValue: string =""
@Provide SearchStatus: number=0;
@Provide('searchBookList') books:SearchBook[] = []
@StorageLink('bottomRectHeight') bottomRectHeight: number = 0
@Provide('isSearch') isSearch:boolean = false

aboutToAppear(): void {
let search = router.getParams() as routeParams
if (search) {
this.SearchValue = search.searchValue??''
}
}
onBackPress(): boolean | void {
taskSearchBooks.cancelAllTasks()
if (this.isSearch) {
taskSearchBooks.cancelAllTasks()
}
return false
}
build() {
Expand Down

0 comments on commit 4ffe3d7

Please sign in to comment.